Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/under-control/src/RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
147.0.7727.102
149.0.7827.22
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include "android_webview/browser/aw_speech_recognition_manager_delegate.h"
#include "android_webview/browser/aw_web_contents_delegate.h"
#include "android_webview/browser/aw_web_contents_view_delegate.h"
#include "android_webview/browser/content_restriction/aw_content_restriction_manager_client.h"
#include "android_webview/browser/content_restriction/aw_content_restriction_navigation_throttle.h"
#include "android_webview/browser/content_restriction/aw_content_restriction_url_loader_throttle.h"
#include "android_webview/browser/cookie_manager.h"
#include "android_webview/browser/network_service/aw_browser_context_io_thread_handle.h"
#include "android_webview/browser/network_service/aw_proxy_config_monitor.h"
Expand Down Expand Up @@ -732,14 +735,22 @@ void AwContentBrowserClient::CreateThrottlesForNavigation(
if ((navigation_handle.GetNavigatingFrameType() ==
FrameType::kPrimaryMainFrame ||
navigation_handle.GetNavigatingFrameType() == FrameType::kSubframe) &&
registry.IsHTTPOrHTTPS()) {
registry.GetNavigationHandle().GetURL().SchemeIsHTTPOrHTTPS()) {
AwSupervisedUserUrlClassifier* urlClassifier =
AwSupervisedUserUrlClassifier::GetInstance();
if (urlClassifier->ShouldCreateThrottle()) {
registry.AddThrottle(
std::make_unique<AwSupervisedUserThrottle>(registry, urlClassifier));
}
}

if (base::FeatureList::IsEnabled(
android_webview::features::kWebViewContentRestrictionSupport)) {
registry.AddThrottle(
std::make_unique<AwContentRestrictionNavigationThrottle>(
registry,
context->GetContentRestrictionBlockedNavigationTracker()));
}
}

std::unique_ptr<content::PrefetchServiceDelegate>
Expand Down Expand Up @@ -794,6 +805,17 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
/* async_check_tracker */ async_check_tracker,
/*referring_app_info=*/std::nullopt));

if (browser_context &&
base::FeatureList::IsEnabled(
android_webview::features::kWebViewContentRestrictionSupport)) {
AwBrowserContext* const aw_browser_context =
static_cast<AwBrowserContext*>(browser_context);
result.push_back(std::make_unique<AwContentRestrictionURLLoaderThrottle>(
aw_browser_context->GetContentRestrictionManagerClient(),
aw_browser_context->GetContentRestrictionBlockedNavigationTracker(),
navigation_id));
}

if (request.destination == network::mojom::RequestDestination::kDocument) {
const bool is_load_url =
request.transition_type & ui::PAGE_TRANSITION_FROM_API;
Expand Down Expand Up @@ -1488,7 +1510,9 @@ bool AwContentBrowserClient::IsFullCookieAccessAllowed(
const GURL& url,
const blink::StorageKey& storage_key,
net::CookieSettingOverrides overrides) {
return AreThirdPartyCookiesGenerallyAllowed(browser_context, web_contents);
// Third-party cookie access is never allowed from opaque contexts.
return !storage_key.ForbidsUnpartitionedStorageAccess() &&
AreThirdPartyCookiesGenerallyAllowed(browser_context, web_contents);
}

bool AwContentBrowserClient::AreThirdPartyCookiesGenerallyAllowed(
Expand Down
31 changes: 18 additions & 13 deletions tools/under-control/src/android_webview/browser/aw_field_trials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "ui/android/ui_android_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/gl/gl_features.h"
#include "ui/gl/gl_switches.h"

Expand Down Expand Up @@ -71,6 +70,13 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
aw_feature_overrides.DisableFeature(
input::features::kUpdateScrollPredictorInputMapping);

// InputVizard is disabled on WebView as it is a Chrome-only feature that
// moves input handling to the VizCompositor thread, which is out of scope
// for WebView's Synchronous Compositor architecture.
aw_feature_overrides.DisableFeature(input::features::kInputOnViz);
aw_feature_overrides.DisableFeature(
input::features::kInputVizardSpeculativeTransfer);

// Disable enforcing `noopener` on Blob URL navigations on WebView.
aw_feature_overrides.DisableFeature(
blink::features::kEnforceNoopenerOnBlobURLNavigation);
Expand Down Expand Up @@ -101,9 +107,7 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// enable these optimizations in WebView though they are not fundamentally
// impossible.
aw_feature_overrides.DisableFeature(
blink::features::kLowLatencyCanvas2dImageChromium);
aw_feature_overrides.DisableFeature(
blink::features::kLowLatencyWebGLImageChromium);
blink::features::kLowLatencyUsageSupportedForCanvas);

// Disable Shared Storage on WebView.
aw_feature_overrides.DisableFeature(network::features::kSharedStorageAPI);
Expand All @@ -114,11 +118,6 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// Disable scrollbar-width on WebView.
aw_feature_overrides.DisableFeature(blink::features::kScrollbarWidth);

// TODO(crbug.com/402144902): Remove this once webview experiment has
// concluded.
aw_feature_overrides.DisableFeature(
::features::kSendEmptyGestureScrollUpdate);

// Disable Populating the VisitedLinkDatabase on WebView.
aw_feature_overrides.DisableFeature(history::kPopulateVisitedLinkDatabase);

Expand Down Expand Up @@ -326,12 +325,18 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// the WebView's host, we keep the old behavior for content:// URLs.
aw_feature_overrides.DisableFeature(blink::features::kContentSchemeIsLocal);

// Disable No-Vary-Search in disk cache on WebView.
// See https://crbug.com/382394774.
aw_feature_overrides.DisableFeature(net::features::kHttpCacheNoVarySearch);

// TODO(crbug.com/489450060): Disable DirectReceiver on Viz for WebView until
// its Viz thread is updated to handle IO.
aw_feature_overrides.DisableFeature(
::features::kVizDirectCompositorThreadIpcFrameSinkManager);

// TODO(crbug.com/441800312): Enable this once WebView experiment has
// concluded.
aw_feature_overrides.DisableFeature(
blink::features::kUnthrottleAsyncTouchMoves);

// Disable `PrefetchRequestStatusListenerAsync` on WebView to run an
// experiment on WebView.
aw_feature_overrides.DisableFeature(
::features::kPrefetchRequestStatusListenerAsync);
}
Loading