OLD | NEW |
---|---|
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 endpoints.push_back(gservices_settings_.GetMCSFallbackEndpoint()); |
482 if (endpoints[1].is_empty()) | |
Nicolas Zea
2015/12/02 19:48:21
nit: I think it would be cleaner to do
GURL fallba
johnme
2015/12/03 12:22:49
Done.
| |
483 endpoints.pop_back(); | |
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 Loading... | |
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 |
OLD | NEW |