Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 189803002: [GCM] Observe the event listener adding such that GCM can be started (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 198024d3c709aec832c6a9eeafcd194141e6f805..b0bcb13af529d9f62472c0479d5bd36ccc96efc4 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -536,6 +536,10 @@ void GCMProfileService::Initialize(
chrome:: NOTIFICATION_EXTENSION_UNINSTALLED,
content::Source<Profile>(profile_));
+#if !defined(OS_ANDROID)
+ js_event_router_.reset(new extensions::GcmJsEventRouter(profile_));
+#endif
+
// Get the list of available accounts.
std::vector<std::string> account_ids;
#if !defined(OS_ANDROID)
@@ -585,6 +589,12 @@ void GCMProfileService::Stop() {
base::Bind(&GCMProfileService::IOWorker::Stop, io_worker_));
}
+void GCMProfileService::Shutdown() {
+#if !defined(OS_ANDROID)
+ js_event_router_.reset();
+#endif
+}
+
void GCMProfileService::Register(const std::string& app_id,
const std::vector<std::string>& sender_ids,
RegisterCallback callback) {
@@ -771,11 +781,6 @@ void GCMProfileService::EnsureLoaded() {
return;
username_ = username;
-#if !defined(OS_ANDROID)
- if (!js_event_router_)
- js_event_router_.reset(new extensions::GcmJsEventRouter(profile_));
-#endif
-
DCHECK(!delayed_task_controller_);
delayed_task_controller_.reset(new DelayedTaskController);
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.h ('k') | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698