Skip to content

Commit

Permalink
Enable NavigationRequestPreconnect on WebView.
Browse files Browse the repository at this point in the history
This was an oversight when the feature was added. I'll use Finch to measure the effect.

(cherry picked from commit 8948da2)

Bug: 1276493
Change-Id: Ia75ef74b9fd832dd0043284c72b9ab9b558e6d0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4189306
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1096336}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4195634
Cr-Commit-Position: refs/branch-heads/5481@{#692}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
John Abd-El-Malek authored and Chromium LUCI CQ committed Jan 26, 2023
1 parent 51cc50f commit 436420b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions android_webview/browser/aw_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,11 @@ bool AwContentBrowserClient::SuppressDifferentOriginSubframeJSDialogs(
features::kWebViewSuppressDifferentOriginSubframeJSDialogs);
}

bool AwContentBrowserClient::ShouldPreconnectNavigation(
content::BrowserContext* browser_context) {
return true;
}

void AwContentBrowserClient::OnDisplayInsecureContent(
content::WebContents* web_contents) {
AwSettings* aw_settings = AwSettings::FromWebContents(web_contents);
Expand Down
2 changes: 2 additions & 0 deletions android_webview/browser/aw_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
bool HasErrorPage(int http_status_code) override;
bool SuppressDifferentOriginSubframeJSDialogs(
content::BrowserContext* browser_context) override;
bool ShouldPreconnectNavigation(
content::BrowserContext* browser_context) override;
void OnDisplayInsecureContent(content::WebContents* web_contents) override;

AwFeatureListCreator* aw_feature_list_creator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ private ProductionSupportedFlagList() {}
Flag.baseFeature(ContentSwitches.DISABLE_DOMAIN_BLOCKING_FOR3DAP_IS,
"Disable the per-domain blocking for 3D APIs after GPU reset. "
+ "This switch is intended only for tests."),
Flag.baseFeature("NavigationRequestPreconnect"),
// Add new commandline switches and features above. The final entry should have a
// trailing comma for cleaner diffs.
};
Expand Down

0 comments on commit 436420b

Please sign in to comment.