From 495a7db9fe26af7797c8ee0c14c212068b3a91ff Mon Sep 17 00:00:00 2001 From: "fgorski@chromium.org" Date: Sat, 22 Feb 2014 07:49:59 +0000 Subject: [GCM] Adding a list of accounts present on the client to checkin request We need to bind device id (profile specific) to accounts running in that profile. For that reason we are grabbing all of the accounts as tracked by the ProfileOAuth2TokenService and pass them to Initialize method of GCMClientImpl. The list of accounts is then passed to CheckinRequest when the request is happening. Once the CheckinRequest is done more often than simply on login, we may want to give a more updated list of accounts than the one present on startup of Chromium. For now there is no reason to handle that case. BUG=343203 Review URL: https://codereview.chromium.org/171513004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252759 0039d316-1c4b-4281-b951-d872f2087c98 --- google_apis/gcm/gcm_client_impl.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'google_apis/gcm/gcm_client_impl.cc') diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc index 491599c..d039fdc 100644 --- a/google_apis/gcm/gcm_client_impl.cc +++ b/google_apis/gcm/gcm_client_impl.cc @@ -126,6 +126,7 @@ GCMClientImpl::~GCMClientImpl() { void GCMClientImpl::Initialize( const checkin_proto::ChromeBuildProto& chrome_build_proto, const base::FilePath& path, + const std::vector& account_ids, const scoped_refptr& blocking_task_runner, const scoped_refptr& url_request_context_getter, @@ -136,6 +137,7 @@ void GCMClientImpl::Initialize( chrome_build_proto_.CopyFrom(chrome_build_proto); url_request_context_getter_ = url_request_context_getter; + account_ids_ = account_ids; gcm_store_.reset(new GCMStoreImpl(false, path, blocking_task_runner)); gcm_store_->Load(base::Bind(&GCMClientImpl::OnLoadCompleted, @@ -232,14 +234,14 @@ void GCMClientImpl::ResetState() { void GCMClientImpl::StartCheckin(const CheckinInfo& checkin_info) { checkin_request_.reset( - new CheckinRequest( - base::Bind(&GCMClientImpl::OnCheckinCompleted, - weak_ptr_factory_.GetWeakPtr()), - kDefaultBackoffPolicy, - chrome_build_proto_, - checkin_info.android_id, - checkin_info.secret, - url_request_context_getter_)); + new CheckinRequest(base::Bind(&GCMClientImpl::OnCheckinCompleted, + weak_ptr_factory_.GetWeakPtr()), + kDefaultBackoffPolicy, + chrome_build_proto_, + checkin_info.android_id, + checkin_info.secret, + account_ids_, + url_request_context_getter_)); checkin_request_->Start(); } -- cgit v1.1