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

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

Issue 2907463002: Split HttpNetworkSession::Params into two structs. (Closed)
Patch Set: Response to comments Created 3 years, 6 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 GCMClient::Delegate* delegate) { 318 GCMClient::Delegate* delegate) {
319 DCHECK_EQ(UNINITIALIZED, state_); 319 DCHECK_EQ(UNINITIALIZED, state_);
320 DCHECK(url_request_context_getter.get()); 320 DCHECK(url_request_context_getter.get());
321 DCHECK(delegate); 321 DCHECK(delegate);
322 322
323 url_request_context_getter_ = url_request_context_getter; 323 url_request_context_getter_ = url_request_context_getter;
324 const net::HttpNetworkSession::Params* network_session_params = 324 const net::HttpNetworkSession::Params* network_session_params =
325 url_request_context_getter_->GetURLRequestContext()-> 325 url_request_context_getter_->GetURLRequestContext()->
326 GetNetworkSessionParams(); 326 GetNetworkSessionParams();
327 DCHECK(network_session_params); 327 DCHECK(network_session_params);
328 network_session_.reset(new net::HttpNetworkSession(*network_session_params)); 328 const net::HttpNetworkSession::Context* network_session_context =
329 url_request_context_getter_->GetURLRequestContext()
330 ->GetNetworkSessionContext();
331 network_session_.reset(new net::HttpNetworkSession(*network_session_params,
332 *network_session_context));
329 333
330 chrome_build_info_ = chrome_build_info; 334 chrome_build_info_ = chrome_build_info;
331 335
332 gcm_store_.reset( 336 gcm_store_.reset(
333 new GCMStoreImpl(path, blocking_task_runner, std::move(encryptor))); 337 new GCMStoreImpl(path, blocking_task_runner, std::move(encryptor)));
334 338
335 delegate_ = delegate; 339 delegate_ = delegate;
336 340
337 recorder_.SetDelegate(this); 341 recorder_.SetDelegate(this);
338 342
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 bool GCMClientImpl::HasStandaloneRegisteredApp() const { 1506 bool GCMClientImpl::HasStandaloneRegisteredApp() const {
1503 if (registrations_.empty()) 1507 if (registrations_.empty())
1504 return false; 1508 return false;
1505 // Note that account mapper is not counted as a standalone app since it is 1509 // Note that account mapper is not counted as a standalone app since it is
1506 // automatically started when other app uses GCM. 1510 // automatically started when other app uses GCM.
1507 return registrations_.size() > 1 || 1511 return registrations_.size() > 1 ||
1508 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); 1512 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId);
1509 } 1513 }
1510 1514
1511 } // namespace gcm 1515 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698