Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 69317f07 authored by uazo's avatar uazo Committed by GitHub
Browse files

Merge pull request #1107 from uazo/create-pull-request/patch-5e764c70

[AUTO][FILECONTROL] - version 125.0.6422.60
parents 414e400d 6e898120
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
124.0.6367.159
125.0.6422.60
+99 −24
Original line number Diff line number Diff line
@@ -73,10 +73,11 @@
#include "components/policy/content/policy_blocklist_navigation_throttle.h"
#include "components/policy/core/browser/browser_policy_connector_base.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/async_check_tracker.h"
#include "components/safe_browsing/content/browser/browser_url_loader_throttle.h"
#include "components/safe_browsing/content/browser/mojo_safe_browsing_impl.h"
#include "components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_utils.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/url_matcher/url_matcher.h"
#include "components/url_matcher/url_util.h"
#include "components/version_info/version_info.h"
@@ -129,9 +130,10 @@

using content::BrowserThread;
using content::WebContents;
using safe_browsing::AsyncCheckTracker;
using safe_browsing::hash_realtime_utils::HashRealTimeSelection;
using AttributionReportType =
    content::ContentBrowserClient::AttributionReportingOsReportType;
using AttributionReportingOsRegistrar =
    content::ContentBrowserClient::AttributionReportingOsRegistrar;

namespace android_webview {
namespace {
@@ -147,6 +149,57 @@ bool g_created_network_context_params = false;
// On apps targeting API level O or later, check cleartext is enforced.
bool g_check_cleartext_permitted = false;

BASE_FEATURE(kWebViewOptimizeXrwNavigationFlow,
             "WebViewOptimizeXrwNavigationFlow",
             base::FEATURE_DISABLED_BY_DEFAULT);

// A throttle which checks if the XRW origin trial is enabled for this
// navigation, and forwards it to the proxying loader factory.
class XrwNavigationThrottle : public content::NavigationThrottle {
 public:
  explicit XrwNavigationThrottle(content::NavigationHandle* handle)
      : NavigationThrottle(handle) {}
  ~XrwNavigationThrottle() override {
    AwProxyingURLLoaderFactory::ClearXrwResultForNavigation(
        navigation_handle()->GetNavigationId());
  }

  ThrottleCheckResult WillStartRequest() override {
    auto* handle = navigation_handle();
    AwProxyingURLLoaderFactory::SetXrwResultForNavigation(
        handle->GetURL(),
        handle->IsInOutermostMainFrame()
            ? blink::mojom::ResourceType::kMainFrame
            : blink::mojom::ResourceType::kSubFrame,
        handle->GetFrameTreeNodeId(), handle->GetNavigationId());
    return content::NavigationThrottle::PROCEED;
  }

  const char* GetNameForLogging() override { return "XrwNavigationThrottle"; }
};

// Get async check tracker to make Safe Browsing v5 check asynchronous
base::WeakPtr<AsyncCheckTracker> GetAsyncCheckTracker(
    const base::RepeatingCallback<content::WebContents*()>& wc_getter,
    int frame_tree_node_id) {
  if (!base::FeatureList::IsEnabled(
          safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) {
    return nullptr;
  }
  content::WebContents* web_contents = wc_getter.Run();
  // Check whether current frame is a pre-rendered frame. WebView does not
  // support NoStatePrefetch, so we do not check for that.
  if (web_contents == nullptr ||
      web_contents->IsPrerenderedFrame(frame_tree_node_id)) {
    return nullptr;
  }

  return AsyncCheckTracker::GetOrCreateForWebContents(
             web_contents,
             AwBrowserProcess::GetInstance()->GetSafeBrowsingUIManager())
      ->GetWeakPtr();
}

}  // anonymous namespace

std::string GetProduct() {
@@ -223,6 +276,12 @@ void AwContentBrowserClient::OnNetworkServiceCreated(
      network::mojom::HttpAuthStaticParams::New());
  content::GetNetworkService()->ConfigureHttpAuthPrefs(
      AwBrowserProcess::GetInstance()->CreateHttpAuthDynamicParams());
  if (base::FeatureList::IsEnabled(features::kWebViewAsyncDns)) {
    content::GetNetworkService()->ConfigureStubHostResolver(
        /*insecure_dns_client_enabled=*/true, net::SecureDnsMode::kAutomatic,
        net::DnsOverHttpsConfig(),
        /*additional_dns_types_enabled=*/true);
  }
}

void AwContentBrowserClient::ConfigureNetworkContextParams(
@@ -494,8 +553,9 @@ bool AwContentBrowserClient::IsPepperVpnProviderAPIAllowed(
  return false;
}

content::TracingDelegate* AwContentBrowserClient::GetTracingDelegate() {
  return new AwTracingDelegate();
std::unique_ptr<content::TracingDelegate>
AwContentBrowserClient::CreateTracingDelegate() {
  return std::make_unique<AwTracingDelegate>();
}

void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
@@ -577,6 +637,10 @@ AwContentBrowserClient::CreateThrottlesForNavigation(
  if (safe_browsing_throttle) {
    throttles.push_back(std::move(safe_browsing_throttle));
  }
  if (base::FeatureList::IsEnabled(kWebViewOptimizeXrwNavigationFlow)) {
    throttles.push_back(
        std::make_unique<XrwNavigationThrottle>(navigation_handle));
  }
  return throttles;
}

@@ -596,10 +660,16 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
  DCHECK_CURRENTLY_ON(BrowserThread::UI);

  // Set lookup mechanism based on feature flag
  HashRealTimeSelection hash_real_time_selection =
      (base::FeatureList::IsEnabled(safe_browsing::kHashPrefixRealTimeLookups))
          ? HashRealTimeSelection::kDatabaseManager
          : HashRealTimeSelection::kNone;
  HashRealTimeSelection hash_real_time_selection;
  base::WeakPtr<AsyncCheckTracker> async_check_tracker;
  if (base::FeatureList::IsEnabled(safe_browsing::kHashPrefixRealTimeLookups)) {
    hash_real_time_selection = HashRealTimeSelection::kDatabaseManager;
    async_check_tracker = GetAsyncCheckTracker(wc_getter, frame_tree_node_id);
  } else {
    hash_real_time_selection = HashRealTimeSelection::kNone;
    async_check_tracker = nullptr;
  }

  std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
  result.push_back(safe_browsing::BrowserURLLoaderThrottle::Create(
      base::BindRepeating(
@@ -615,9 +685,7 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
      /* hash_realtime_service */ nullptr,
      /* hash_realtime_selection */
      hash_real_time_selection,
      // TODO(crbug.com/1501194): pass in async_check_tracker to support async
      // check on WV.
      /* async_check_tracker */ nullptr));
      /* async_check_tracker */ async_check_tracker));

  if (request.destination == network::mojom::RequestDestination::kDocument) {
    const bool is_load_url =
@@ -836,7 +904,8 @@ bool AwContentBrowserClient::HandleExternalProtocol(
    new android_webview::AwProxyingURLLoaderFactory(
        frame_tree_node_id, std::move(receiver), mojo::NullRemote(),
        true /* intercept_only */, std::nullopt /* security_options */,
        nullptr /* xrw_allowlist_matcher */, std::move(browser_context_handle));
        nullptr /* xrw_allowlist_matcher */, std::move(browser_context_handle),
        std::nullopt /* navigation_id */);
  } else {
    content::GetIOThreadTaskRunner({})->PostTask(
        FROM_HERE,
@@ -851,7 +920,8 @@ bool AwContentBrowserClient::HandleExternalProtocol(
                  true /* intercept_only */,
                  std::nullopt /* security_options */,
                  nullptr /* xrw_allowlist_matcher */,
                  std::move(browser_context_handle));
                  std::move(browser_context_handle),
                  std::nullopt /* navigation_id */);
            },
            std::move(receiver), frame_tree_node_id,
            std::move(browser_context_handle)));
@@ -945,6 +1015,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
    int render_process_id,
    URLLoaderFactoryType type,
    const url::Origin& request_initiator,
    const net::IsolationInfo& isolation_info,
    std::optional<int64_t> navigation_id,
    ukm::SourceIdObj ukm_source_id,
    network::URLLoaderFactoryBuilder& factory_builder,
@@ -1014,7 +1085,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
                       frame->GetFrameTreeNodeId(), std::move(proxied_receiver),
                       std::move(target_factory_remote), security_options,
                       std::move(xrw_allowlist_matcher),
                       std::move(browser_context_handle)));
                       std::move(browser_context_handle), navigation_id));
  } else {
    // A service worker and worker subresources set nullptr to |frame|, and
    // work without seeing the AllowUniversalAccessFromFileURLs setting. So,
@@ -1029,7 +1100,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
            std::move(proxied_receiver), std::move(target_factory_remote),
            std::nullopt /* security_options */,
            aw_browser_context->service_worker_xrw_allowlist_matcher(),
            std::move(browser_context_handle)));
            std::move(browser_context_handle), navigation_id));
  }
}

@@ -1235,8 +1306,8 @@ bool AwContentBrowserClient::IsAttributionReportingOperationAllowed(
  NOTREACHED_NORETURN();
}

content::ContentBrowserClient::AttributionReportingOsReportTypes
AwContentBrowserClient::GetAttributionReportingOsReportTypes(
content::ContentBrowserClient::AttributionReportingOsRegistrars
AwContentBrowserClient::GetAttributionReportingOsRegistrars(
    content::WebContents* web_contents) {
  // Attribution reporting can register a source to either the top level origin
  // or the app. For WebView the default is to register sources against the app
@@ -1258,7 +1329,8 @@ AwContentBrowserClient::GetAttributionReportingOsReportTypes(
  AwSettings* aw_settings = AwSettings::FromWebContents(web_contents);

  if (!aw_settings) {
    return {AttributionReportType::kDisabled, AttributionReportType::kDisabled};
    return {AttributionReportingOsRegistrar::kDisabled,
            AttributionReportingOsRegistrar::kDisabled};
  }

  AwSettings::AttributionBehavior attribution_behavior =
@@ -1266,14 +1338,17 @@ AwContentBrowserClient::GetAttributionReportingOsReportTypes(

  switch (attribution_behavior) {
    case AwSettings::AttributionBehavior::WEB_SOURCE_AND_WEB_TRIGGER:
      return {AttributionReportType::kWeb, AttributionReportType::kWeb};
      return {AttributionReportingOsRegistrar::kWeb,
              AttributionReportingOsRegistrar::kWeb};
    case AwSettings::AttributionBehavior::APP_SOURCE_AND_WEB_TRIGGER:
      return {AttributionReportType::kOs, AttributionReportType::kWeb};
      return {AttributionReportingOsRegistrar::kOs,
              AttributionReportingOsRegistrar::kWeb};
    case AwSettings::AttributionBehavior::APP_SOURCE_AND_APP_TRIGGER:
      return {AttributionReportType::kOs, AttributionReportType::kOs};
      return {AttributionReportingOsRegistrar::kOs,
              AttributionReportingOsRegistrar::kOs};
    case AwSettings::AttributionBehavior::DISABLED:
      return {AttributionReportType::kDisabled,
              AttributionReportType::kDisabled};
      return {AttributionReportingOsRegistrar::kDisabled,
              AttributionReportingOsRegistrar::kDisabled};
  }

  NOTREACHED_NORETURN();
+5 −4
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ by a child template that "extends" this file.
    <!-- Feature declarations required to support conditional install for VR DFM -->
    <uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false"/>
    <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false"/>

    <uses-permission-sdk-23 android:name="android.permission.SCENE_UNDERSTANDING" />
    <uses-permission-sdk-23 android:name="android.permission.HAND_TRACKING" />
    {% endif %}

    <permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
@@ -1095,6 +1098,8 @@ by a child template that "extends" this file.
            </intent-filter>
        </service>

        <receiver android:name="org.chromium.chrome.browser.data_sharing.DataSharingNotificationManager$Receiver"
            android:exported="false" />

        <receiver android:name="org.chromium.chrome.browser.announcement.AnnouncementNotificationManager$Receiver"
            android:exported="false"/>
@@ -1140,10 +1145,6 @@ by a child template that "extends" this file.

        <receiver android:name="org.chromium.chrome.browser.sharing.click_to_call.ClickToCallMessageHandler$TapReceiver"
            android:exported="false"/>
        <receiver android:name="org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardMessageHandler$TapReceiver"
            android:exported="false"/>
        <receiver android:name="org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardMessageHandler$TryAgainReceiver"
            android:exported="false"/>
        <receiver android:name="org.chromium.chrome.browser.sharing.sms_fetcher.SmsFetcherMessageHandler$NotificationReceiver"
            android:exported="false"/>

+18 −6
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/tpcd/metadata/manager_factory.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
@@ -125,6 +126,7 @@
#include "components/search_engines/template_url_service.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"
#include "components/tpcd/metadata/manager.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "components/webrtc_logging/browser/log_cleanup.h"
#include "components/webrtc_logging/browser/text_log_list.h"
@@ -649,7 +651,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
                                                   website_settings_filter,
                                                   host_content_settings_map_);

    if (!filter_builder->IsCrossSiteClearSiteDataForCookies()) {
    if (!filter_builder->PartitionedCookiesOnly()) {
      browsing_data::RemoveEmbedderCookieData(
          delete_begin, delete_end, filter_builder, host_content_settings_map_,
          safe_browsing_context,
@@ -664,8 +666,14 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
        BrowsingDataFilterBuilder::Mode::kPreserve) {
      auto* privacy_sandbox_settings =
          PrivacySandboxSettingsFactory::GetForProfile(profile_);
      if (privacy_sandbox_settings)
      if (privacy_sandbox_settings) {
        privacy_sandbox_settings->OnCookiesCleared();
      }

      if (tpcd::metadata::Manager* manager =
              tpcd::metadata::ManagerFactory::GetForProfile(profile_)) {
        manager->ResetCohorts();
      }

#if BUILDFLAG(IS_ANDROID)
      Java_PackageHash_onCookiesDeleted(
@@ -676,7 +684,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(

#if !BUILDFLAG(IS_ANDROID)
    if (nullable_filter.is_null() ||
        (!filter_builder->IsCrossSiteClearSiteDataForCookies() &&
        (!filter_builder->PartitionedCookiesOnly() &&
         nullable_filter.Run(GaiaUrls::GetInstance()->google_url()))) {
      // Set a flag to clear account storage settings later instead of clearing
      // it now as we can not reset this setting before passwords are deleted.
@@ -859,6 +867,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
        ContentSettingsType::REVOKED_UNUSED_SITE_PERMISSIONS, delete_begin_,
        delete_end_, website_settings_filter);

    host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
        ContentSettingsType::REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS,
        delete_begin_, delete_end_, website_settings_filter);

    host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
        ContentSettingsType::PRIVATE_NETWORK_GUARD, delete_begin_, delete_end_,
        website_settings_filter);
@@ -879,7 +891,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
  // DATA_TYPE_COOKIES.
  DIPSEventRemovalType dips_mask = DIPSEventRemovalType::kNone;
  if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) &&
      !filter_builder->IsCrossSiteClearSiteDataForCookies()) {
      !filter_builder->PartitionedCookiesOnly()) {
    dips_mask |= DIPSEventRemovalType::kStorage;
  }
  if (remove_mask & constants::DATA_TYPE_HISTORY) {
@@ -984,7 +996,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
  CHECK(deferred_disable_passwords_auto_signin_cb_.is_null(),
        base::NotFatalUntil::M125);
  if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) &&
      !filter_builder->IsCrossSiteClearSiteDataForCookies()) {
      !filter_builder->PartitionedCookiesOnly()) {
    // Unretained() is safe, this is only executed in OnTasksComplete() if the
    // object is still alive. Also, see the field docs for motivation.
    deferred_disable_passwords_auto_signin_cb_ = base::BindOnce(
@@ -1194,7 +1206,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
  // results only when their respective URLs are in the filter.
  if ((remove_mask & (content::BrowsingDataRemover::DATA_TYPE_CACHE |
                      content::BrowsingDataRemover::DATA_TYPE_COOKIES)) &&
      !filter_builder->IsCrossSiteClearSiteDataForCookies()) {
      !filter_builder->PartitionedCookiesOnly()) {
    // If there is no template service or DSE, clear the caches.
    bool should_clear_zero_suggest_and_session_token = true;
    bool should_clear_search_prefetch = true;
+61 −25

File changed.

Preview size limit exceeded, changes collapsed.

Loading