Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1037)

Side by Side Diff: components/gcm_driver/gcm_client_impl.cc

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up includes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 weak_ptr_factory_.GetWeakPtr())); 471 weak_ptr_factory_.GetWeakPtr()));
472 } 472 }
473 473
474 void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) { 474 void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) {
475 gcm_store_->SetLastTokenFetchTime( 475 gcm_store_->SetLastTokenFetchTime(
476 time, 476 time,
477 base::Bind(&GCMClientImpl::IgnoreWriteResultCallback, 477 base::Bind(&GCMClientImpl::IgnoreWriteResultCallback,
478 weak_ptr_factory_.GetWeakPtr())); 478 weak_ptr_factory_.GetWeakPtr()));
479 } 479 }
480 480
481 void GCMClientImpl::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
482 DCHECK(mcs_client_);
483 mcs_client_->UpdateHeartbeatTimer(timer.Pass());
484 }
485
481 void GCMClientImpl::StartCheckin() { 486 void GCMClientImpl::StartCheckin() {
482 // Make sure no checkin is in progress. 487 // Make sure no checkin is in progress.
483 if (checkin_request_.get()) 488 if (checkin_request_.get())
484 return; 489 return;
485 490
486 checkin_proto::ChromeBuildProto chrome_build_proto; 491 checkin_proto::ChromeBuildProto chrome_build_proto;
487 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto); 492 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
488 CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id, 493 CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id,
489 device_checkin_info_.secret, 494 device_checkin_info_.secret,
490 device_checkin_info_.account_tokens, 495 device_checkin_info_.account_tokens,
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 995
991 recorder_.RecordIncomingSendError( 996 recorder_.RecordIncomingSendError(
992 data_message_stanza.category(), 997 data_message_stanza.category(),
993 data_message_stanza.to(), 998 data_message_stanza.to(),
994 data_message_stanza.id()); 999 data_message_stanza.id());
995 delegate_->OnMessageSendError(data_message_stanza.category(), 1000 delegate_->OnMessageSendError(data_message_stanza.category(),
996 send_error_details); 1001 send_error_details);
997 } 1002 }
998 1003
999 } // namespace gcm 1004 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698