mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Disable GCM: fail fast PushManager.subscribe() without a token (#3888)
This commit is contained in:
committed by
GitHub
parent
74fc2911db
commit
bbe89c5a2f
@@ -154,3 +154,32 @@
|
||||
}
|
||||
|
||||
std::string GCMClientImpl::GetStateString() const {
|
||||
--- a/components/gcm_driver/gcm_driver_desktop.cc
|
||||
+++ b/components/gcm_driver/gcm_driver_desktop.cc
|
||||
@@ -1189,25 +1189,7 @@ GCMClient::Result GCMDriverDesktop::EnsureStarted(
|
||||
GCMClient::StartMode start_mode) {
|
||||
DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
||||
|
||||
- if (gcm_started_)
|
||||
- return GCMClient::SUCCESS;
|
||||
-
|
||||
- // Have any app requested the service?
|
||||
- if (app_handlers().empty())
|
||||
- return GCMClient::UNKNOWN_ERROR;
|
||||
-
|
||||
- if (!delayed_task_controller_)
|
||||
- delayed_task_controller_ = std::make_unique<GCMDelayedTaskController>();
|
||||
-
|
||||
- // Note that we need to pass weak pointer again since the existing weak
|
||||
- // pointer in IOWorker might have been invalidated when GCM is stopped.
|
||||
- io_thread_->PostTask(
|
||||
- FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::Start,
|
||||
- base::Unretained(io_worker_.get()), start_mode,
|
||||
- weak_ptr_factory_.GetWeakPtr(),
|
||||
- /*time_task_posted=*/base::TimeTicks::Now()));
|
||||
-
|
||||
- return GCMClient::SUCCESS;
|
||||
+ return GCMClient::GCM_DISABLED;
|
||||
}
|
||||
|
||||
void GCMDriverDesktop::RemoveCachedData() {
|
||||
|
||||
Reference in New Issue
Block a user