diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 17:21:03 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 16:25:15 +0000 |
commit | c551f43206405019121bd2b2c93714319a0a3300 (patch) | |
tree | 1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/components/language/content | |
parent | 7961cea6d1041e3e454dae6a1da660b453efd238 (diff) | |
download | qtwebengine-chromium-c551f43206405019121bd2b2c93714319a0a3300.tar.gz |
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/language/content')
3 files changed, 11 insertions, 7 deletions
diff --git a/chromium/components/language/content/browser/geo_language_provider.cc b/chromium/components/language/content/browser/geo_language_provider.cc index f0d3fb99920..6350a0e0a16 100644 --- a/chromium/components/language/content/browser/geo_language_provider.cc +++ b/chromium/components/language/content/browser/geo_language_provider.cc @@ -12,6 +12,7 @@ #include "components/language/content/browser/language_code_locator_provider.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "mojo/public/cpp/bindings/remote.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/device/public/mojom/constants.mojom.h" #include "services/device/public/mojom/geoposition.mojom.h" @@ -105,9 +106,11 @@ void GeoLanguageProvider::BindIpGeolocationService() { DCHECK(!geolocation_provider_.is_bound()); // Bind a PublicIpAddressGeolocationProvider. - device::mojom::PublicIpAddressGeolocationProviderPtr ip_geolocation_provider; - service_manager_connector_->BindInterface( - device::mojom::kServiceName, mojo::MakeRequest(&ip_geolocation_provider)); + mojo::Remote<device::mojom::PublicIpAddressGeolocationProvider> + ip_geolocation_provider; + service_manager_connector_->Connect( + device::mojom::kServiceName, + ip_geolocation_provider.BindNewPipeAndPassReceiver()); net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation = net::DefinePartialNetworkTrafficAnnotation("geo_language_provider", @@ -133,7 +136,7 @@ void GeoLanguageProvider::BindIpGeolocationService() { ip_geolocation_provider->CreateGeolocation( static_cast<net::MutablePartialNetworkTrafficAnnotationTag>( partial_traffic_annotation), - mojo::MakeRequest(&geolocation_provider_)); + geolocation_provider_.BindNewPipeAndPassReceiver()); // No error handler required: If the connection is broken, QueryNextPosition // will bind it again. } @@ -141,7 +144,7 @@ void GeoLanguageProvider::BindIpGeolocationService() { void GeoLanguageProvider::QueryNextPosition() { DCHECK_CALLED_ON_VALID_SEQUENCE(background_sequence_checker_); - if (geolocation_provider_.encountered_error()) + if (geolocation_provider_.is_bound() && !geolocation_provider_.is_connected()) geolocation_provider_.reset(); if (!geolocation_provider_.is_bound()) BindIpGeolocationService(); diff --git a/chromium/components/language/content/browser/geo_language_provider.h b/chromium/components/language/content/browser/geo_language_provider.h index 2166e0d759c..e4c51732e14 100644 --- a/chromium/components/language/content/browser/geo_language_provider.h +++ b/chromium/components/language/content/browser/geo_language_provider.h @@ -12,6 +12,7 @@ #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" #include "components/language/content/browser/language_code_locator.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/geolocation.mojom.h" namespace base { @@ -102,7 +103,7 @@ class GeoLanguageProvider { std::unique_ptr<service_manager::Connector> service_manager_connector_; // Connection to the IP geolocation service. - device::mojom::GeolocationPtr geolocation_provider_; + mojo::Remote<device::mojom::Geolocation> geolocation_provider_; // Location -> Language lookup library. std::unique_ptr<language::LanguageCodeLocator> language_code_locator_; diff --git a/chromium/components/language/content/browser/ulp_language_code_locator/ulp_language_code_locator.cc b/chromium/components/language/content/browser/ulp_language_code_locator/ulp_language_code_locator.cc index a08f3077ce9..b8e88b577ab 100644 --- a/chromium/components/language/content/browser/ulp_language_code_locator/ulp_language_code_locator.cc +++ b/chromium/components/language/content/browser/ulp_language_code_locator/ulp_language_code_locator.cc @@ -80,7 +80,7 @@ std::vector<std::string> UlpLanguageCodeLocator::GetLanguageCodes( celllangs_cached->GetList()[index] = GetCellLanguagePairValue(cell.parent(level), language); } else { - celllangs_cached->GetList().push_back( + celllangs_cached->Append( GetCellLanguagePairValue(cell.parent(level), language)); } } |