summaryrefslogtreecommitdiff
path: root/chromium/google_apis
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-03 13:32:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-01 14:31:55 +0200
commit21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (patch)
tree91be119f694044dfc1ff9fdc054459e925de9df0 /chromium/google_apis
parent03c549e0392f92c02536d3f86d5e1d8dfa3435ac (diff)
downloadqtwebengine-chromium-21ba0c5d4bf8fba15dddd97cd693bad2358b77fd.tar.gz
BASELINE: Update Chromium to 92.0.4515.166
Change-Id: I42a050486714e9e54fc271f2a8939223a02ae364
Diffstat (limited to 'chromium/google_apis')
-rw-r--r--chromium/google_apis/DIR_METADATA4
-rw-r--r--chromium/google_apis/OWNERS2
-rw-r--r--chromium/google_apis/drive/DIR_METADATA4
-rw-r--r--chromium/google_apis/drive/OWNERS2
-rw-r--r--chromium/google_apis/drive/base_requests.cc3
-rw-r--r--chromium/google_apis/drive/base_requests.h2
-rw-r--r--chromium/google_apis/drive/drive_api_parser.cc2
-rw-r--r--chromium/google_apis/drive/drive_api_requests.cc2
-rw-r--r--chromium/google_apis/gaia/DIR_METADATA11
-rw-r--r--chromium/google_apis/gaia/fake_gaia.cc87
-rw-r--r--chromium/google_apis/gaia/fake_gaia.h11
-rw-r--r--chromium/google_apis/gaia/gaia_auth_consumer.h19
-rw-r--r--chromium/google_apis/gaia/gaia_auth_fetcher.cc2
-rw-r--r--chromium/google_apis/gaia/gaia_auth_fetcher_unittest.cc1
-rw-r--r--chromium/google_apis/gaia/gaia_auth_util_unittest.cc18
-rw-r--r--chromium/google_apis/gaia/gaia_config.cc4
-rw-r--r--chromium/google_apis/gaia/gaia_config.h2
-rw-r--r--chromium/google_apis/gaia/gaia_urls.cc2
-rw-r--r--chromium/google_apis/gaia/oauth2_mint_token_flow.cc10
-rw-r--r--chromium/google_apis/gaia/oauth2_mint_token_flow_unittest.cc4
-rw-r--r--chromium/google_apis/gaia/oauth_multilogin_result.cc10
-rw-r--r--chromium/google_apis/gaia/oauth_multilogin_result.h2
-rw-r--r--chromium/google_apis/gaia/oauth_request_signer.cc1
-rw-r--r--chromium/google_apis/gcm/DIR_METADATA4
-rw-r--r--chromium/google_apis/gcm/base/encryptor.h6
-rw-r--r--chromium/google_apis/gcm/base/fake_encryptor.h6
-rw-r--r--chromium/google_apis/gcm/base/gcm_export.h6
-rw-r--r--chromium/google_apis/gcm/base/socket_stream_unittest.cc4
-rw-r--r--chromium/google_apis/gcm/engine/connection_factory_impl.cc4
-rw-r--r--chromium/google_apis/gcm/engine/connection_factory_impl.h4
-rw-r--r--chromium/google_apis/gcm/engine/connection_factory_impl_unittest.cc2
-rw-r--r--chromium/google_apis/gcm/engine/connection_handler_impl.cc21
-rw-r--r--chromium/google_apis/gcm/engine/connection_handler_impl.h3
-rw-r--r--chromium/google_apis/gcm/engine/connection_handler_impl_unittest.cc4
-rw-r--r--chromium/google_apis/gcm/engine/gservices_switches.h6
-rw-r--r--chromium/google_apis/gcm/engine/heartbeat_manager_unittest.cc20
-rw-r--r--chromium/google_apis/gcm/engine/mcs_client.h1
-rw-r--r--chromium/google_apis/gcm/engine/unregistration_request_unittest.cc12
-rw-r--r--chromium/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h6
-rw-r--r--chromium/google_apis/gcm/monitoring/gcm_stats_recorder.h1
-rwxr-xr-xchromium/google_apis/google_api_keys.py26
-rw-r--r--chromium/google_apis/google_api_keys_mac.h6
42 files changed, 192 insertions, 155 deletions
diff --git a/chromium/google_apis/DIR_METADATA b/chromium/google_apis/DIR_METADATA
index 3f722310112..2322464e427 100644
--- a/chromium/google_apis/DIR_METADATA
+++ b/chromium/google_apis/DIR_METADATA
@@ -1,10 +1,10 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto
monorail {
component: "Services>SignIn"
diff --git a/chromium/google_apis/OWNERS b/chromium/google_apis/OWNERS
index 9187c19b9c6..f99e9e9c83c 100644
--- a/chromium/google_apis/OWNERS
+++ b/chromium/google_apis/OWNERS
@@ -1,4 +1,4 @@
set noparent
file://components/signin/OWNERS
-per-file BUILD.gn=* \ No newline at end of file
+per-file BUILD.gn=*
diff --git a/chromium/google_apis/drive/DIR_METADATA b/chromium/google_apis/drive/DIR_METADATA
index 658199f9dcc..6f9a3839c5c 100644
--- a/chromium/google_apis/drive/DIR_METADATA
+++ b/chromium/google_apis/drive/DIR_METADATA
@@ -1,10 +1,10 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto
monorail {
component: "Platform>Apps>FileManager"
diff --git a/chromium/google_apis/drive/OWNERS b/chromium/google_apis/drive/OWNERS
index 33760238e5f..c9f39ecc74a 100644
--- a/chromium/google_apis/drive/OWNERS
+++ b/chromium/google_apis/drive/OWNERS
@@ -1 +1 @@
-file://components/drive/OWNERS \ No newline at end of file
+file://components/drive/OWNERS
diff --git a/chromium/google_apis/drive/base_requests.cc b/chromium/google_apis/drive/base_requests.cc
index 5a5d328ad29..4af6db26ef4 100644
--- a/chromium/google_apis/drive/base_requests.cc
+++ b/chromium/google_apis/drive/base_requests.cc
@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
#include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -455,7 +456,7 @@ void UrlFetchRequestBase::OnDataReceived(base::StringPiece string_piece,
base::PostTaskAndReplyWithResult(
blocking_task_runner(), FROM_HERE,
base::BindOnce(&UrlFetchRequestBase::WriteFileData,
- string_piece.as_string(), download_data_ptr),
+ std::string(string_piece), download_data_ptr),
base::BindOnce(&UrlFetchRequestBase::OnWriteComplete,
weak_ptr_factory_.GetWeakPtr(),
std::move(download_data_), std::move(resume)));
diff --git a/chromium/google_apis/drive/base_requests.h b/chromium/google_apis/drive/base_requests.h
index 491a34ec61f..08285e56bc2 100644
--- a/chromium/google_apis/drive/base_requests.h
+++ b/chromium/google_apis/drive/base_requests.h
@@ -275,7 +275,7 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
int re_authenticate_count_;
std::unique_ptr<network::SimpleURLLoader> url_loader_;
RequestSender* sender_;
- base::Optional<DriveApiErrorCode> error_code_;
+ absl::optional<DriveApiErrorCode> error_code_;
const ProgressCallback upload_progress_callback_;
const ProgressCallback download_progress_callback_;
std::unique_ptr<DownloadData> download_data_;
diff --git a/chromium/google_apis/drive/drive_api_parser.cc b/chromium/google_apis/drive/drive_api_parser.cc
index f73bcc989f8..918fe2c6b37 100644
--- a/chromium/google_apis/drive/drive_api_parser.cc
+++ b/chromium/google_apis/drive/drive_api_parser.cc
@@ -77,7 +77,7 @@ bool GetOpenWithLinksFromDictionaryValue(
if (!value->GetAsDictionary(&dictionary_value))
return false;
- result->reserve(dictionary_value->size());
+ result->reserve(dictionary_value->DictSize());
for (base::DictionaryValue::Iterator iter(*dictionary_value);
!iter.IsAtEnd(); iter.Advance()) {
std::string string_value;
diff --git a/chromium/google_apis/drive/drive_api_requests.cc b/chromium/google_apis/drive/drive_api_requests.cc
index 4bc95ba3d4d..7791f8aa5dd 100644
--- a/chromium/google_apis/drive/drive_api_requests.cc
+++ b/chromium/google_apis/drive/drive_api_requests.cc
@@ -822,7 +822,7 @@ bool InitiateUploadExistingFileRequest::GetContentData(
}
AttachProperties(properties_, &root);
- if (root.empty())
+ if (root.DictEmpty())
return false;
*upload_content_type = util::kContentTypeApplicationJson;
diff --git a/chromium/google_apis/gaia/DIR_METADATA b/chromium/google_apis/gaia/DIR_METADATA
deleted file mode 100644
index 3f722310112..00000000000
--- a/chromium/google_apis/gaia/DIR_METADATA
+++ /dev/null
@@ -1,11 +0,0 @@
-# Metadata information for this directory.
-#
-# For more information on DIR_METADATA files, see:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
-#
-# For the schema of this file, see Metadata message:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
-
-monorail {
- component: "Services>SignIn"
-} \ No newline at end of file
diff --git a/chromium/google_apis/gaia/fake_gaia.cc b/chromium/google_apis/gaia/fake_gaia.cc
index bacf4c0e649..882f9a78f41 100644
--- a/chromium/google_apis/gaia/fake_gaia.cc
+++ b/chromium/google_apis/gaia/fake_gaia.cc
@@ -63,6 +63,7 @@ const char kTestCookieAttributes[] =
"; Path=/; HttpOnly; SameSite=None; Secure";
const char kDefaultGaiaId[] = "12345";
+const char kDefaultEmail[] = "email12345@foo.com";
const base::FilePath::CharType kEmbeddedSetupChromeos[] =
FILE_PATH_LITERAL("google_apis/test/embedded_setup_chromeos.html");
@@ -71,9 +72,11 @@ const base::FilePath::CharType kEmbeddedSetupChromeos[] =
const char kAuthHeaderBearer[] = "Bearer ";
const char kAuthHeaderOAuth[] = "OAuth ";
-const char kListAccountsResponseFormat[] =
- "[\"gaia.l.a.r\",[[\"gaia.l.a\",1,\"\",\"%s\",\"\",1,1,0,0,1,\"12345\"]]]";
+const char kIndividualListedAccountResponseFormat[] =
+ "[\"gaia.l.a\",1,\"\",\"%s\",\"\",1,1,0,0,1,\"%s\",11,12,13,%d]";
+const char kListAccountsResponseFormat[] = "[\"gaia.l.a.r\",[%s]]";
+const char kDummyRemoveLocalAccountPath[] = "DummyRemoveLocalAccount";
const char kDummySAMLContinuePath[] = "DummySAMLContinue";
typedef std::map<std::string, std::string> CookieMap;
@@ -122,19 +125,22 @@ std::string FormatCookieForMultilogin(std::string name, std::string value) {
return base::StringPrintf(format, name.c_str(), value.c_str());
}
-std::string FormatSyncTrustedPublicKeys(
+std::string FormatSyncTrustedRecoveryMethods(
const std::vector<std::vector<uint8_t>>& public_keys) {
std::string result;
for (const std::vector<uint8_t>& public_key : public_keys) {
if (!result.empty()) {
base::StrAppend(&result, {","});
}
- base::StrAppend(&result, {"\"", base::Base64Encode(public_key), "\""});
+ base::StrAppend(&result,
+ {"{\"publicKey\":\"", base::Base64Encode(public_key),
+ "\",\"type\":3}"});
}
return result;
}
std::string FormatSyncTrustedVaultKeysHeader(
+ const std::string& gaia_id,
const FakeGaia::SyncTrustedVaultKeys& sync_trusted_vault_keys) {
// Single line used because this string populates HTTP headers. Similarly,
// base64 encoding is used to avoid line breaks and meanwhile adopt JSON
@@ -142,15 +148,17 @@ std::string FormatSyncTrustedVaultKeysHeader(
// embedded_setup_chromeos.html.
const char format[] =
"{"
+ "\"obfuscatedGaiaId\":\"%s\","
"\"fakeEncryptionKeyMaterial\":\"%s\","
"\"fakeEncryptionKeyVersion\":%d,"
- "\"fakeTrustedPublicKeys\":[%s]"
+ "\"fakeTrustedRecoveryMethods\":[%s]"
"}";
return base::StringPrintf(
- format,
+ format, gaia_id.c_str(),
base::Base64Encode(sync_trusted_vault_keys.encryption_key).c_str(),
sync_trusted_vault_keys.encryption_key_version,
- FormatSyncTrustedPublicKeys(sync_trusted_vault_keys.trusted_public_keys)
+ FormatSyncTrustedRecoveryMethods(
+ sync_trusted_vault_keys.trusted_public_keys)
.c_str());
}
@@ -185,6 +193,9 @@ void FakeGaia::MergeSessionParams::Update(const MergeSessionParams& update) {
maybe_update_field(&MergeSessionParams::session_sid_cookie);
maybe_update_field(&MergeSessionParams::session_lsid_cookie);
maybe_update_field(&MergeSessionParams::email);
+
+ if (!update.signed_out_gaia_ids.empty())
+ signed_out_gaia_ids = update.signed_out_gaia_ids;
}
FakeGaia::SyncTrustedVaultKeys::SyncTrustedVaultKeys() = default;
@@ -247,6 +258,14 @@ std::string FakeGaia::GetGaiaIdOfEmail(const std::string& email) const {
it->second;
}
+std::string FakeGaia::GetEmailOfGaiaId(const std::string& gaia_id) const {
+ for (const auto& email_and_gaia_id : email_to_gaia_id_map_) {
+ if (email_and_gaia_id.second == gaia_id)
+ return email_and_gaia_id.first;
+ }
+ return kDefaultEmail;
+}
+
void FakeGaia::AddGoogleAccountsSigninHeader(BasicHttpResponse* http_response,
const std::string& email) const {
DCHECK(http_response);
@@ -271,6 +290,7 @@ void FakeGaia::AddSyncTrustedKeysHeader(BasicHttpResponse* http_response,
http_response->AddCustomHeader(
"fake-sync-trusted-vault-keys",
FormatSyncTrustedVaultKeysHeader(
+ GetGaiaIdOfEmail(email),
email_to_sync_trusted_vault_keys_map_.at(email)));
}
@@ -360,6 +380,11 @@ void FakeGaia::Initialize() {
// Handles ReAuth API token fetch call.
REGISTER_RESPONSE_HANDLER(gaia_urls->reauth_api_url(),
HandleGetReAuthProofToken);
+
+ // Handles API for browser tests to manually remove local accounts.
+ REGISTER_RESPONSE_HANDLER(
+ gaia_urls->gaia_url().Resolve(kDummyRemoveLocalAccountPath),
+ HandleDummyRemoveLocalAccount);
}
FakeGaia::RequestHandlerMap::iterator FakeGaia::FindHandlerByPathPrefix(
@@ -442,6 +467,12 @@ void FakeGaia::SetErrorResponse(const GURL& gaia_url,
error_responses_[gaia_url.path()] = http_status_code;
}
+GURL FakeGaia::GetDummyRemoveLocalAccountURL(const std::string& gaia_id) const {
+ GURL url =
+ GaiaUrls::GetInstance()->gaia_url().Resolve(kDummyRemoveLocalAccountPath);
+ return net::AppendQueryParameter(url, "gaia_id", gaia_id);
+}
+
void FakeGaia::SetRefreshTokenToDeviceIdMap(
const RefreshTokenToDeviceIdMap& refresh_token_to_device_id_map) {
refresh_token_to_device_id_map_ = refresh_token_to_device_id_map;
@@ -859,8 +890,26 @@ void FakeGaia::HandleIssueToken(const HttpRequest& request,
void FakeGaia::HandleListAccounts(const HttpRequest& request,
BasicHttpResponse* http_response) {
- http_response->set_content(base::StringPrintf(
- kListAccountsResponseFormat, merge_session_params_.email.c_str()));
+ const int kAccountIsSignedIn = 0;
+ const int kAccountIsSignedOut = 1;
+
+ std::vector<std::string> listed_accounts;
+ listed_accounts.push_back(base::StringPrintf(
+ kIndividualListedAccountResponseFormat,
+ merge_session_params_.email.c_str(), kDefaultGaiaId, kAccountIsSignedIn));
+
+ for (const std::string& gaia_id : merge_session_params_.signed_out_gaia_ids) {
+ DCHECK_NE(kDefaultGaiaId, gaia_id);
+
+ const std::string email = GetEmailOfGaiaId(gaia_id);
+ listed_accounts.push_back(base::StringPrintf(
+ kIndividualListedAccountResponseFormat, email.c_str(), gaia_id.c_str(),
+ kAccountIsSignedOut));
+ }
+
+ http_response->set_content(
+ base::StringPrintf(kListAccountsResponseFormat,
+ base::JoinString(listed_accounts, ",").c_str()));
http_response->set_code(net::HTTP_OK);
}
@@ -1004,6 +1053,26 @@ void FakeGaia::HandleMultilogin(const HttpRequest& request,
http_response->set_code(net::HTTP_OK);
}
+void FakeGaia::HandleDummyRemoveLocalAccount(
+ const net::test_server::HttpRequest& request,
+ net::test_server::BasicHttpResponse* http_response) {
+ DCHECK(http_response);
+
+ std::string gaia_id;
+ GetQueryParameter(request.GetURL().query(), "gaia_id", &gaia_id);
+
+ if (!base::Erase(merge_session_params_.signed_out_gaia_ids, gaia_id)) {
+ http_response->set_code(net::HTTP_BAD_REQUEST);
+ return;
+ }
+
+ http_response->AddCustomHeader(
+ "Google-Accounts-RemoveLocalAccount",
+ base::StringPrintf("obfuscatedid=\"%s\"", gaia_id.c_str()));
+ http_response->set_content("");
+ http_response->set_code(net::HTTP_OK);
+}
+
std::string FakeGaia::GetEmbeddedSetupChromeosResponseContent() const {
if (embedded_setup_chromeos_iframe_url_.is_empty())
return embedded_setup_chromeos_response_;
diff --git a/chromium/google_apis/gaia/fake_gaia.h b/chromium/google_apis/gaia/fake_gaia.h
index 4b5b250d090..92d47d0e606 100644
--- a/chromium/google_apis/gaia/fake_gaia.h
+++ b/chromium/google_apis/gaia/fake_gaia.h
@@ -85,6 +85,9 @@ class FakeGaia {
// The e-mail address returned by /ListAccounts.
std::string email;
+
+ // List of signed out gaia IDs returned by /ListAccounts.
+ std::vector<std::string> signed_out_gaia_ids;
};
struct SyncTrustedVaultKeys {
@@ -194,6 +197,10 @@ class FakeGaia {
// Returns the is_device_owner param from the reauth URL if any.
const std::string& is_device_owner() { return is_device_owner_; }
+ // Returns the fake server's URL that browser tests can visit to trigger a
+ // RemoveLocalAccount event.
+ GURL GetDummyRemoveLocalAccountURL(const std::string& gaia_id) const;
+
protected:
// HTTP handler for /MergeSession.
virtual void HandleMergeSession(
@@ -209,6 +216,7 @@ class FakeGaia {
std::map<std::string, SyncTrustedVaultKeys>;
std::string GetGaiaIdOfEmail(const std::string& email) const;
+ std::string GetEmailOfGaiaId(const std::string& email) const;
void AddGoogleAccountsSigninHeader(
net::test_server::BasicHttpResponse* http_response,
@@ -298,6 +306,9 @@ class FakeGaia {
// HTTP handler for /OAuth/Multilogin.
void HandleMultilogin(const net::test_server::HttpRequest& request,
net::test_server::BasicHttpResponse* http_response);
+ void HandleDummyRemoveLocalAccount(
+ const net::test_server::HttpRequest& request,
+ net::test_server::BasicHttpResponse* http_response);
// Returns the access token associated with |auth_token| that matches the
// given |client_id| and |scope_string|. If |scope_string| is empty, the first
diff --git a/chromium/google_apis/gaia/gaia_auth_consumer.h b/chromium/google_apis/gaia/gaia_auth_consumer.h
index b38ca493d4f..7bd38470deb 100644
--- a/chromium/google_apis/gaia/gaia_auth_consumer.h
+++ b/chromium/google_apis/gaia/gaia_auth_consumer.h
@@ -65,26 +65,23 @@ class GaiaAuthConsumer {
};
// Possible server responses to a token revocation request.
- // Used in UMA, do not delete or reorder values.
enum class TokenRevocationStatus {
// Token revocation succeeded.
- kSuccess = 0,
+ kSuccess,
// Network connection was canceled, no response was received.
- kConnectionCanceled = 1,
+ kConnectionCanceled,
// Network connection failed, no response was received.
- kConnectionFailed = 2,
+ kConnectionFailed,
// Network connection timed out, no response was received.
- kConnectionTimeout = 3,
+ kConnectionTimeout,
// The token is unknown or invalid.
- kInvalidToken = 4,
+ kInvalidToken,
// The request was malformed.
- kInvalidRequest = 5,
+ kInvalidRequest,
// Internal server error.
- kServerError = 6,
+ kServerError,
// Other error.
- kUnknownError = 7,
-
- kMaxValue = kUnknownError
+ kUnknownError,
};
enum class ReAuthProofTokenStatus : int {
diff --git a/chromium/google_apis/gaia/gaia_auth_fetcher.cc b/chromium/google_apis/gaia/gaia_auth_fetcher.cc
index e71393a87c7..21ea9fc4fd1 100644
--- a/chromium/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/chromium/google_apis/gaia/gaia_auth_fetcher.cc
@@ -110,7 +110,7 @@ GetTokenRevocationStatusFromResponseData(const std::string& data,
std::unique_ptr<base::DictionaryValue> ParseJSONDict(const std::string& data) {
std::unique_ptr<base::DictionaryValue> response_dict;
- base::Optional<base::Value> message_value = base::JSONReader::Read(data);
+ absl::optional<base::Value> message_value = base::JSONReader::Read(data);
if (message_value && message_value->is_dict()) {
response_dict = std::make_unique<base::DictionaryValue>();
response_dict->MergeDictionary(base::OptionalOrNullptr(message_value));
diff --git a/chromium/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/chromium/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 72481f8f5d2..9c5eb568c6a 100644
--- a/chromium/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/chromium/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -13,7 +13,6 @@
#include "base/json/json_reader.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_number_conversions.h"
-#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/values.h"
diff --git a/chromium/google_apis/gaia/gaia_auth_util_unittest.cc b/chromium/google_apis/gaia/gaia_auth_util_unittest.cc
index cff21e226ca..7138a83c4dd 100644
--- a/chromium/google_apis/gaia/gaia_auth_util_unittest.cc
+++ b/chromium/google_apis/gaia/gaia_auth_util_unittest.cc
@@ -5,9 +5,9 @@
#include "google_apis/gaia/gaia_auth_util.h"
#include "base/base64url.h"
-#include "base/optional.h"
#include "google_apis/gaia/oauth2_mint_token_consent_result.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace gaia {
@@ -17,9 +17,9 @@ namespace {
const char kGaiaId[] = "fake_gaia_id";
std::string GenerateOAuth2MintTokenConsentResult(
- base::Optional<bool> approved,
- const base::Optional<std::string>& encrypted_approval_data,
- const base::Optional<std::string>& obfuscated_id,
+ absl::optional<bool> approved,
+ const absl::optional<std::string>& encrypted_approval_data,
+ const absl::optional<std::string>& obfuscated_id,
base::Base64UrlEncodePolicy encode_policy =
base::Base64UrlEncodePolicy::OMIT_PADDING) {
OAuth2MintTokenConsentResult consent_result;
@@ -364,7 +364,7 @@ TEST(GaiaAuthUtilTest, ParseConsentResultApproved) {
TEST(GaiaAuthUtilTest, ParseConsentResultApprovedEmptyData) {
const char kApprovedConsent[] = "CAEaDGZha2VfZ2FpYV9pZA";
EXPECT_EQ(kApprovedConsent,
- GenerateOAuth2MintTokenConsentResult(true, base::nullopt, kGaiaId));
+ GenerateOAuth2MintTokenConsentResult(true, absl::nullopt, kGaiaId));
bool approved = false;
std::string gaia_id;
ASSERT_TRUE(
@@ -376,7 +376,7 @@ TEST(GaiaAuthUtilTest, ParseConsentResultApprovedEmptyData) {
TEST(GaiaAuthUtilTest, ParseConsentResultApprovedEmptyGaiaId) {
const char kApprovedConsent[] = "CAESCUVOQ1JZUFRFRA";
EXPECT_EQ(kApprovedConsent, GenerateOAuth2MintTokenConsentResult(
- true, "ENCRYPTED", base::nullopt));
+ true, "ENCRYPTED", absl::nullopt));
bool approved = false;
std::string gaia_id;
ASSERT_TRUE(
@@ -388,7 +388,7 @@ TEST(GaiaAuthUtilTest, ParseConsentResultApprovedEmptyGaiaId) {
TEST(GaiaAuthUtilTest, ParseConsentResultNotApproved) {
const char kNoGrantConsent[] = "CAAaDGZha2VfZ2FpYV9pZA";
EXPECT_EQ(kNoGrantConsent, GenerateOAuth2MintTokenConsentResult(
- false, base::nullopt, kGaiaId));
+ false, absl::nullopt, kGaiaId));
bool approved = false;
std::string gaia_id;
ASSERT_TRUE(
@@ -399,7 +399,7 @@ TEST(GaiaAuthUtilTest, ParseConsentResultNotApproved) {
TEST(GaiaAuthUtilTest, ParseConsentResultEmpty) {
EXPECT_EQ("", GenerateOAuth2MintTokenConsentResult(
- base::nullopt, base::nullopt, base::nullopt));
+ absl::nullopt, absl::nullopt, absl::nullopt));
bool approved = false;
std::string gaia_id;
ASSERT_TRUE(ParseOAuth2MintTokenConsentResult("", &approved, &gaia_id));
@@ -413,7 +413,7 @@ TEST(GaiaAuthUtilTest, ParseConsentResultBase64UrlDisallowedPadding) {
const char kApprovedConsentWithPadding[] = "CAE=";
EXPECT_EQ(kApprovedConsentWithPadding,
GenerateOAuth2MintTokenConsentResult(
- true, base::nullopt, base::nullopt,
+ true, absl::nullopt, absl::nullopt,
base::Base64UrlEncodePolicy::INCLUDE_PADDING));
bool approved = false;
std::string gaia_id;
diff --git a/chromium/google_apis/gaia/gaia_config.cc b/chromium/google_apis/gaia/gaia_config.cc
index bae527d00ce..11239276dd3 100644
--- a/chromium/google_apis/gaia/gaia_config.cc
+++ b/chromium/google_apis/gaia/gaia_config.cc
@@ -11,10 +11,10 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
-#include "base/optional.h"
#include "base/strings/string_piece.h"
#include "google_apis/gaia/gaia_switches.h"
#include "google_apis/google_api_keys.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace {
@@ -32,7 +32,7 @@ std::unique_ptr<GaiaConfig> ReadConfigFromDisk() {
return nullptr;
}
- base::Optional<base::Value> dict = base::JSONReader::Read(config_contents);
+ absl::optional<base::Value> dict = base::JSONReader::Read(config_contents);
if (!dict || !dict->is_dict()) {
LOG(ERROR) << "Couldn't parse gaia config file " << config_path;
return nullptr;
diff --git a/chromium/google_apis/gaia/gaia_config.h b/chromium/google_apis/gaia/gaia_config.h
index d7a12bf95cd..7889d21aebd 100644
--- a/chromium/google_apis/gaia/gaia_config.h
+++ b/chromium/google_apis/gaia/gaia_config.h
@@ -8,10 +8,10 @@
#include <memory>
#include "base/gtest_prod_util.h"
-#include "base/optional.h"
#include "base/strings/string_piece_forward.h"
#include "base/values.h"
#include "google_apis/google_api_keys.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
class GURL;
diff --git a/chromium/google_apis/gaia/gaia_urls.cc b/chromium/google_apis/gaia/gaia_urls.cc
index e0cb98f8879..9b989c34eda 100644
--- a/chromium/google_apis/gaia/gaia_urls.cc
+++ b/chromium/google_apis/gaia/gaia_urls.cc
@@ -92,7 +92,7 @@ void GetSwitchValueWithDefault(base::StringPiece switch_value,
if (command_line->HasSwitch(switch_value)) {
*output_value = command_line->GetSwitchValueASCII(switch_value);
} else {
- *output_value = default_value.as_string();
+ *output_value = std::string(default_value);
}
}
diff --git a/chromium/google_apis/gaia/oauth2_mint_token_flow.cc b/chromium/google_apis/gaia/oauth2_mint_token_flow.cc
index f7afdff2bc2..777f27db625 100644
--- a/chromium/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/chromium/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -15,7 +15,6 @@
#include "base/containers/span.h"
#include "base/json/json_reader.h"
#include "base/metrics/histogram_functions.h"
-#include "base/optional.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -28,6 +27,7 @@
#include "net/base/net_errors.h"
#include "net/cookies/cookie_constants.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace {
@@ -75,7 +75,7 @@ static GoogleServiceAuthError CreateAuthError(
if (body)
response_body = std::move(*body);
- base::Optional<base::Value> value = base::JSONReader::Read(response_body);
+ absl::optional<base::Value> value = base::JSONReader::Read(response_body);
if (!value || !value->is_dict()) {
int http_response_code = -1;
if (head && head->headers)
@@ -238,7 +238,7 @@ void OAuth2MintTokenFlow::ProcessApiCallSuccess(
if (body)
response_body = std::move(*body);
- base::Optional<base::Value> value = base::JSONReader::Read(response_body);
+ absl::optional<base::Value> value = base::JSONReader::Read(response_body);
if (!value || !value->is_dict()) {
RecordApiCallResult(OAuth2MintTokenApiCallResult::kParseJsonFailure);
ReportFailure(GoogleServiceAuthError::FromUnexpectedServiceResponse(
@@ -388,8 +388,8 @@ bool OAuth2MintTokenFlow::ParseRemoteConsentResponse(
const std::string* path = cookie_dict.FindStringKey("path");
const std::string* max_age_seconds =
cookie_dict.FindStringKey("maxAgeSeconds");
- base::Optional<bool> is_secure = cookie_dict.FindBoolKey("isSecure");
- base::Optional<bool> is_http_only = cookie_dict.FindBoolKey("isHttpOnly");
+ absl::optional<bool> is_secure = cookie_dict.FindBoolKey("isSecure");
+ absl::optional<bool> is_http_only = cookie_dict.FindBoolKey("isHttpOnly");
const std::string* same_site = cookie_dict.FindStringKey("sameSite");
int64_t max_age = -1;
diff --git a/chromium/google_apis/gaia/oauth2_mint_token_flow_unittest.cc b/chromium/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
index 8444962874b..67bbd52add2 100644
--- a/chromium/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
+++ b/chromium/google_apis/gaia/oauth2_mint_token_flow_unittest.cc
@@ -12,7 +12,6 @@
#include <vector>
#include "base/json/json_reader.h"
-#include "base/optional.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/values.h"
@@ -24,6 +23,7 @@
#include "services/network/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
using testing::_;
using testing::ByRef;
@@ -211,7 +211,7 @@ class OAuth2MintTokenFlowTest : public testing::Test {
// Helper to parse the given string to base::Value.
static std::unique_ptr<base::Value> ParseJson(const std::string& str) {
- base::Optional<base::Value> value = base::JSONReader::Read(str);
+ absl::optional<base::Value> value = base::JSONReader::Read(str);
EXPECT_TRUE(value.has_value());
EXPECT_TRUE(value->is_dict());
return std::make_unique<base::Value>(std::move(*value));
diff --git a/chromium/google_apis/gaia/oauth_multilogin_result.cc b/chromium/google_apis/gaia/oauth_multilogin_result.cc
index e16ddf161aa..113327fb03a 100644
--- a/chromium/google_apis/gaia/oauth_multilogin_result.cc
+++ b/chromium/google_apis/gaia/oauth_multilogin_result.cc
@@ -10,9 +10,9 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
-#include "base/optional.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece_forward.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace {
@@ -96,10 +96,10 @@ void OAuthMultiloginResult::TryParseCookiesFromValue(base::Value* json_value) {
const std::string* domain = cookie.FindStringKey("domain");
const std::string* host = cookie.FindStringKey("host");
const std::string* path = cookie.FindStringKey("path");
- base::Optional<bool> is_secure = cookie.FindBoolKey("isSecure");
- base::Optional<bool> is_http_only = cookie.FindBoolKey("isHttpOnly");
+ absl::optional<bool> is_secure = cookie.FindBoolKey("isSecure");
+ absl::optional<bool> is_http_only = cookie.FindBoolKey("isHttpOnly");
const std::string* priority = cookie.FindStringKey("priority");
- base::Optional<double> expiration_delta = cookie.FindDoubleKey("maxAge");
+ absl::optional<double> expiration_delta = cookie.FindDoubleKey("maxAge");
const std::string* same_site = cookie.FindStringKey("sameSite");
base::TimeDelta before_expiration =
@@ -142,7 +142,7 @@ void OAuthMultiloginResult::TryParseCookiesFromValue(base::Value* json_value) {
OAuthMultiloginResult::OAuthMultiloginResult(const std::string& raw_data) {
base::StringPiece data = StripXSSICharacters(raw_data);
status_ = OAuthMultiloginResponseStatus::kUnknownStatus;
- base::Optional<base::Value> json_data = base::JSONReader::Read(data);
+ absl::optional<base::Value> json_data = base::JSONReader::Read(data);
if (!json_data) {
RecordMultiloginResponseStatus(status_);
return;
diff --git a/chromium/google_apis/gaia/oauth_multilogin_result.h b/chromium/google_apis/gaia/oauth_multilogin_result.h
index ef16f9956b1..25e8a1fc2cd 100644
--- a/chromium/google_apis/gaia/oauth_multilogin_result.h
+++ b/chromium/google_apis/gaia/oauth_multilogin_result.h
@@ -6,9 +6,7 @@
#define GOOGLE_APIS_GAIA_OAUTH_MULTILOGIN_RESULT_H_
#include <string>
-#include <unordered_map>
-#include "base/time/time.h"
#include "base/values.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "net/cookies/canonical_cookie.h"
diff --git a/chromium/google_apis/gaia/oauth_request_signer.cc b/chromium/google_apis/gaia/oauth_request_signer.cc
index 7a1cb15ef3c..d3f28cdb857 100644
--- a/chromium/google_apis/gaia/oauth_request_signer.cc
+++ b/chromium/google_apis/gaia/oauth_request_signer.cc
@@ -7,7 +7,6 @@
#include <stddef.h>
#include <cctype>
-#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <ctime>
diff --git a/chromium/google_apis/gcm/DIR_METADATA b/chromium/google_apis/gcm/DIR_METADATA
index 6e64937baa2..ca7bcee1e10 100644
--- a/chromium/google_apis/gcm/DIR_METADATA
+++ b/chromium/google_apis/gcm/DIR_METADATA
@@ -1,10 +1,10 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto
monorail {
component: "Services>CloudMessaging"
diff --git a/chromium/google_apis/gcm/base/encryptor.h b/chromium/google_apis/gcm/base/encryptor.h
index 898e7dba77e..a2deb2eea81 100644
--- a/chromium/google_apis/gcm/base/encryptor.h
+++ b/chromium/google_apis/gcm/base/encryptor.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_APIS_GCM_ENCRYPTOR_H_
-#define GOOGLE_APIS_GCM_ENCRYPTOR_H_
+#ifndef GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
+#define GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
#include <string>
#include "google_apis/gcm/base/gcm_export.h"
@@ -24,4 +24,4 @@ class GCM_EXPORT Encryptor {
} // namespace gcm
-#endif // GOOGLE_APIS_GCM_ENCRYPTOR_H_
+#endif // GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
diff --git a/chromium/google_apis/gcm/base/fake_encryptor.h b/chromium/google_apis/gcm/base/fake_encryptor.h
index 4277292280e..06f4d4e1347 100644
--- a/chromium/google_apis/gcm/base/fake_encryptor.h
+++ b/chromium/google_apis/gcm/base/fake_encryptor.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
-#define GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
+#ifndef GOOGLE_APIS_GCM_BASE_FAKE_ENCRYPTOR_H_
+#define GOOGLE_APIS_GCM_BASE_FAKE_ENCRYPTOR_H_
#include "base/compiler_specific.h"
#include "google_apis/gcm/base/encryptor.h"
@@ -25,4 +25,4 @@ class FakeEncryptor : public Encryptor {
} // namespace gcm
-#endif // GOOGLE_APIS_GCM_BASE_ENCRYPTOR_H_
+#endif // GOOGLE_APIS_GCM_BASE_FAKE_ENCRYPTOR_H_
diff --git a/chromium/google_apis/gcm/base/gcm_export.h b/chromium/google_apis/gcm/base/gcm_export.h
index b66eb8e54cf..0f801b974eb 100644
--- a/chromium/google_apis/gcm/base/gcm_export.h
+++ b/chromium/google_apis/gcm/base/gcm_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_APIS_GCM_GCM_EXPORT_H_
-#define GOOGLE_APIS_GCM_GCM_EXPORT_H_
+#ifndef GOOGLE_APIS_GCM_BASE_GCM_EXPORT_H_
+#define GOOGLE_APIS_GCM_BASE_GCM_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
@@ -26,4 +26,4 @@
#define GCM_EXPORT
#endif
-#endif // GOOGLE_APIS_GCM_GCM_EXPORT_H_
+#endif // GOOGLE_APIS_GCM_BASE_GCM_EXPORT_H_
diff --git a/chromium/google_apis/gcm/base/socket_stream_unittest.cc b/chromium/google_apis/gcm/base/socket_stream_unittest.cc
index d34daad02d4..ffdb481d5d5 100644
--- a/chromium/google_apis/gcm/base/socket_stream_unittest.cc
+++ b/chromium/google_apis/gcm/base/socket_stream_unittest.cc
@@ -243,8 +243,8 @@ void GCMSocketStreamTest::OpenConnection() {
mojo_socket_remote_.BindNewPipeAndPassReceiver(),
mojo::NullRemote() /* observer */,
base::BindLambdaForTesting(
- [&](int result, const base::Optional<net::IPEndPoint>& local_addr,
- const base::Optional<net::IPEndPoint>& peer_addr,
+ [&](int result, const absl::optional<net::IPEndPoint>& local_addr,
+ const absl::optional<net::IPEndPoint>& peer_addr,
mojo::ScopedDataPipeConsumerHandle receive_pipe_handle,
mojo::ScopedDataPipeProducerHandle send_pipe_handle) {
net_error = result;
diff --git a/chromium/google_apis/gcm/engine/connection_factory_impl.cc b/chromium/google_apis/gcm/engine/connection_factory_impl.cc
index 8e559395aa9..5f0fc24d53c 100644
--- a/chromium/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/chromium/google_apis/gcm/engine/connection_factory_impl.cc
@@ -413,8 +413,8 @@ base::TimeTicks ConnectionFactoryImpl::NowTicks() {
void ConnectionFactoryImpl::OnConnectDone(
int result,
- const base::Optional<net::IPEndPoint>& local_addr,
- const base::Optional<net::IPEndPoint>& peer_addr,
+ const absl::optional<net::IPEndPoint>& local_addr,
+ const absl::optional<net::IPEndPoint>& peer_addr,
mojo::ScopedDataPipeConsumerHandle receive_stream,
mojo::ScopedDataPipeProducerHandle send_stream) {
DCHECK_NE(net::ERR_IO_PENDING, result);
diff --git a/chromium/google_apis/gcm/engine/connection_factory_impl.h b/chromium/google_apis/gcm/engine/connection_factory_impl.h
index f5a6471bb60..057386faa2f 100644
--- a/chromium/google_apis/gcm/engine/connection_factory_impl.h
+++ b/chromium/google_apis/gcm/engine/connection_factory_impl.h
@@ -91,8 +91,8 @@ class GCM_EXPORT ConnectionFactoryImpl
// Callback for Socket connection completion. This is public for testing.
void OnConnectDone(int result,
- const base::Optional<net::IPEndPoint>& local_addr,
- const base::Optional<net::IPEndPoint>& peer_addr,
+ const absl::optional<net::IPEndPoint>& local_addr,
+ const absl::optional<net::IPEndPoint>& peer_addr,
mojo::ScopedDataPipeConsumerHandle receive_stream,
mojo::ScopedDataPipeProducerHandle send_stream);
diff --git a/chromium/google_apis/gcm/engine/connection_factory_impl_unittest.cc b/chromium/google_apis/gcm/engine/connection_factory_impl_unittest.cc
index bc9b20ec1e9..07ae83d3430 100644
--- a/chromium/google_apis/gcm/engine/connection_factory_impl_unittest.cc
+++ b/chromium/google_apis/gcm/engine/connection_factory_impl_unittest.cc
@@ -9,7 +9,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/optional.h"
#include "base/run_loop.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/task_environment.h"
@@ -27,6 +26,7 @@
#include "services/network/test/fake_test_cert_verifier_params_factory.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
class Policy;
diff --git a/chromium/google_apis/gcm/engine/connection_handler_impl.cc b/chromium/google_apis/gcm/engine/connection_handler_impl.cc
index 99943c87d99..bd93d534e13 100644
--- a/chromium/google_apis/gcm/engine/connection_handler_impl.cc
+++ b/chromium/google_apis/gcm/engine/connection_handler_impl.cc
@@ -52,7 +52,10 @@ ConnectionHandlerImpl::ConnectionHandlerImpl(
const ProtoSentCallback& write_callback,
const ConnectionChangedCallback& connection_callback)
: io_task_runner_(std::move(io_task_runner)),
- read_timeout_(read_timeout),
+ read_timeout_timer_(FROM_HERE,
+ read_timeout,
+ base::BindRepeating(&ConnectionHandlerImpl::OnTimeout,
+ base::Unretained(this))),
handshake_complete_(false),
message_tag_(0),
message_size_(0),
@@ -142,9 +145,7 @@ void ConnectionHandlerImpl::Login(
weak_ptr_factory_.GetWeakPtr()));
}
- read_timeout_timer_.Start(FROM_HERE, read_timeout_,
- base::BindOnce(&ConnectionHandlerImpl::OnTimeout,
- weak_ptr_factory_.GetWeakPtr()));
+ read_timeout_timer_.Reset();
WaitForData(MCS_VERSION_TAG_AND_SIZE);
}
@@ -322,11 +323,8 @@ void ConnectionHandlerImpl::OnGotMessageTag() {
DVLOG(1) << "Received proto of type "
<< static_cast<unsigned int>(message_tag_);
- if (!read_timeout_timer_.IsRunning()) {
- read_timeout_timer_.Start(FROM_HERE, read_timeout_,
- base::BindOnce(&ConnectionHandlerImpl::OnTimeout,
- weak_ptr_factory_.GetWeakPtr()));
- }
+ if (!read_timeout_timer_.IsRunning())
+ read_timeout_timer_.Reset();
OnGotMessageSize();
}
@@ -441,10 +439,7 @@ void ConnectionHandlerImpl::OnGotMessageBytes() {
<< ", expecting " << message_size_;
input_stream_->RebuildBuffer();
- read_timeout_timer_.Start(
- FROM_HERE, read_timeout_,
- base::BindOnce(&ConnectionHandlerImpl::OnTimeout,
- weak_ptr_factory_.GetWeakPtr()));
+ read_timeout_timer_.Reset();
WaitForData(MCS_PROTO_BYTES);
return;
}
diff --git a/chromium/google_apis/gcm/engine/connection_handler_impl.h b/chromium/google_apis/gcm/engine/connection_handler_impl.h
index 251063785b6..5bb5514edf3 100644
--- a/chromium/google_apis/gcm/engine/connection_handler_impl.h
+++ b/chromium/google_apis/gcm/engine/connection_handler_impl.h
@@ -107,8 +107,7 @@ class GCM_EXPORT ConnectionHandlerImpl : public ConnectionHandler {
// only stopped when a full message is processed.
// TODO(zea): consider enforcing a separate timeout when waiting for
// a message to send.
- const base::TimeDelta read_timeout_;
- base::OneShotTimer read_timeout_timer_;
+ base::RetainingOneShotTimer read_timeout_timer_;
// This connection's input/output streams.
std::unique_ptr<SocketInputStream> input_stream_;
diff --git a/chromium/google_apis/gcm/engine/connection_handler_impl_unittest.cc b/chromium/google_apis/gcm/engine/connection_handler_impl_unittest.cc
index 87f4e1ab76e..67d6781aee0 100644
--- a/chromium/google_apis/gcm/engine/connection_handler_impl_unittest.cc
+++ b/chromium/google_apis/gcm/engine/connection_handler_impl_unittest.cc
@@ -261,8 +261,8 @@ void GCMConnectionHandlerImplTest::BuildSocket(const ReadList& read_list,
mojo_socket_remote_.BindNewPipeAndPassReceiver(),
mojo::NullRemote() /* observer */,
base::BindLambdaForTesting(
- [&](int result, const base::Optional<net::IPEndPoint>& local_addr,
- const base::Optional<net::IPEndPoint>& peer_addr,
+ [&](int result, const absl::optional<net::IPEndPoint>& local_addr,
+ const absl::optional<net::IPEndPoint>& peer_addr,
mojo::ScopedDataPipeConsumerHandle receive_pipe_handle,
mojo::ScopedDataPipeProducerHandle send_pipe_handle) {
net_error = result;
diff --git a/chromium/google_apis/gcm/engine/gservices_switches.h b/chromium/google_apis/gcm/engine/gservices_switches.h
index bd778c64032..72547bc4ddd 100644
--- a/chromium/google_apis/gcm/engine/gservices_switches.h
+++ b/chromium/google_apis/gcm/engine/gservices_switches.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_APIS_GCM_ENGINE_GSERVICSE_SWITCHES_H_
-#define GOOGLE_APIS_GCM_ENGINE_GSERVICSE_SWITCHES_H_
+#ifndef GOOGLE_APIS_GCM_ENGINE_GSERVICES_SWITCHES_H_
+#define GOOGLE_APIS_GCM_ENGINE_GSERVICES_SWITCHES_H_
namespace switches {
@@ -13,4 +13,4 @@ extern const char kGCMRegistrationURL[];
} // namespace switches
-#endif // GOOGLE_APIS_GCM_ENGINE_GSERVICSE_SWITCHES_H_
+#endif // GOOGLE_APIS_GCM_ENGINE_GSERVICES_SWITCHES_H_
diff --git a/chromium/google_apis/gcm/engine/heartbeat_manager_unittest.cc b/chromium/google_apis/gcm/engine/heartbeat_manager_unittest.cc
index 6672bdaed60..3972f75a3fd 100644
--- a/chromium/google_apis/gcm/engine/heartbeat_manager_unittest.cc
+++ b/chromium/google_apis/gcm/engine/heartbeat_manager_unittest.cc
@@ -183,26 +183,6 @@ TEST_F(HeartbeatManagerTest, StartThenUpdateInterval) {
EXPECT_NE(heartbeat, manager()->GetNextHeartbeatTime());
}
-// Updating the timer used for heartbeats before starting should not start the
-// timer.
-TEST_F(HeartbeatManagerTest, UpdateTimerBeforeStart) {
- manager()->UpdateHeartbeatTimer(
- std::make_unique<base::RetainingOneShotTimer>());
- EXPECT_TRUE(manager()->GetNextHeartbeatTime().is_null());
-}
-
-// Updating the timer used for heartbeats after starting should restart the
-// timer but not increase the heartbeat time by more than a millisecond.
-TEST_F(HeartbeatManagerTest, UpdateTimerAfterStart) {
- StartManager();
- base::TimeTicks heartbeat = manager()->GetNextHeartbeatTime();
-
- manager()->UpdateHeartbeatTimer(
- std::make_unique<base::RetainingOneShotTimer>());
- EXPECT_LT(manager()->GetNextHeartbeatTime() - heartbeat,
- base::TimeDelta::FromMilliseconds(5));
-}
-
// Stopping the manager should reset the heartbeat timer.
TEST_F(HeartbeatManagerTest, Stop) {
StartManager();
diff --git a/chromium/google_apis/gcm/engine/mcs_client.h b/chromium/google_apis/gcm/engine/mcs_client.h
index 62be1f76e9e..b069b95c8e4 100644
--- a/chromium/google_apis/gcm/engine/mcs_client.h
+++ b/chromium/google_apis/gcm/engine/mcs_client.h
@@ -13,7 +13,6 @@
#include <vector>
#include "base/containers/circular_deque.h"
-#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "google_apis/gcm/base/gcm_export.h"
diff --git a/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc b/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
index ef1f3ee70f1..2b384dac1a2 100644
--- a/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
+++ b/chromium/google_apis/gcm/engine/unregistration_request_unittest.cc
@@ -128,11 +128,11 @@ TEST_F(GCMUnregistrationRequestTest, RequestDataPassedToFetcher) {
headers->GetHeader(net::HttpRequestHeaders::kAuthorization, &auth_header);
base::StringTokenizer auth_tokenizer(auth_header, " :");
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
+ EXPECT_EQ(kLoginHeader, auth_tokenizer.token_piece());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token_piece());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token_piece());
std::map<std::string, std::string> expected_pairs;
expected_pairs["app"] = kAppId;
@@ -338,11 +338,11 @@ TEST_F(InstaceIDDeleteTokenRequestTest, RequestDataPassedToFetcher) {
headers->GetHeader(net::HttpRequestHeaders::kAuthorization, &auth_header);
base::StringTokenizer auth_tokenizer(auth_header, " :");
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(kLoginHeader, auth_tokenizer.token());
+ EXPECT_EQ(kLoginHeader, auth_tokenizer.token_piece());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token_piece());
ASSERT_TRUE(auth_tokenizer.GetNext());
- EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token());
+ EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token_piece());
std::map<std::string, std::string> expected_pairs;
expected_pairs["gmsv"] = base::NumberToString(kGCMVersion);
diff --git a/chromium/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h b/chromium/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h
index a998a02cf58..f81dcf9aaff 100644
--- a/chromium/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h
+++ b/chromium/google_apis/gcm/monitoring/fake_gcm_stats_recorder.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECODER_H_
-#define GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECODER_H_
+#ifndef GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECORDER_H_
+#define GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECORDER_H_
#include <stdint.h>
@@ -73,4 +73,4 @@ class FakeGCMStatsRecorder : public GCMStatsRecorder {
} // namespace gcm
-#endif // GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECODER_H_
+#endif // GOOGLE_APIS_GCM_MONITORING_FAKE_GCM_STATS_RECORDER_H_
diff --git a/chromium/google_apis/gcm/monitoring/gcm_stats_recorder.h b/chromium/google_apis/gcm/monitoring/gcm_stats_recorder.h
index dff4a47f3e6..776d4787a49 100644
--- a/chromium/google_apis/gcm/monitoring/gcm_stats_recorder.h
+++ b/chromium/google_apis/gcm/monitoring/gcm_stats_recorder.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "base/time/time.h"
#include "google_apis/gcm/base/gcm_export.h"
#include "google_apis/gcm/engine/connection_factory.h"
#include "google_apis/gcm/engine/mcs_client.h"
diff --git a/chromium/google_apis/google_api_keys.py b/chromium/google_apis/google_api_keys.py
index 8e528f2ade4..664169b851f 100755
--- a/chromium/google_apis/google_api_keys.py
+++ b/chromium/google_apis/google_api_keys.py
@@ -10,6 +10,8 @@ in google_api_keys.h, since it does not have access to gyp variables
or preprocessor defines.
"""
+from __future__ import print_function
+
import os
import re
import sys
@@ -86,15 +88,15 @@ def GetClientSecret(client_name):
if __name__ == "__main__":
- print 'GOOGLE_API_KEY=%s' % GetAPIKey()
- print 'GOOGLE_CLIENT_ID_MAIN=%s' % GetClientID('MAIN')
- print 'GOOGLE_CLIENT_SECRET_MAIN=%s' % GetClientSecret('MAIN')
- print 'GOOGLE_CLIENT_ID_CLOUD_PRINT=%s' % GetClientID('CLOUD_PRINT')
- print 'GOOGLE_CLIENT_SECRET_CLOUD_PRINT=%s' % GetClientSecret('CLOUD_PRINT')
- print 'GOOGLE_CLIENT_ID_REMOTING=%s' % GetClientID('REMOTING')
- print 'GOOGLE_CLIENT_SECRET_REMOTING=%s' % GetClientSecret('REMOTING')
- print 'GOOGLE_CLIENT_ID_REMOTING_HOST=%s' % GetClientID('REMOTING_HOST')
- print 'GOOGLE_CLIENT_SECRET_REMOTING_HOST=%s' % GetClientSecret(
- 'REMOTING_HOST')
- print 'GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=%s' %GetClientID(
- 'REMOTING_IDENTITY_API')
+ print('GOOGLE_API_KEY=%s' % GetAPIKey())
+ print('GOOGLE_CLIENT_ID_MAIN=%s' % GetClientID('MAIN'))
+ print('GOOGLE_CLIENT_SECRET_MAIN=%s' % GetClientSecret('MAIN'))
+ print('GOOGLE_CLIENT_ID_CLOUD_PRINT=%s' % GetClientID('CLOUD_PRINT'))
+ print('GOOGLE_CLIENT_SECRET_CLOUD_PRINT=%s' % GetClientSecret('CLOUD_PRINT'))
+ print('GOOGLE_CLIENT_ID_REMOTING=%s' % GetClientID('REMOTING'))
+ print('GOOGLE_CLIENT_SECRET_REMOTING=%s' % GetClientSecret('REMOTING'))
+ print('GOOGLE_CLIENT_ID_REMOTING_HOST=%s' % GetClientID('REMOTING_HOST'))
+ print('GOOGLE_CLIENT_SECRET_REMOTING_HOST=%s' % GetClientSecret(
+ 'REMOTING_HOST'))
+ print('GOOGLE_CLIENT_ID_REMOTING_IDENTITY_API=%s' %GetClientID(
+ 'REMOTING_IDENTITY_API'))
diff --git a/chromium/google_apis/google_api_keys_mac.h b/chromium/google_apis/google_api_keys_mac.h
index 6ee268eaae3..53f512aeb08 100644
--- a/chromium/google_apis/google_api_keys_mac.h
+++ b/chromium/google_apis/google_api_keys_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef GOOGLE_API_KEYS_MAC_H_
-#define GOOGLE_API_KEYS_MAC_H_
+#ifndef GOOGLE_APIS_GOOGLE_API_KEYS_MAC_H_
+#define GOOGLE_APIS_GOOGLE_API_KEYS_MAC_H_
#include <string>
@@ -13,4 +13,4 @@ std::string GetAPIKeyFromInfoPlist(const std::string& key_name);
} // namespace google_apis
-#endif // GOOGLE_API_KEYS_MAC_H_
+#endif // GOOGLE_APIS_GOOGLE_API_KEYS_MAC_H_