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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) { | 473 void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) { |
474 #if defined(OS_CHROMEOS) | 474 #if defined(OS_CHROMEOS) |
475 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 475 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
476 | 476 |
477 scoped_ptr<base::Timer> timer; | 477 scoped_ptr<base::Timer> timer; |
478 if (wake) | 478 if (wake) |
479 timer.reset(new timers::SimpleAlarmTimer()); | 479 timer.reset(new timers::SimpleAlarmTimer()); |
480 else | 480 else |
481 timer.reset(new base::Timer(true, false)); | 481 timer.reset(new base::Timer(true, false)); |
482 | 482 |
483 gcm_client_->UpdateHeartbeatTimer(timer.Pass()); | 483 gcm_client_->UpdateHeartbeatTimer(std::move(timer)); |
484 #endif | 484 #endif |
485 } | 485 } |
486 | 486 |
487 void GCMDriverDesktop::IOWorker::AddHeartbeatInterval(const std::string& scope, | 487 void GCMDriverDesktop::IOWorker::AddHeartbeatInterval(const std::string& scope, |
488 int interval_ms) { | 488 int interval_ms) { |
489 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 489 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
490 gcm_client_->AddHeartbeatInterval(scope, interval_ms); | 490 gcm_client_->AddHeartbeatInterval(scope, interval_ms); |
491 } | 491 } |
492 | 492 |
493 void GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval( | 493 void GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval( |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 | 1301 |
1302 if (base::get<1>(a) < base::get<1>(b)) | 1302 if (base::get<1>(a) < base::get<1>(b)) |
1303 return true; | 1303 return true; |
1304 if (base::get<1>(a) > base::get<1>(b)) | 1304 if (base::get<1>(a) > base::get<1>(b)) |
1305 return false; | 1305 return false; |
1306 | 1306 |
1307 return base::get<2>(a) < base::get<2>(b); | 1307 return base::get<2>(a) < base::get<2>(b); |
1308 } | 1308 } |
1309 | 1309 |
1310 } // namespace gcm | 1310 } // namespace gcm |
OLD | NEW |