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

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: Make GCM wake from suspend aware 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 MCSClient* GCMClientImpl::GetMCSClient() const {
482 return mcs_client_.get();
483 }
484
481 void GCMClientImpl::StartCheckin() { 485 void GCMClientImpl::StartCheckin() {
482 // Make sure no checkin is in progress. 486 // Make sure no checkin is in progress.
483 if (checkin_request_.get()) 487 if (checkin_request_.get())
484 return; 488 return;
485 489
486 checkin_proto::ChromeBuildProto chrome_build_proto; 490 checkin_proto::ChromeBuildProto chrome_build_proto;
487 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto); 491 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
488 CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id, 492 CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id,
489 device_checkin_info_.secret, 493 device_checkin_info_.secret,
490 device_checkin_info_.account_tokens, 494 device_checkin_info_.account_tokens,
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 994
991 recorder_.RecordIncomingSendError( 995 recorder_.RecordIncomingSendError(
992 data_message_stanza.category(), 996 data_message_stanza.category(),
993 data_message_stanza.to(), 997 data_message_stanza.to(),
994 data_message_stanza.id()); 998 data_message_stanza.id());
995 delegate_->OnMessageSendError(data_message_stanza.category(), 999 delegate_->OnMessageSendError(data_message_stanza.category(),
996 send_error_details); 1000 send_error_details);
997 } 1001 }
998 1002
999 } // namespace gcm 1003 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698