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

Side by Side Diff: google_apis/gcm/gcm_client_impl.cc

Issue 171683002: [GCM] Fix gcm login to properly identify chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 6 years, 10 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "google_apis/gcm/gcm_client_impl.h" 5 #include "google_apis/gcm/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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 const net::HttpNetworkSession::Params* network_session_params = 161 const net::HttpNetworkSession::Params* network_session_params =
162 url_request_context_getter->GetURLRequestContext()-> 162 url_request_context_getter->GetURLRequestContext()->
163 GetNetworkSessionParams(); 163 GetNetworkSessionParams();
164 DCHECK(network_session_params); 164 DCHECK(network_session_params);
165 network_session_ = new net::HttpNetworkSession(*network_session_params); 165 network_session_ = new net::HttpNetworkSession(*network_session_params);
166 connection_factory_.reset(new ConnectionFactoryImpl( 166 connection_factory_.reset(new ConnectionFactoryImpl(
167 GURL(kMCSEndpoint), 167 GURL(kMCSEndpoint),
168 kDefaultBackoffPolicy, 168 kDefaultBackoffPolicy,
169 network_session_, 169 network_session_,
170 net_log_.net_log())); 170 net_log_.net_log()));
171 mcs_client_.reset(new MCSClient(clock_.get(), 171 mcs_client_.reset(new MCSClient(chrome_build_proto.chrome_version(),
172 clock_.get(),
172 connection_factory_.get(), 173 connection_factory_.get(),
173 gcm_store_.get())); 174 gcm_store_.get()));
174 } 175 }
175 176
176 state_ = LOADING; 177 state_ = LOADING;
177 } 178 }
178 179
179 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) { 180 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) {
180 DCHECK_EQ(LOADING, state_); 181 DCHECK_EQ(LOADING, state_);
181 182
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 if (iter != incoming_message.data.end()) 570 if (iter != incoming_message.data.end())
570 message_id = iter->second; 571 message_id = iter->second;
571 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR); 572 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR);
572 } 573 }
573 574
574 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) { 575 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) {
575 mcs_client_ = mcs_client.Pass(); 576 mcs_client_ = mcs_client.Pass();
576 } 577 }
577 578
578 } // namespace gcm 579 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698