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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "components/gcm_driver/gcm_driver.h" | 9 #include "components/gcm_driver/gcm_driver.h" |
10 #include "components/invalidation/gcm_invalidation_bridge.h" | 10 #include "components/invalidation/gcm_invalidation_bridge.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 registration_id, | 279 registration_id, |
280 result)); | 280 result)); |
281 } | 281 } |
282 | 282 |
283 void GCMInvalidationBridge::Unregister() { | 283 void GCMInvalidationBridge::Unregister() { |
284 DCHECK(CalledOnValidThread()); | 284 DCHECK(CalledOnValidThread()); |
285 // No-op if GCMClient is disabled. | 285 // No-op if GCMClient is disabled. |
286 if (gcm_driver_ == NULL) | 286 if (gcm_driver_ == NULL) |
287 return; | 287 return; |
288 | 288 |
| 289 std::vector<std::string> sender_ids; |
| 290 sender_ids.push_back(kInvalidationsSenderId); |
289 gcm_driver_->Unregister( | 291 gcm_driver_->Unregister( |
290 kInvalidationsAppId, | 292 kInvalidationsAppId, |
| 293 sender_ids, |
291 base::Bind(&GCMInvalidationBridge::UnregisterFinishedNoOp)); | 294 base::Bind(&GCMInvalidationBridge::UnregisterFinishedNoOp)); |
292 } | 295 } |
293 | 296 |
294 // static | 297 // static |
295 void GCMInvalidationBridge::UnregisterFinishedNoOp( | 298 void GCMInvalidationBridge::UnregisterFinishedNoOp( |
296 gcm::GCMClient::Result result) { | 299 gcm::GCMClient::Result result) { |
297 // No-op. | 300 // No-op. |
298 } | 301 } |
299 | 302 |
300 void GCMInvalidationBridge::SubscribeForIncomingMessages() { | 303 void GCMInvalidationBridge::SubscribeForIncomingMessages() { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 371 |
369 void GCMInvalidationBridge::OnDisconnected() { | 372 void GCMInvalidationBridge::OnDisconnected() { |
370 core_thread_task_runner_->PostTask( | 373 core_thread_task_runner_->PostTask( |
371 FROM_HERE, | 374 FROM_HERE, |
372 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, | 375 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, |
373 core_, | 376 core_, |
374 false)); | 377 false)); |
375 } | 378 } |
376 | 379 |
377 } // namespace invalidation | 380 } // namespace invalidation |
OLD | NEW |