diff options
author | fgorski@chromium.org <fgorski@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-22 07:49:59 +0000 |
---|---|---|
committer | fgorski@chromium.org <fgorski@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-22 07:49:59 +0000 |
commit | 495a7db9fe26af7797c8ee0c14c212068b3a91ff (patch) | |
tree | 6abf415535310428081abec384126b90e63710dc /google_apis/gcm/gcm_client_impl.cc | |
parent | e1407cd51ad10acf1ae553da898565debdc64936 (diff) | |
download | chromium_src-495a7db9fe26af7797c8ee0c14c212068b3a91ff.zip chromium_src-495a7db9fe26af7797c8ee0c14c212068b3a91ff.tar.gz chromium_src-495a7db9fe26af7797c8ee0c14c212068b3a91ff.tar.bz2 |
[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
Diffstat (limited to 'google_apis/gcm/gcm_client_impl.cc')
-rw-r--r-- | google_apis/gcm/gcm_client_impl.cc | 18 |
1 files changed, 10 insertions, 8 deletions
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<std::string>& account_ids, const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, const scoped_refptr<net::URLRequestContextGetter>& 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(); } |