OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "chrome/browser/chromeos/policy/heartbeat_scheduler.h" | 5 #include "chrome/browser/chromeos/policy/heartbeat_scheduler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 | 417 |
418 void HeartbeatScheduler::ShutdownHandler() { | 418 void HeartbeatScheduler::ShutdownHandler() { |
419 // This should never be called, because BrowserProcessImpl::StartTearDown() | 419 // This should never be called, because BrowserProcessImpl::StartTearDown() |
420 // should shutdown the BrowserPolicyConnector (which destroys this object) | 420 // should shutdown the BrowserPolicyConnector (which destroys this object) |
421 // before the GCMDriver. Our goal is to make sure that this object is always | 421 // before the GCMDriver. Our goal is to make sure that this object is always |
422 // shutdown before GCMDriver is shut down, rather than trying to handle the | 422 // shutdown before GCMDriver is shut down, rather than trying to handle the |
423 // case when GCMDriver goes away. | 423 // case when GCMDriver goes away. |
424 NOTREACHED() << "HeartbeatScheduler should be destroyed before GCMDriver"; | 424 NOTREACHED() << "HeartbeatScheduler should be destroyed before GCMDriver"; |
425 } | 425 } |
426 | 426 |
427 void HeartbeatScheduler::OnStoreReset() { | |
428 // Nothing to do here since HeartbeatScheduler doesn't locally persist | |
429 // registration ID, instead it just re-registers. | |
Peter Beverloo
2016/11/03 17:28:56
registration_id_?
Peter Beverloo
2016/11/03 17:28:56
What about CloudPolicyClient::UpdateGcmId()? There
johnme
2016/11/08 19:22:41
Done.
johnme
2016/11/08 19:22:41
Done - I now call ShutdownGCM.
| |
430 } | |
431 | |
427 void HeartbeatScheduler::OnMessage(const std::string& app_id, | 432 void HeartbeatScheduler::OnMessage(const std::string& app_id, |
428 const gcm::IncomingMessage& message) { | 433 const gcm::IncomingMessage& message) { |
429 // Should never be called because we don't get any incoming messages | 434 // Should never be called because we don't get any incoming messages |
430 // for our app ID. | 435 // for our app ID. |
431 NOTREACHED() << "Received incoming message for " << app_id; | 436 NOTREACHED() << "Received incoming message for " << app_id; |
432 } | 437 } |
433 | 438 |
434 void HeartbeatScheduler::OnMessagesDeleted(const std::string& app_id) { | 439 void HeartbeatScheduler::OnMessagesDeleted(const std::string& app_id) { |
435 } | 440 } |
436 | 441 |
(...skipping 11 matching lines...) Expand all Loading... | |
448 void HeartbeatScheduler::OnConnected(const net::IPEndPoint&) { | 453 void HeartbeatScheduler::OnConnected(const net::IPEndPoint&) { |
449 SignUpUpstreamNotification(); | 454 SignUpUpstreamNotification(); |
450 } | 455 } |
451 | 456 |
452 void HeartbeatScheduler::OnGcmIdUpdateRequestSent(bool success) { | 457 void HeartbeatScheduler::OnGcmIdUpdateRequestSent(bool success) { |
453 // TODO(binjin): Handle the failure, probably by exponential backoff. | 458 // TODO(binjin): Handle the failure, probably by exponential backoff. |
454 LOG_IF(WARNING, !success) << "Failed to send GCM id to DM server"; | 459 LOG_IF(WARNING, !success) << "Failed to send GCM id to DM server"; |
455 } | 460 } |
456 | 461 |
457 } // namespace policy | 462 } // namespace policy |
OLD | NEW |