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

Side by Side Diff: components/invalidation/impl/gcm_invalidation_bridge.cc

Issue 2473813002: Notify GCMAppHandlers when the store is reset, so they clear cached IDs (Closed)
Patch Set: 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 core_, 312 core_,
313 gcm_driver_->IsConnected())); 313 gcm_driver_->IsConnected()));
314 314
315 subscribed_for_incoming_messages_ = true; 315 subscribed_for_incoming_messages_ = true;
316 } 316 }
317 317
318 void GCMInvalidationBridge::ShutdownHandler() { 318 void GCMInvalidationBridge::ShutdownHandler() {
319 // Nothing to do. 319 // Nothing to do.
320 } 320 }
321 321
322 void GCMInvalidationBridge::OnStoreReset() {
323 // Nothing to do here since CacheInvalidation doesn't locally persist
324 // registration ID, instead it just re-registers on every startup.
Peter Beverloo 2016/11/03 17:28:57 What about GCMNetworkChannel::registration_id_?
johnme 2016/11/08 19:22:41 Done - this was a little more involved, as I had t
325 }
326
322 void GCMInvalidationBridge::OnMessage(const std::string& app_id, 327 void GCMInvalidationBridge::OnMessage(const std::string& app_id,
323 const gcm::IncomingMessage& message) { 328 const gcm::IncomingMessage& message) {
324 gcm::MessageData::const_iterator it; 329 gcm::MessageData::const_iterator it;
325 std::string content; 330 std::string content;
326 std::string echo_token; 331 std::string echo_token;
327 it = message.data.find(kContentKey); 332 it = message.data.find(kContentKey);
328 if (it != message.data.end()) 333 if (it != message.data.end())
329 content = it->second; 334 content = it->second;
330 it = message.data.find(kEchoTokenKey); 335 it = message.data.find(kEchoTokenKey);
331 if (it != message.data.end()) 336 if (it != message.data.end())
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 373
369 void GCMInvalidationBridge::OnDisconnected() { 374 void GCMInvalidationBridge::OnDisconnected() {
370 core_thread_task_runner_->PostTask( 375 core_thread_task_runner_->PostTask(
371 FROM_HERE, 376 FROM_HERE,
372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, 377 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged,
373 core_, 378 core_,
374 false)); 379 false));
375 } 380 }
376 381
377 } // namespace invalidation 382 } // namespace invalidation
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698