Redo the UseCounter DownloadInAdFrame and implemented the intervention
Mostly similar to what we've done for DownloadInSandbox with the following
differences:
- For ad, we collect 2 UseCounters - both with & without gesture, as the usage
is quite low so it's possible we block them all in the future.
- Use base::FeatureList rather than RuntimeEnabledFeature to avoid plumbing
extra information through layers. (For sandbox intervention
RuntimeEnabledFeatures is used for WPT coverage before the feature is default
to enabled)
- This CL is missing the part where the frame navigating is an ad, as we don't
know the ad status of remote frame. Subsequent CL will address this issue which
will probably query this info in the browser process.
Bug: 929911
Change-Id: Ib8885ef5b3e349cef3250d354561c16fdc28aab7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532996
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#646564}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6141582..f1b29f2 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -287,12 +287,13 @@
// Possibly set the kOpenerCrossOrigin and kSandboxNoGesture policy in
// |download_policy|.
- static void MaybeSetOpenerAndSandboxDownloadPolicy(
+ static void MaybeSetDownloadFramePolicy(
bool is_opener_navigation,
const blink::WebURLRequest& request,
const blink::WebSecurityOrigin& current_origin,
bool has_download_sandbox_flag,
bool blocking_downloads_in_sandbox_without_user_activation_enabled,
+ bool from_ad,
NavigationDownloadPolicy* download_policy);
// Overwrites the given URL to use an HTML5 embed if possible.