| 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 "google_apis/gcm/engine/heartbeat_manager.h" | 5 #include "google_apis/gcm/engine/heartbeat_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/power_monitor/power_monitor.h" | 12 #include "base/power_monitor/power_monitor.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "google_apis/gcm/protocol/mcs.pb.h" | 17 #include "google_apis/gcm/protocol/mcs.pb.h" |
| 18 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
| 19 | 19 |
| 20 namespace gcm { | 20 namespace gcm { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 // The default heartbeat when on a mobile or unknown network . | 23 // The default heartbeat when on a mobile or unknown network . |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 interval <= max_heartbeat_interval; | 294 interval <= max_heartbeat_interval; |
| 295 } | 295 } |
| 296 | 296 |
| 297 void HeartbeatManager::ResetConnection( | 297 void HeartbeatManager::ResetConnection( |
| 298 ConnectionFactory::ConnectionResetReason reason) { | 298 ConnectionFactory::ConnectionResetReason reason) { |
| 299 Stop(); | 299 Stop(); |
| 300 trigger_reconnect_callback_.Run(reason); | 300 trigger_reconnect_callback_.Run(reason); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace gcm | 303 } // namespace gcm |
| OLD | NEW |