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

Side by Side Diff: components/gcm_driver/fake_gcm_app_handler.cc

Issue 515763002: [GCM] Extracting GCMConnectionObserver from GCMAppHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR feedback Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « components/gcm_driver/fake_gcm_app_handler.h ('k') | components/gcm_driver/fake_gcm_driver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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), connected_(false) { 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 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 void FakeGCMAppHandler::ClearResults() { 66 void FakeGCMAppHandler::ClearResults() {
67 received_event_ = NO_EVENT; 67 received_event_ = NO_EVENT;
68 app_id_.clear(); 68 app_id_.clear();
69 acked_message_id_.clear(); 69 acked_message_id_.clear();
70 message_ = GCMClient::IncomingMessage(); 70 message_ = GCMClient::IncomingMessage();
71 send_error_details_ = GCMClient::SendErrorDetails(); 71 send_error_details_ = GCMClient::SendErrorDetails();
72 } 72 }
73 73
74 void FakeGCMAppHandler::OnConnected(const net::IPEndPoint& ip_endpoint) {
75 connected_ = true;
76 }
77
78 void FakeGCMAppHandler::OnDisconnected() {
79 connected_ = false;
80 }
81
82 } // namespace gcm 74 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/fake_gcm_app_handler.h ('k') | components/gcm_driver/fake_gcm_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698