Chromium Code Reviews| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 | 178 |
| 179 // Ask the handlers whether they know how to handle it. | 179 // Ask the handlers whether they know how to handle it. |
| 180 for (iter = app_handlers_.begin(); iter != app_handlers_.end(); ++iter) { | 180 for (iter = app_handlers_.begin(); iter != app_handlers_.end(); ++iter) { |
| 181 if (iter->second->CanHandle(app_id)) | 181 if (iter->second->CanHandle(app_id)) |
| 182 return iter->second; | 182 return iter->second; |
| 183 } | 183 } |
| 184 | 184 |
| 185 return &default_app_handler_; | 185 return &default_app_handler_; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void GCMDriver::AddConnectionObserver(GCMConnectionObserver* observer) { | |
| 189 } | |
|
jianli
2014/08/27 23:34:17
Please comment that connection observing is only s
fgorski
2014/08/27 23:51:45
Done. Made abstract in GCMDriver and moved empty m
| |
| 190 | |
| 191 void GCMDriver::RemoveConnectionObserver(GCMConnectionObserver* observer) { | |
| 192 } | |
| 193 | |
| 188 bool GCMDriver::HasRegisterCallback(const std::string& app_id) { | 194 bool GCMDriver::HasRegisterCallback(const std::string& app_id) { |
| 189 return register_callbacks_.find(app_id) != register_callbacks_.end(); | 195 return register_callbacks_.find(app_id) != register_callbacks_.end(); |
| 190 } | 196 } |
| 191 | 197 |
| 192 void GCMDriver::ClearCallbacks() { | 198 void GCMDriver::ClearCallbacks() { |
| 193 register_callbacks_.clear(); | 199 register_callbacks_.clear(); |
| 194 unregister_callbacks_.clear(); | 200 unregister_callbacks_.clear(); |
| 195 send_callbacks_.clear(); | 201 send_callbacks_.clear(); |
| 196 } | 202 } |
| 197 | 203 |
| 198 bool GCMDriver::IsAsyncOperationPending(const std::string& app_id) const { | 204 bool GCMDriver::IsAsyncOperationPending(const std::string& app_id) const { |
| 199 return register_callbacks_.find(app_id) != register_callbacks_.end() || | 205 return register_callbacks_.find(app_id) != register_callbacks_.end() || |
| 200 unregister_callbacks_.find(app_id) != unregister_callbacks_.end(); | 206 unregister_callbacks_.find(app_id) != unregister_callbacks_.end(); |
| 201 } | 207 } |
| 202 | 208 |
| 203 } // namespace gcm | 209 } // namespace gcm |
| OLD | NEW |