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

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

Issue 1492913002: Add command line overrides for GCM checkin URL & MCS endpoint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review nit Created 5 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
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } 471 }
472 472
473 state_ = INITIAL_DEVICE_CHECKIN; 473 state_ = INITIAL_DEVICE_CHECKIN;
474 device_checkin_info_.Reset(); 474 device_checkin_info_.Reset();
475 StartCheckin(); 475 StartCheckin();
476 } 476 }
477 477
478 void GCMClientImpl::InitializeMCSClient() { 478 void GCMClientImpl::InitializeMCSClient() {
479 std::vector<GURL> endpoints; 479 std::vector<GURL> endpoints;
480 endpoints.push_back(gservices_settings_.GetMCSMainEndpoint()); 480 endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
481 endpoints.push_back(gservices_settings_.GetMCSFallbackEndpoint()); 481 GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
482 if (fallback_endpoint.is_valid())
483 endpoints.push_back(fallback_endpoint);
482 connection_factory_ = internals_builder_->BuildConnectionFactory( 484 connection_factory_ = internals_builder_->BuildConnectionFactory(
483 endpoints, 485 endpoints,
484 GetGCMBackoffPolicy(), 486 GetGCMBackoffPolicy(),
485 network_session_.get(), 487 network_session_.get(),
486 url_request_context_getter_->GetURLRequestContext() 488 url_request_context_getter_->GetURLRequestContext()
487 ->http_transaction_factory() 489 ->http_transaction_factory()
488 ->GetSession(), 490 ->GetSession(),
489 &recorder_); 491 &recorder_);
490 connection_factory_->SetConnectionListener(this); 492 connection_factory_->SetConnectionListener(this);
491 mcs_client_ = internals_builder_->BuildMCSClient( 493 mcs_client_ = internals_builder_->BuildMCSClient(
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 bool GCMClientImpl::HasStandaloneRegisteredApp() const { 1373 bool GCMClientImpl::HasStandaloneRegisteredApp() const {
1372 if (registrations_.empty()) 1374 if (registrations_.empty())
1373 return false; 1375 return false;
1374 // Note that account mapper is not counted as a standalone app since it is 1376 // Note that account mapper is not counted as a standalone app since it is
1375 // automatically started when other app uses GCM. 1377 // automatically started when other app uses GCM.
1376 return registrations_.size() > 1 || 1378 return registrations_.size() > 1 ||
1377 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); 1379 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId);
1378 } 1380 }
1379 1381
1380 } // namespace gcm 1382 } // namespace gcm
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/gservices_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698