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

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

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 8 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_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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 instance_id_token_info->authorized_entity, 134 instance_id_token_info->authorized_entity,
135 instance_id_token_info->scope); 135 instance_id_token_info->scope);
136 } 136 }
137 137
138 base::ThreadTaskRunnerHandle::Get()->PostTask( 138 base::ThreadTaskRunnerHandle::Get()->PostTask(
139 FROM_HERE, base::Bind(&FakeGCMClient::RegisterFinished, 139 FROM_HERE, base::Bind(&FakeGCMClient::RegisterFinished,
140 weak_ptr_factory_.GetWeakPtr(), registration_info, 140 weak_ptr_factory_.GetWeakPtr(), registration_info,
141 registration_id)); 141 registration_id));
142 } 142 }
143 143
144 bool FakeGCMClient::ValidateRegistration(
145 const linked_ptr<RegistrationInfo>& registration_info,
146 const std::string& registration_id) {
147 return true;
148 }
149
144 void FakeGCMClient::Unregister( 150 void FakeGCMClient::Unregister(
145 const linked_ptr<RegistrationInfo>& registration_info) { 151 const linked_ptr<RegistrationInfo>& registration_info) {
146 DCHECK(io_thread_->RunsTasksOnCurrentThread()); 152 DCHECK(io_thread_->RunsTasksOnCurrentThread());
147 153
148 base::ThreadTaskRunnerHandle::Get()->PostTask( 154 base::ThreadTaskRunnerHandle::Get()->PostTask(
149 FROM_HERE, base::Bind(&FakeGCMClient::UnregisterFinished, 155 FROM_HERE, base::Bind(&FakeGCMClient::UnregisterFinished,
150 weak_ptr_factory_.GetWeakPtr(), registration_info)); 156 weak_ptr_factory_.GetWeakPtr(), registration_info));
151 } 157 }
152 158
153 void FakeGCMClient::Send(const std::string& app_id, 159 void FakeGCMClient::Send(const std::string& app_id,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 delegate_->OnMessageSendError(app_id, send_error_details); 326 delegate_->OnMessageSendError(app_id, send_error_details);
321 } 327 }
322 328
323 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, 329 void FakeGCMClient::SendAcknowledgement(const std::string& app_id,
324 const std::string& message_id) { 330 const std::string& message_id) {
325 if (delegate_) 331 if (delegate_)
326 delegate_->OnSendAcknowledged(app_id, message_id); 332 delegate_->OnSendAcknowledged(app_id, message_id);
327 } 333 }
328 334
329 } // namespace gcm 335 } // 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