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

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

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing include Created 6 years 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_client.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_client.h" 5 #include "components/gcm_driver/fake_gcm_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/sys_byteorder.h" 12 #include "base/sys_byteorder.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "base/timer/timer.h"
14 #include "google_apis/gcm/base/encryptor.h" 15 #include "google_apis/gcm/base/encryptor.h"
15 #include "google_apis/gcm/engine/account_mapping.h" 16 #include "google_apis/gcm/engine/account_mapping.h"
16 #include "net/base/ip_endpoint.h" 17 #include "net/base/ip_endpoint.h"
17 18
18 namespace gcm { 19 namespace gcm {
19 20
20 FakeGCMClient::FakeGCMClient( 21 FakeGCMClient::FakeGCMClient(
21 StartMode start_mode, 22 StartMode start_mode,
22 const scoped_refptr<base::SequencedTaskRunner>& ui_thread, 23 const scoped_refptr<base::SequencedTaskRunner>& ui_thread,
23 const scoped_refptr<base::SequencedTaskRunner>& io_thread) 24 const scoped_refptr<base::SequencedTaskRunner>& io_thread)
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void FakeGCMClient::UpdateAccountMapping( 127 void FakeGCMClient::UpdateAccountMapping(
127 const AccountMapping& account_mapping) { 128 const AccountMapping& account_mapping) {
128 } 129 }
129 130
130 void FakeGCMClient::RemoveAccountMapping(const std::string& account_id) { 131 void FakeGCMClient::RemoveAccountMapping(const std::string& account_id) {
131 } 132 }
132 133
133 void FakeGCMClient::SetLastTokenFetchTime(const base::Time& time) { 134 void FakeGCMClient::SetLastTokenFetchTime(const base::Time& time) {
134 } 135 }
135 136
137 void FakeGCMClient::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
138 }
139
136 void FakeGCMClient::PerformDelayedLoading() { 140 void FakeGCMClient::PerformDelayedLoading() {
137 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); 141 DCHECK(ui_thread_->RunsTasksOnCurrentThread());
138 142
139 io_thread_->PostTask( 143 io_thread_->PostTask(
140 FROM_HERE, 144 FROM_HERE,
141 base::Bind(&FakeGCMClient::DoLoading, weak_ptr_factory_.GetWeakPtr())); 145 base::Bind(&FakeGCMClient::DoLoading, weak_ptr_factory_.GetWeakPtr()));
142 } 146 }
143 147
144 void FakeGCMClient::ReceiveMessage(const std::string& app_id, 148 void FakeGCMClient::ReceiveMessage(const std::string& app_id,
145 const IncomingMessage& message) { 149 const IncomingMessage& message) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 delegate_->OnMessageSendError(app_id, send_error_details); 251 delegate_->OnMessageSendError(app_id, send_error_details);
248 } 252 }
249 253
250 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, 254 void FakeGCMClient::SendAcknowledgement(const std::string& app_id,
251 const std::string& message_id) { 255 const std::string& message_id) {
252 if (delegate_) 256 if (delegate_)
253 delegate_->OnSendAcknowledged(app_id, message_id); 257 delegate_->OnSendAcknowledged(app_id, message_id);
254 } 258 }
255 259
256 } // namespace gcm 260 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/fake_gcm_client.h ('k') | components/gcm_driver/fake_gcm_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698