| OLD | NEW |
| 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/gcm_driver.h" | 5 #include "components/gcm_driver/gcm_driver.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "components/gcm_driver/gcm_app_handler.h" | 11 #include "components/gcm_driver/gcm_app_handler.h" |
| 12 | 12 |
| 13 namespace gcm { | 13 namespace gcm { |
| 14 | 14 |
| 15 InstanceIDStore::InstanceIDStore() { |
| 16 } |
| 17 |
| 18 InstanceIDStore::~InstanceIDStore() { |
| 19 } |
| 20 |
| 15 GCMDriver::GCMDriver() : weak_ptr_factory_(this) { | 21 GCMDriver::GCMDriver() : weak_ptr_factory_(this) { |
| 16 } | 22 } |
| 17 | 23 |
| 18 GCMDriver::~GCMDriver() { | 24 GCMDriver::~GCMDriver() { |
| 19 } | 25 } |
| 20 | 26 |
| 21 void GCMDriver::Register(const std::string& app_id, | 27 void GCMDriver::Register(const std::string& app_id, |
| 22 const std::vector<std::string>& sender_ids, | 28 const std::vector<std::string>& sender_ids, |
| 23 const RegisterCallback& callback) { | 29 const RegisterCallback& callback) { |
| 24 DCHECK(!app_id.empty()); | 30 DCHECK(!app_id.empty()); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 GCMClient::Result result) { | 244 GCMClient::Result result) { |
| 239 // Invoke the original unregister callback. | 245 // Invoke the original unregister callback. |
| 240 unregister_callback.Run(result); | 246 unregister_callback.Run(result); |
| 241 | 247 |
| 242 // Trigger the pending registration. | 248 // Trigger the pending registration. |
| 243 DCHECK(register_callbacks_.find(app_id) != register_callbacks_.end()); | 249 DCHECK(register_callbacks_.find(app_id) != register_callbacks_.end()); |
| 244 RegisterImpl(app_id, normalized_sender_ids); | 250 RegisterImpl(app_id, normalized_sender_ids); |
| 245 } | 251 } |
| 246 | 252 |
| 247 } // namespace gcm | 253 } // namespace gcm |
| OLD | NEW |