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

Side by Side Diff: components/gcm_driver/fake_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 "components/gcm_driver/fake_gcm_app_handler.h" 5 #include "components/gcm_driver/fake_gcm_app_handler.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 8
9 namespace gcm { 9 namespace gcm {
10 10
11 FakeGCMAppHandler::FakeGCMAppHandler() 11 FakeGCMAppHandler::FakeGCMAppHandler()
12 : received_event_(NO_EVENT) { 12 : received_event_(NO_EVENT) {
13 } 13 }
14 14
15 FakeGCMAppHandler::~FakeGCMAppHandler() { 15 FakeGCMAppHandler::~FakeGCMAppHandler() {
16 } 16 }
17 17
18 void FakeGCMAppHandler::WaitForNotification() { 18 void FakeGCMAppHandler::WaitForNotification() {
19 run_loop_.reset(new base::RunLoop); 19 run_loop_.reset(new base::RunLoop);
20 run_loop_->Run(); 20 run_loop_->Run();
21 run_loop_.reset(); 21 run_loop_.reset();
22 } 22 }
23 23
24 void FakeGCMAppHandler::ShutdownHandler() { 24 void FakeGCMAppHandler::ShutdownHandler() {
25 } 25 }
26 26
27 void FakeGCMAppHandler::OnStoreReset() {}
28
27 void FakeGCMAppHandler::OnMessage(const std::string& app_id, 29 void FakeGCMAppHandler::OnMessage(const std::string& app_id,
28 const IncomingMessage& message) { 30 const IncomingMessage& message) {
29 ClearResults(); 31 ClearResults();
30 received_event_ = MESSAGE_EVENT; 32 received_event_ = MESSAGE_EVENT;
31 app_id_ = app_id; 33 app_id_ = app_id;
32 message_ = message; 34 message_ = message;
33 if (run_loop_) 35 if (run_loop_)
34 run_loop_->Quit(); 36 run_loop_->Quit();
35 } 37 }
36 38
(...skipping 28 matching lines...) Expand all
65 67
66 void FakeGCMAppHandler::ClearResults() { 68 void FakeGCMAppHandler::ClearResults() {
67 received_event_ = NO_EVENT; 69 received_event_ = NO_EVENT;
68 app_id_.clear(); 70 app_id_.clear();
69 acked_message_id_.clear(); 71 acked_message_id_.clear();
70 message_ = IncomingMessage(); 72 message_ = IncomingMessage();
71 send_error_details_ = GCMClient::SendErrorDetails(); 73 send_error_details_ = GCMClient::SendErrorDetails();
72 } 74 }
73 75
74 } // namespace gcm 76 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/fake_gcm_app_handler.h ('k') | components/gcm_driver/gcm_account_mapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698