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); |