summaryrefslogtreecommitdiff
path: root/chromium/google_apis
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-31 16:33:43 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-06 16:33:22 +0000
commitda51f56cc21233c2d30f0fe0d171727c3102b2e0 (patch)
tree4e579ab70ce4b19bee7984237f3ce05a96d59d83 /chromium/google_apis
parentc8c2d1901aec01e934adf561a9fdf0cc776cdef8 (diff)
downloadqtwebengine-chromium-da51f56cc21233c2d30f0fe0d171727c3102b2e0.tar.gz
BASELINE: Update Chromium to 65.0.3525.40
Also imports missing submodules Change-Id: I36901b7c6a325cda3d2c10cedb2186c25af3b79b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/google_apis')
-rw-r--r--chromium/google_apis/drive/base_requests.cc9
-rw-r--r--chromium/google_apis/drive/drive_api_parser.cc6
-rw-r--r--chromium/google_apis/drive/drive_api_parser.h5
-rw-r--r--chromium/google_apis/drive/drive_api_requests.cc5
-rw-r--r--chromium/google_apis/drive/files_list_request_runner.cc5
-rw-r--r--chromium/google_apis/drive/time_util.cc5
-rw-r--r--chromium/google_apis/drive/time_util.h2
-rw-r--r--chromium/google_apis/gaia/gaia_auth_fetcher.h7
-rw-r--r--chromium/google_apis/gaia/gaia_oauth_client.cc3
-rw-r--r--chromium/google_apis/gaia/gaia_oauth_client_unittest.cc2
-rw-r--r--chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc5
-rw-r--r--chromium/google_apis/gaia/oauth2_token_service.cc23
-rw-r--r--chromium/google_apis/gaia/oauth2_token_service.h19
-rw-r--r--chromium/google_apis/gaia/oauth2_token_service_delegate.h1
-rw-r--r--chromium/google_apis/gcm/base/mcs_util.cc4
-rw-r--r--chromium/google_apis/gcm/base/mcs_util_unittest.cc4
-rw-r--r--chromium/google_apis/gcm/engine/connection_factory_impl.cc28
-rw-r--r--chromium/google_apis/gcm/engine/connection_factory_impl.h5
-rw-r--r--chromium/google_apis/gcm/engine/gcm_store_impl.cc4
-rw-r--r--chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc2
-rw-r--r--chromium/google_apis/gcm/engine/mcs_client.cc2
-rw-r--r--chromium/google_apis/gcm/engine/registration_request.cc12
-rw-r--r--chromium/google_apis/gcm/engine/registration_request_unittest.cc14
-rw-r--r--chromium/google_apis/gcm/engine/unregistration_request.cc12
-rw-r--r--chromium/google_apis/gcm/engine/unregistration_request_unittest.cc14
25 files changed, 87 insertions, 111 deletions
diff --git a/chromium/google_apis/drive/base_requests.cc b/chromium/google_apis/drive/base_requests.cc
index bca7db8c92d..fb5594cd7e5 100644
--- a/chromium/google_apis/drive/base_requests.cc
+++ b/chromium/google_apis/drive/base_requests.cc
@@ -198,11 +198,10 @@ std::unique_ptr<base::Value> ParseJson(const std::string& json) {
trimmed_json = json;
} else {
// Take the first 50 and the last 10 bytes.
- trimmed_json = base::StringPrintf(
- "%s [%s bytes] %s",
- json.substr(0, 50).c_str(),
- base::Uint64ToString(json.size() - 60).c_str(),
- json.substr(json.size() - 10).c_str());
+ trimmed_json =
+ base::StringPrintf("%s [%s bytes] %s", json.substr(0, 50).c_str(),
+ base::NumberToString(json.size() - 60).c_str(),
+ json.substr(json.size() - 10).c_str());
}
LOG(WARNING) << "Error while parsing entry response: " << error_message
<< ", code: " << error_code << ", json:\n" << trimmed_json;
diff --git a/chromium/google_apis/drive/drive_api_parser.cc b/chromium/google_apis/drive/drive_api_parser.cc
index 5b2ad143b8c..a9a9078386e 100644
--- a/chromium/google_apis/drive/drive_api_parser.cc
+++ b/chromium/google_apis/drive/drive_api_parser.cc
@@ -38,7 +38,7 @@ bool CreateTeamDriveResourceFromValue(
// Converts |url_string| to |result|. Always returns true to be used
// for JSONValueConverter::RegisterCustomField method.
// TODO(mukai): make it return false in case of invalid |url_string|.
-bool GetGURLFromString(const base::StringPiece& url_string, GURL* result) {
+bool GetGURLFromString(base::StringPiece url_string, GURL* result) {
*result = GURL(url_string);
return true;
}
@@ -336,7 +336,7 @@ bool DriveAppIcon::Parse(const base::Value& value) {
}
// static
-bool DriveAppIcon::GetIconCategory(const base::StringPiece& category,
+bool DriveAppIcon::GetIconCategory(base::StringPiece category,
DriveAppIcon::IconCategory* result) {
for (size_t i = 0; i < arraysize(kAppIconCategoryMap); i++) {
if (category == kAppIconCategoryMap[i].category_name) {
@@ -774,7 +774,7 @@ bool ChangeResource::Parse(const base::Value& value) {
}
// static
-bool ChangeResource::GetType(const base::StringPiece& type_name,
+bool ChangeResource::GetType(base::StringPiece type_name,
ChangeResource::ChangeType* result) {
for (size_t i = 0; i < arraysize(kChangeTypeMap); i++) {
if (type_name == kChangeTypeMap[i].type_name) {
diff --git a/chromium/google_apis/drive/drive_api_parser.h b/chromium/google_apis/drive/drive_api_parser.h
index fec88f80801..ea259512cbb 100644
--- a/chromium/google_apis/drive/drive_api_parser.h
+++ b/chromium/google_apis/drive/drive_api_parser.h
@@ -135,8 +135,7 @@ class DriveAppIcon {
// Extracts the icon category from the given string. Returns false and does
// not change |result| when |scheme| has an unrecognizable value.
- static bool GetIconCategory(const base::StringPiece& category,
- IconCategory* result);
+ static bool GetIconCategory(base::StringPiece category, IconCategory* result);
friend class base::internal::RepeatedMessageConverter<DriveAppIcon>;
friend class AppResource;
@@ -901,7 +900,7 @@ class ChangeResource {
// Extracts the change type from the given string. Returns false and does
// not change |result| when |type_name| has an unrecognizable value.
- static bool GetType(const base::StringPiece& type_name,
+ static bool GetType(base::StringPiece type_name,
ChangeResource::ChangeType* result);
int64_t change_id_;
diff --git a/chromium/google_apis/drive/drive_api_requests.cc b/chromium/google_apis/drive/drive_api_requests.cc
index 632d1c6432a..27afceccbd6 100644
--- a/chromium/google_apis/drive/drive_api_requests.cc
+++ b/chromium/google_apis/drive/drive_api_requests.cc
@@ -13,8 +13,8 @@
#include "base/json/json_writer.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/metrics/sparse_histogram.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -1395,8 +1395,7 @@ void BatchUploadRequest::ProcessURLFetchResults(const net::URLFetcher* source) {
} else {
histogram_error = source->GetStatus().error();
}
- UMA_HISTOGRAM_SPARSE_SLOWLY(
- kUMADriveBatchUploadResponseCode, histogram_error);
+ base::UmaHistogramSparse(kUMADriveBatchUploadResponseCode, histogram_error);
if (!IsSuccessfulDriveApiErrorCode(GetErrorCode())) {
RunCallbackOnPrematureFailure(GetErrorCode());
diff --git a/chromium/google_apis/drive/files_list_request_runner.cc b/chromium/google_apis/drive/files_list_request_runner.cc
index 3dde3d6c06d..2eb7fe08d73 100644
--- a/chromium/google_apis/drive/files_list_request_runner.cc
+++ b/chromium/google_apis/drive/files_list_request_runner.cc
@@ -8,8 +8,8 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/metrics/sparse_histogram.h"
#include "google_apis/drive/drive_api_error_codes.h"
#include "google_apis/drive/drive_api_requests.h"
#include "google_apis/drive/request_sender.h"
@@ -75,8 +75,7 @@ void FilesListRequestRunner::OnCompleted(int max_results,
if (!request_completed_callback_for_testing_.is_null())
request_completed_callback_for_testing_.Run();
- UMA_HISTOGRAM_SPARSE_SLOWLY(
- "Drive.FilesListRequestRunner.ApiErrorCode", error);
+ base::UmaHistogramSparse("Drive.FilesListRequestRunner.ApiErrorCode", error);
if (error == google_apis::DRIVE_RESPONSE_TOO_LARGE && max_results > 1) {
CreateAndStartWithSizeBackoff(max_results / 2, corpora, team_drive_id, q,
diff --git a/chromium/google_apis/drive/time_util.cc b/chromium/google_apis/drive/time_util.cc
index 806e15889ed..d3cea0c29ee 100644
--- a/chromium/google_apis/drive/time_util.cc
+++ b/chromium/google_apis/drive/time_util.cc
@@ -20,7 +20,7 @@ namespace {
const char kNullTimeString[] = "null";
-bool ParseTimezone(const base::StringPiece& timezone,
+bool ParseTimezone(base::StringPiece timezone,
bool ahead,
int* out_offset_to_utc_in_minutes) {
DCHECK(out_offset_to_utc_in_minutes);
@@ -42,8 +42,7 @@ bool ParseTimezone(const base::StringPiece& timezone,
} // namespace
-bool GetTimeFromString(const base::StringPiece& raw_value,
- base::Time* parsed_time) {
+bool GetTimeFromString(base::StringPiece raw_value, base::Time* parsed_time) {
base::StringPiece date;
base::StringPiece time_and_tz;
base::StringPiece time;
diff --git a/chromium/google_apis/drive/time_util.h b/chromium/google_apis/drive/time_util.h
index f281d800f83..80f481ead09 100644
--- a/chromium/google_apis/drive/time_util.h
+++ b/chromium/google_apis/drive/time_util.h
@@ -19,7 +19,7 @@ namespace util {
// Parses an RFC 3339 date/time into a base::Time, returning true on success.
// The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is
// either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string).
-bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time);
+bool GetTimeFromString(base::StringPiece raw_value, base::Time* time);
// Formats a base::Time as an RFC 3339 date/time (in UTC).
// If |time| is null, returns "null".
diff --git a/chromium/google_apis/gaia/gaia_auth_fetcher.h b/chromium/google_apis/gaia/gaia_auth_fetcher.h
index 0c4ae11c3f8..e339fc4788f 100644
--- a/chromium/google_apis/gaia/gaia_auth_fetcher.h
+++ b/chromium/google_apis/gaia/gaia_auth_fetcher.h
@@ -284,11 +284,6 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static const char kClientLoginToOAuth2CookiePartCodePrefix[];
static const int kClientLoginToOAuth2CookiePartCodePrefixLength;
- // Process the results of a ClientLogin fetch.
- void OnClientLoginFetched(const std::string& data,
- const net::URLRequestStatus& status,
- int response_code);
-
void OnIssueAuthTokenFetched(const std::string& data,
const net::URLRequestStatus& status,
int response_code);
@@ -414,7 +409,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
GURL deprecated_client_login_to_oauth2_gurl_;
std::string request_body_;
- std::string requested_service_; // Currently tracked for IssueAuthToken only.
+ std::string requested_service_; // Currently tracked for IssueAuthToken only.
bool fetch_pending_ = false;
bool fetch_token_from_auth_code_ = false;
diff --git a/chromium/google_apis/gaia/gaia_oauth_client.cc b/chromium/google_apis/gaia/gaia_oauth_client.cc
index dfc47e77c0b..40e866b6553 100644
--- a/chromium/google_apis/gaia/gaia_oauth_client.cc
+++ b/chromium/google_apis/gaia/gaia_oauth_client.cc
@@ -393,8 +393,7 @@ void GaiaOAuthClient::Core::HandleResponse(
std::string data;
source->GetResponseAsString(&data);
std::unique_ptr<base::Value> message_value = base::JSONReader::Read(data);
- if (message_value.get() &&
- message_value->IsType(base::Value::Type::DICTIONARY)) {
+ if (message_value.get() && message_value->is_dict()) {
response_dict.reset(
static_cast<base::DictionaryValue*>(message_value.release()));
}
diff --git a/chromium/google_apis/gaia/gaia_oauth_client_unittest.cc b/chromium/google_apis/gaia/gaia_oauth_client_unittest.cc
index 403426fcc9e..f44ef49c12a 100644
--- a/chromium/google_apis/gaia/gaia_oauth_client_unittest.cc
+++ b/chromium/google_apis/gaia/gaia_oauth_client_unittest.cc
@@ -394,7 +394,7 @@ TEST_F(GaiaOAuthClientTest, GetUserInfo) {
std::unique_ptr<base::Value> value =
base::JSONReader::Read(kDummyFullUserInfoResult);
DCHECK(value);
- ASSERT_TRUE(value->IsType(base::Value::Type::DICTIONARY));
+ ASSERT_TRUE(value->is_dict());
base::DictionaryValue* expected_result;
value->GetAsDictionary(&expected_result);
diff --git a/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
index f89a8b70dd2..ac1aabe0760 100644
--- a/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
+++ b/chromium/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -10,6 +10,7 @@
#include "base/json/json_reader.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -201,8 +202,8 @@ void OAuth2AccessTokenFetcherImpl::EndGetAccessToken(
URLRequestStatus status = source->GetStatus();
int histogram_value =
status.is_success() ? source->GetResponseCode() : status.error();
- UMA_HISTOGRAM_SPARSE_SLOWLY("Gaia.ResponseCodesForOAuth2AccessToken",
- histogram_value);
+ base::UmaHistogramSparse("Gaia.ResponseCodesForOAuth2AccessToken",
+ histogram_value);
if (!status.is_success()) {
OnGetTokenFailure(CreateAuthError(status));
return;
diff --git a/chromium/google_apis/gaia/oauth2_token_service.cc b/chromium/google_apis/gaia/oauth2_token_service.cc
index 6fcfe4c4181..c75a1407dd4 100644
--- a/chromium/google_apis/gaia/oauth2_token_service.cc
+++ b/chromium/google_apis/gaia/oauth2_token_service.cc
@@ -495,8 +495,10 @@ OAuth2TokenService::StartRequestForClientWithContext(
RequestParameters request_parameters(client_id,
account_id,
scopes);
- if (HasCacheEntry(request_parameters)) {
- StartCacheLookupRequest(request.get(), request_parameters, consumer);
+ const CacheEntry* cache_entry = GetCacheEntry(request_parameters);
+ if (cache_entry && cache_entry->access_token.length()) {
+ InformConsumerWithCacheEntry(cache_entry, request.get(),
+ request_parameters);
} else {
FetchOAuth2Token(request.get(),
account_id,
@@ -543,15 +545,14 @@ OAuth2AccessTokenFetcher* OAuth2TokenService::CreateAccessTokenFetcher(
return delegate_->CreateAccessTokenFetcher(account_id, getter, consumer);
}
-void OAuth2TokenService::StartCacheLookupRequest(
+void OAuth2TokenService::InformConsumerWithCacheEntry(
+ const CacheEntry* cache_entry,
RequestImpl* request,
- const OAuth2TokenService::RequestParameters& request_parameters,
- OAuth2TokenService::Consumer* consumer) {
- CHECK(HasCacheEntry(request_parameters));
- const CacheEntry* cache_entry = GetCacheEntry(request_parameters);
+ const RequestParameters& request_parameters) {
+ DCHECK(cache_entry && cache_entry->access_token.length());
for (auto& observer : diagnostics_observer_list_) {
observer.OnFetchAccessTokenComplete(
- request_parameters.account_id, consumer->id(),
+ request_parameters.account_id, request->GetConsumerId(),
request_parameters.scopes, GoogleServiceAuthError::AuthErrorNone(),
cache_entry->expiration_date);
}
@@ -670,12 +671,6 @@ void OAuth2TokenService::OnFetchComplete(Fetcher* fetcher) {
pending_fetchers_.erase(iter);
}
-bool OAuth2TokenService::HasCacheEntry(
- const RequestParameters& request_parameters) {
- const CacheEntry* cache_entry = GetCacheEntry(request_parameters);
- return cache_entry && cache_entry->access_token.length();
-}
-
const OAuth2TokenService::CacheEntry* OAuth2TokenService::GetCacheEntry(
const RequestParameters& request_parameters) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/chromium/google_apis/gaia/oauth2_token_service.h b/chromium/google_apis/gaia/oauth2_token_service.h
index 3cc2ebc34ed..f1e0f88107c 100644
--- a/chromium/google_apis/gaia/oauth2_token_service.h
+++ b/chromium/google_apis/gaia/oauth2_token_service.h
@@ -123,7 +123,7 @@ class OAuth2TokenService {
// Called when receiving request for access token.
virtual void OnAccessTokenRequested(const std::string& account_id,
const std::string& consumer_id,
- const ScopeSet& scopes) = 0;
+ const ScopeSet& scopes) {}
// Called when access token fetching finished successfully or
// unsuccessfully. |expiration_time| are only valid with
// successful completion.
@@ -131,9 +131,9 @@ class OAuth2TokenService {
const std::string& consumer_id,
const ScopeSet& scopes,
GoogleServiceAuthError error,
- base::Time expiration_time) = 0;
+ base::Time expiration_time) {}
virtual void OnTokenRemoved(const std::string& account_id,
- const ScopeSet& scopes) = 0;
+ const ScopeSet& scopes) {}
};
explicit OAuth2TokenService(
@@ -342,15 +342,10 @@ class OAuth2TokenService {
const ScopeSet& scopes,
Consumer* consumer);
- // Returns true if GetCacheEntry would return a valid cache entry for the
- // given scopes.
- bool HasCacheEntry(const RequestParameters& client_scopes);
-
- // Posts a task to fire the Consumer callback with the cached token. Must
- // Must only be called if HasCacheEntry() returns true.
- void StartCacheLookupRequest(RequestImpl* request,
- const RequestParameters& client_scopes,
- Consumer* consumer);
+ // Posts a task to fire the Consumer callback with the cached token.
+ void InformConsumerWithCacheEntry(const CacheEntry* cache_entry,
+ RequestImpl* request,
+ const RequestParameters& client_scopes);
// Returns a currently valid OAuth2 access token for the given set of scopes,
// or NULL if none have been cached. Note the user of this method should
diff --git a/chromium/google_apis/gaia/oauth2_token_service_delegate.h b/chromium/google_apis/gaia/oauth2_token_service_delegate.h
index d01b9ae0eeb..283d4f25f0f 100644
--- a/chromium/google_apis/gaia/oauth2_token_service_delegate.h
+++ b/chromium/google_apis/gaia/oauth2_token_service_delegate.h
@@ -27,6 +27,7 @@ class OAuth2TokenServiceDelegate {
LOAD_CREDENTIALS_FINISHED_WITH_SUCCESS,
LOAD_CREDENTIALS_FINISHED_WITH_DB_ERRORS,
LOAD_CREDENTIALS_FINISHED_WITH_DECRYPT_ERRORS,
+ LOAD_CREDENTIALS_FINISHED_WITH_NO_TOKEN_FOR_PRIMARY_ACCOUNT,
LOAD_CREDENTIALS_FINISHED_WITH_UNKNOWN_ERRORS,
};
diff --git a/chromium/google_apis/gcm/base/mcs_util.cc b/chromium/google_apis/gcm/base/mcs_util.cc
index 38ada7a464e..94b11223fdf 100644
--- a/chromium/google_apis/gcm/base/mcs_util.cc
+++ b/chromium/google_apis/gcm/base/mcs_util.cc
@@ -61,8 +61,8 @@ std::unique_ptr<mcs_proto::LoginRequest> BuildLoginRequest(
std::string auth_id_hex;
auth_id_hex = base::StringPrintf("%" PRIx64, auth_id);
- std::string auth_id_str = base::Uint64ToString(auth_id);
- std::string auth_token_str = base::Uint64ToString(auth_token);
+ std::string auth_id_str = base::NumberToString(auth_id);
+ std::string auth_token_str = base::NumberToString(auth_token);
std::unique_ptr<mcs_proto::LoginRequest> login_request(
new mcs_proto::LoginRequest());
diff --git a/chromium/google_apis/gcm/base/mcs_util_unittest.cc b/chromium/google_apis/gcm/base/mcs_util_unittest.cc
index 4c6a9d604f2..1708943eec1 100644
--- a/chromium/google_apis/gcm/base/mcs_util_unittest.cc
+++ b/chromium/google_apis/gcm/base/mcs_util_unittest.cc
@@ -26,8 +26,8 @@ TEST(MCSUtilTest, BuildLoginRequest) {
std::unique_ptr<mcs_proto::LoginRequest> login_request =
BuildLoginRequest(kAuthId, kAuthToken, "1.0");
ASSERT_EQ("chrome-1.0", login_request->id());
- ASSERT_EQ(base::Uint64ToString(kAuthToken), login_request->auth_token());
- ASSERT_EQ(base::Uint64ToString(kAuthId), login_request->user());
+ ASSERT_EQ(base::NumberToString(kAuthToken), login_request->auth_token());
+ ASSERT_EQ(base::NumberToString(kAuthId), login_request->user());
ASSERT_EQ("android-3d5c23dac2a1fa7c", login_request->device_id());
ASSERT_EQ("new_vc", login_request->setting(0).name());
ASSERT_EQ("1", login_request->setting(0).value());
diff --git a/chromium/google_apis/gcm/engine/connection_factory_impl.cc b/chromium/google_apis/gcm/engine/connection_factory_impl.cc
index ff9abd828a0..8b98ee26bbe 100644
--- a/chromium/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/chromium/google_apis/gcm/engine/connection_factory_impl.cc
@@ -9,6 +9,7 @@
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread_task_runner_handle.h"
#include "google_apis/gcm/engine/connection_handler_impl.h"
@@ -61,7 +62,7 @@ ConnectionFactoryImpl::ConnectionFactoryImpl(
http_network_session_(http_network_session),
net_log_(
net::NetLogWithSource::Make(net_log, net::NetLogSourceType::SOCKET)),
- pac_request_(NULL),
+ proxy_resolve_request_(NULL),
connecting_(false),
waiting_for_backoff_(false),
waiting_for_network_online_(false),
@@ -77,9 +78,10 @@ ConnectionFactoryImpl::ConnectionFactoryImpl(
ConnectionFactoryImpl::~ConnectionFactoryImpl() {
CloseSocket();
net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
- if (pac_request_) {
- gcm_network_session_->proxy_service()->CancelPacRequest(pac_request_);
- pac_request_ = NULL;
+ if (proxy_resolve_request_) {
+ gcm_network_session_->proxy_service()->CancelRequest(
+ proxy_resolve_request_);
+ proxy_resolve_request_ = NULL;
}
}
@@ -325,14 +327,10 @@ void ConnectionFactoryImpl::StartConnection() {
recorder_->RecordConnectionInitiated(current_endpoint.host());
UpdateFromHttpNetworkSession();
int status = gcm_network_session_->proxy_service()->ResolveProxy(
- current_endpoint,
- std::string(),
- &proxy_info_,
+ current_endpoint, std::string(), &proxy_info_,
base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
weak_ptr_factory_.GetWeakPtr()),
- &pac_request_,
- NULL,
- net_log_);
+ &proxy_resolve_request_, NULL, net_log_);
if (status != net::ERR_IO_PENDING)
OnProxyResolveDone(status);
}
@@ -383,7 +381,7 @@ void ConnectionFactoryImpl::OnConnectDone(int result) {
recorder_->RecordConnectionFailure(result);
CloseSocket();
backoff_entry_->InformOfRequest(false);
- UMA_HISTOGRAM_SPARSE_SLOWLY("GCM.ConnectionFailureErrorCode", result);
+ base::UmaHistogramSparse("GCM.ConnectionFailureErrorCode", result);
event_tracker_.ConnectionAttemptFailed(result);
event_tracker_.EndConnectionAttempt();
@@ -422,7 +420,7 @@ void ConnectionFactoryImpl::ConnectionHandlerCallback(int result) {
if (result != net::OK) {
// TODO(zea): Consider how to handle errors that may require some sort of
// user intervention (login page, etc.).
- UMA_HISTOGRAM_SPARSE_SLOWLY("GCM.ConnectionDisconnectErrorCode", result);
+ base::UmaHistogramSparse("GCM.ConnectionDisconnectErrorCode", result);
SignalConnectionReset(SOCKET_FAILURE);
return;
}
@@ -446,7 +444,7 @@ void ConnectionFactoryImpl::ConnectionHandlerCallback(int result) {
// HttpStreamFactoryImpl::Job::DoResolveProxyComplete. This should be
// refactored into some common place.
void ConnectionFactoryImpl::OnProxyResolveDone(int status) {
- pac_request_ = NULL;
+ proxy_resolve_request_ = NULL;
DVLOG(1) << "Proxy resolution status: " << status;
DCHECK_NE(status, net::ERR_IO_PENDING);
@@ -496,7 +494,7 @@ void ConnectionFactoryImpl::OnProxyResolveDone(int status) {
// a proxy it always returns ERR_IO_PENDING and posts a call to
// OnProxyResolveDone with the result of the reconsideration.
int ConnectionFactoryImpl::ReconsiderProxyAfterError(int error) {
- DCHECK(!pac_request_);
+ DCHECK(!proxy_resolve_request_);
DCHECK_NE(error, net::OK);
DCHECK_NE(error, net::ERR_IO_PENDING);
// A failure to resolve the hostname or any error related to establishing a
@@ -552,7 +550,7 @@ int ConnectionFactoryImpl::ReconsiderProxyAfterError(int error) {
GetCurrentEndpoint(), std::string(), error, &proxy_info_,
base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
weak_ptr_factory_.GetWeakPtr()),
- &pac_request_, NULL, net_log_);
+ &proxy_resolve_request_, NULL, net_log_);
if (status == net::OK || status == net::ERR_IO_PENDING) {
CloseSocket();
} else {
diff --git a/chromium/google_apis/gcm/engine/connection_factory_impl.h b/chromium/google_apis/gcm/engine/connection_factory_impl.h
index 14836ef71d2..79ed86ebe19 100644
--- a/chromium/google_apis/gcm/engine/connection_factory_impl.h
+++ b/chromium/google_apis/gcm/engine/connection_factory_impl.h
@@ -159,8 +159,9 @@ class GCM_EXPORT ConnectionFactoryImpl :
net::HttpNetworkSession* http_network_session_;
// Net log to use in connection attempts.
net::NetLogWithSource net_log_;
- // The current PAC request, if one exists. Owned by the proxy service.
- net::ProxyService::PacRequest* pac_request_;
+ // The current proxy resolution request, if one exists. Owned by the proxy
+ // service.
+ net::ProxyService::Request* proxy_resolve_request_;
// The current proxy info.
net::ProxyInfo proxy_info_;
// The handle to the socket for the current connection, if one exists.
diff --git a/chromium/google_apis/gcm/engine/gcm_store_impl.cc b/chromium/google_apis/gcm/engine/gcm_store_impl.cc
index 12c48605960..9be33e489ab 100644
--- a/chromium/google_apis/gcm/engine/gcm_store_impl.cc
+++ b/chromium/google_apis/gcm/engine/gcm_store_impl.cc
@@ -435,9 +435,9 @@ void GCMStoreImpl::Backend::SetDeviceCredentials(
write_options.sync = true;
std::string encrypted_token;
- encryptor_->EncryptString(base::Uint64ToString(device_security_token),
+ encryptor_->EncryptString(base::NumberToString(device_security_token),
&encrypted_token);
- std::string android_id_str = base::Uint64ToString(device_android_id);
+ std::string android_id_str = base::NumberToString(device_android_id);
leveldb::Status s =
db_->Put(write_options,
MakeSlice(kDeviceAIDKey),
diff --git a/chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc b/chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc
index a21facfa242..d6776f98451 100644
--- a/chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc
+++ b/chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc
@@ -108,7 +108,7 @@ void GCMStoreImplTest::LoadGCMStore(
}
std::string GCMStoreImplTest::GetNextPersistentId() {
- return base::Uint64ToString(next_persistent_id_++);
+ return base::NumberToString(next_persistent_id_++);
}
void GCMStoreImplTest::PumpLoop() { task_runner_->RunUntilIdle(); }
diff --git a/chromium/google_apis/gcm/engine/mcs_client.cc b/chromium/google_apis/gcm/engine/mcs_client.cc
index 40f79b9ae2d..1bdeee94e7e 100644
--- a/chromium/google_apis/gcm/engine/mcs_client.cc
+++ b/chromium/google_apis/gcm/engine/mcs_client.cc
@@ -266,7 +266,7 @@ void MCSClient::Initialize(
ReliablePacketInfo* packet_info = new ReliablePacketInfo();
packet_info->protobuf.reset(iter->second);
packet_info->tag = GetMCSProtoTag(*iter->second);
- packet_info->persistent_id = base::Uint64ToString(iter->first);
+ packet_info->persistent_id = base::NumberToString(iter->first);
to_send_.push_back(make_linked_ptr(packet_info));
if (packet_info->tag == kDataMessageStanzaTag) {
diff --git a/chromium/google_apis/gcm/engine/registration_request.cc b/chromium/google_apis/gcm/engine/registration_request.cc
index c1b24c8a143..9c2cb1a0529 100644
--- a/chromium/google_apis/gcm/engine/registration_request.cc
+++ b/chromium/google_apis/gcm/engine/registration_request.cc
@@ -197,11 +197,10 @@ void RegistrationRequest::Start() {
void RegistrationRequest::BuildRequestHeaders(std::string* extra_headers) {
net::HttpRequestHeaders headers;
- headers.SetHeader(
- net::HttpRequestHeaders::kAuthorization,
- std::string(kLoginHeader) + " " +
- base::Uint64ToString(request_info_.android_id) + ":" +
- base::Uint64ToString(request_info_.security_token));
+ headers.SetHeader(net::HttpRequestHeaders::kAuthorization,
+ std::string(kLoginHeader) + " " +
+ base::NumberToString(request_info_.android_id) + ":" +
+ base::NumberToString(request_info_.security_token));
*extra_headers = headers.ToString();
}
@@ -211,8 +210,7 @@ void RegistrationRequest::BuildRequestBody(std::string* body) {
BuildFormEncoding(kSubtypeKey, request_info_.subtype, body);
BuildFormEncoding(kDeviceIdKey,
- base::Uint64ToString(request_info_.android_id),
- body);
+ base::NumberToString(request_info_.android_id), body);
DCHECK(custom_request_handler_.get());
custom_request_handler_->BuildRequestBody(body);
diff --git a/chromium/google_apis/gcm/engine/registration_request_unittest.cc b/chromium/google_apis/gcm/engine/registration_request_unittest.cc
index 42378d83c68..02ccd3c4bbb 100644
--- a/chromium/google_apis/gcm/engine/registration_request_unittest.cc
+++ b/chromium/google_apis/gcm/engine/registration_request_unittest.cc
@@ -142,14 +142,14 @@ TEST_F(GCMRegistrationRequestTest, RequestDataAndURL) {
ASSERT_TRUE(auth_tokenizer.GetNext());
EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
std::map<std::string, std::string> expected_pairs;
expected_pairs["app"] = kAppId;
expected_pairs["sender"] = kDeveloperId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
ASSERT_NO_FATAL_FAILURE(VerifyFetcherUploadData(&expected_pairs));
}
@@ -526,15 +526,15 @@ TEST_F(InstanceIDGetTokenRequestTest, RequestDataAndURL) {
ASSERT_TRUE(auth_tokenizer.GetNext());
EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
std::map<std::string, std::string> expected_pairs;
expected_pairs["gmsv"] = base::IntToString(kGCMVersion);
expected_pairs["app"] = kAppId;
expected_pairs["sender"] = kDeveloperId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
expected_pairs["appid"] = kInstanceId;
expected_pairs["scope"] = kScope;
expected_pairs["X-scope"] = kScope;
@@ -560,7 +560,7 @@ TEST_F(InstanceIDGetTokenRequestTest, RequestDataWithSubtype) {
expected_pairs["app"] = kProductCategoryForSubtypes;
expected_pairs["X-subtype"] = kAppId;
expected_pairs["sender"] = kDeveloperId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
expected_pairs["appid"] = kInstanceId;
expected_pairs["scope"] = kScope;
expected_pairs["X-scope"] = kScope;
diff --git a/chromium/google_apis/gcm/engine/unregistration_request.cc b/chromium/google_apis/gcm/engine/unregistration_request.cc
index b2a58a58488..6522c00b3b3 100644
--- a/chromium/google_apis/gcm/engine/unregistration_request.cc
+++ b/chromium/google_apis/gcm/engine/unregistration_request.cc
@@ -181,11 +181,10 @@ void UnregistrationRequest::Start() {
void UnregistrationRequest::BuildRequestHeaders(std::string* extra_headers) {
net::HttpRequestHeaders headers;
- headers.SetHeader(
- net::HttpRequestHeaders::kAuthorization,
- std::string(kLoginHeader) + " " +
- base::Uint64ToString(request_info_.android_id) + ":" +
- base::Uint64ToString(request_info_.security_token));
+ headers.SetHeader(net::HttpRequestHeaders::kAuthorization,
+ std::string(kLoginHeader) + " " +
+ base::NumberToString(request_info_.android_id) + ":" +
+ base::NumberToString(request_info_.security_token));
*extra_headers = headers.ToString();
}
@@ -195,8 +194,7 @@ void UnregistrationRequest::BuildRequestBody(std::string* body) {
BuildFormEncoding(kSubtypeKey, request_info_.subtype, body);
BuildFormEncoding(kDeviceIdKey,
- base::Uint64ToString(request_info_.android_id),
- body);
+ base::NumberToString(request_info_.android_id), body);
BuildFormEncoding(kDeleteKey, kDeleteValue, body);
DCHECK(custom_request_handler_.get());
diff --git a/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc b/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
index 0f1a3485140..a8c18e72e49 100644
--- a/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
+++ b/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
@@ -129,13 +129,13 @@ TEST_F(GCMUnregistrationRequestTest, RequestDataPassedToFetcher) {
ASSERT_TRUE(auth_tokenizer.GetNext());
EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
std::map<std::string, std::string> expected_pairs;
expected_pairs["app"] = kAppId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
expected_pairs["delete"] = "true";
expected_pairs["gcm_unreg_caller"] = "false";
@@ -373,14 +373,14 @@ TEST_F(InstaceIDDeleteTokenRequestTest, RequestDataPassedToFetcher) {
ASSERT_TRUE(auth_tokenizer.GetNext());
EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::Uint64ToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
std::map<std::string, std::string> expected_pairs;
expected_pairs["gmsv"] = base::IntToString(kGCMVersion);
expected_pairs["app"] = kAppId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
expected_pairs["delete"] = "true";
expected_pairs["appid"] = kInstanceId;
expected_pairs["sender"] = kDeveloperId;
@@ -403,7 +403,7 @@ TEST_F(InstaceIDDeleteTokenRequestTest, RequestDataWithSubtype) {
expected_pairs["gmsv"] = base::IntToString(kGCMVersion);
expected_pairs["app"] = kProductCategoryForSubtypes;
expected_pairs["X-subtype"] = kAppId;
- expected_pairs["device"] = base::Uint64ToString(kAndroidId);
+ expected_pairs["device"] = base::NumberToString(kAndroidId);
expected_pairs["delete"] = "true";
expected_pairs["appid"] = kInstanceId;
expected_pairs["sender"] = kDeveloperId;