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_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 if (gcm_client_.get()) | 337 if (gcm_client_.get()) |
338 gcm_client_->SetLastTokenFetchTime(time); | 338 gcm_client_->SetLastTokenFetchTime(time); |
339 } | 339 } |
340 | 340 |
341 void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) { | 341 void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) { |
342 #if defined(OS_CHROMEOS) | 342 #if defined(OS_CHROMEOS) |
343 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 343 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
344 | 344 |
345 scoped_ptr<base::Timer> timer; | 345 scoped_ptr<base::Timer> timer; |
346 if (wake) | 346 if (wake) |
347 timer.reset(new timers::AlarmTimer(true, false)); | 347 timer.reset(new timers::SimpleAlarmTimer()); |
348 else | 348 else |
349 timer.reset(new base::Timer(true, false)); | 349 timer.reset(new base::Timer(true, false)); |
350 | 350 |
351 gcm_client_->UpdateHeartbeatTimer(timer.Pass()); | 351 gcm_client_->UpdateHeartbeatTimer(timer.Pass()); |
352 #endif | 352 #endif |
353 } | 353 } |
354 | 354 |
355 GCMDriverDesktop::GCMDriverDesktop( | 355 GCMDriverDesktop::GCMDriverDesktop( |
356 scoped_ptr<GCMClientFactory> gcm_client_factory, | 356 scoped_ptr<GCMClientFactory> gcm_client_factory, |
357 const GCMClient::ChromeBuildInfo& chrome_build_info, | 357 const GCMClient::ChromeBuildInfo& chrome_build_info, |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); | 836 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
837 | 837 |
838 // Normally request_gcm_statistics_callback_ would not be null. | 838 // Normally request_gcm_statistics_callback_ would not be null. |
839 if (!request_gcm_statistics_callback_.is_null()) | 839 if (!request_gcm_statistics_callback_.is_null()) |
840 request_gcm_statistics_callback_.Run(stats); | 840 request_gcm_statistics_callback_.Run(stats); |
841 else | 841 else |
842 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; | 842 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; |
843 } | 843 } |
844 | 844 |
845 } // namespace gcm | 845 } // namespace gcm |
OLD | NEW |