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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: Update Cryptauth comment Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ++extension) { 61 ++extension) {
62 if (IsGCMPermissionEnabled(extension->get())) 62 if (IsGCMPermissionEnabled(extension->get()))
63 GetGCMDriver()->RemoveAppHandler((*extension)->id()); 63 GetGCMDriver()->RemoveAppHandler((*extension)->id());
64 } 64 }
65 } 65 }
66 66
67 void ExtensionGCMAppHandler::ShutdownHandler() { 67 void ExtensionGCMAppHandler::ShutdownHandler() {
68 js_event_router_.reset(); 68 js_event_router_.reset();
69 } 69 }
70 70
71 void ExtensionGCMAppHandler::OnStoreReset() {
72 // TODO(crbug.com/661660): Notify the extension somehow that its registration
73 // was invalidated and deleted?
74 }
75
71 void ExtensionGCMAppHandler::OnMessage(const std::string& app_id, 76 void ExtensionGCMAppHandler::OnMessage(const std::string& app_id,
72 const gcm::IncomingMessage& message) { 77 const gcm::IncomingMessage& message) {
73 js_event_router_->OnMessage(app_id, message); 78 js_event_router_->OnMessage(app_id, message);
74 } 79 }
75 80
76 void ExtensionGCMAppHandler::OnMessagesDeleted(const std::string& app_id) { 81 void ExtensionGCMAppHandler::OnMessagesDeleted(const std::string& app_id) {
77 js_event_router_->OnMessagesDeleted(app_id); 82 js_event_router_->OnMessagesDeleted(app_id);
78 } 83 }
79 84
80 void ExtensionGCMAppHandler::OnSendError( 85 void ExtensionGCMAppHandler::OnSendError(
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 198
194 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { 199 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) {
195 GetGCMDriver()->AddAppHandler(app_id, this); 200 GetGCMDriver()->AddAppHandler(app_id, this);
196 } 201 }
197 202
198 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { 203 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) {
199 GetGCMDriver()->RemoveAppHandler(app_id); 204 GetGCMDriver()->RemoveAppHandler(app_id);
200 } 205 }
201 206
202 } // namespace extensions 207 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.h ('k') | chrome/browser/push_messaging/push_messaging_app_identifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698