From: uazo Date: Tue, 5 Sep 2023 12:55:40 +0000 Subject: Remove GoogleAccountsPrivateApiHost License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- .../google_accounts_private_api_util.cc | 20 +------------------ ...rusted_vault_encryption_keys_tab_helper.cc | 6 ++---- .../google_accounts_private_api_util.cc | 11 ---------- 3 files changed, 3 insertions(+), 34 deletions(-) diff --git a/chrome/browser/signin/google_accounts_private_api_util.cc b/chrome/browser/signin/google_accounts_private_api_util.cc --- a/chrome/browser/signin/google_accounts_private_api_util.cc +++ b/chrome/browser/signin/google_accounts_private_api_util.cc @@ -9,25 +9,7 @@ #include "content/public/browser/site_instance.h" #include "google_apis/gaia/gaia_urls.h" -const url::Origin& GetAllowedGoogleAccountsOrigin() { - const url::Origin& origin = GaiaUrls::GetInstance()->gaia_origin(); - CHECK(!origin.opaque()); - return origin; -} - bool ShouldExposeGoogleAccountsPrivateApi( content::NavigationHandle* navigation_handle) { - if (!navigation_handle->HasCommitted() || navigation_handle->IsErrorPage()) { - return false; - } - - content::RenderFrameHost* rfh = navigation_handle->GetRenderFrameHost(); - const url::Origin rfh_origin = rfh->GetLastCommittedOrigin(); - // Restrict to allowed origin and only if site isolation requires a dedicated - // process. The host is compared explicitly to confirm that the allowed origin - // uses a dedicated process, rather than sharing process with eTLD+1. - return rfh_origin == GetAllowedGoogleAccountsOrigin() && - rfh->GetSiteInstance()->RequiresDedicatedProcess() && - rfh->GetSiteInstance()->GetSiteURL().host() == - GetAllowedGoogleAccountsOrigin().host(); + return false; } diff --git a/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc b/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc --- a/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc +++ b/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc @@ -57,8 +57,7 @@ class EncryptionKeyApi trusted_vault_keys, SetEncryptionKeysCallback callback) override { // Extra safeguard. - if (receivers_.GetCurrentTargetFrame()->GetLastCommittedOrigin() != - GetAllowedGoogleAccountsOrigin()) { + if ((true)) { return; } @@ -91,8 +90,7 @@ class EncryptionKeyApi int method_type_hint, AddTrustedRecoveryMethodCallback callback) override { // Extra safeguard. - if (receivers_.GetCurrentTargetFrame()->GetLastCommittedOrigin() != - GetAllowedGoogleAccountsOrigin()) { + if ((true)) { return; } diff --git a/chrome/renderer/google_accounts_private_api_util.cc b/chrome/renderer/google_accounts_private_api_util.cc --- a/chrome/renderer/google_accounts_private_api_util.cc +++ b/chrome/renderer/google_accounts_private_api_util.cc @@ -12,20 +12,9 @@ namespace { -const url::Origin& GetAllowedGoogleAccountsOrigin() { - const url::Origin& origin = GaiaUrls::GetInstance()->gaia_origin(); - CHECK(!origin.opaque()); - return origin; -} - } // namespace bool ShouldExposeGoogleAccountsJavascriptApi( content::RenderFrame* render_frame) { if ((true)) return false; - DCHECK(render_frame); - - const url::Origin origin = render_frame->GetWebFrame()->GetSecurityOrigin(); - return origin == GetAllowedGoogleAccountsOrigin() && - blink::Platform::Current()->IsLockedToSite(); } -- 2.25.1