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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); | 834 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
835 | 835 |
836 // Normally request_gcm_statistics_callback_ would not be null. | 836 // Normally request_gcm_statistics_callback_ would not be null. |
837 if (!request_gcm_statistics_callback_.is_null()) | 837 if (!request_gcm_statistics_callback_.is_null()) |
838 request_gcm_statistics_callback_.Run(stats); | 838 request_gcm_statistics_callback_.Run(stats); |
839 else | 839 else |
840 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; | 840 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; |
841 } | 841 } |
842 | 842 |
843 } // namespace gcm | 843 } // namespace gcm |
OLD | NEW |