Reland "Reland "Consolidate iframe & object resource timing code paths""
This reverts commit d1b49ff4d15bc538c4feddff9f81253bba6abd9d.
Reason for revert: The failing tests will be fixed instead of reverting the original CL that caused them.
Original change's description:
> Revert "Reland "Consolidate iframe & object resource timing code paths""
>
> This reverts commit c8d82e52681f338bc4671df333a2bc9d6c93a32c.
>
> Reason for revert: Unblocking revert at https://crrev.com/c/4295184
>
> Original change's description:
> > Reland "Consolidate iframe & object resource timing code paths"
> >
> > This is a reland of commit 5dcb6f7b01d5f51144a9ba847c34bb0cdc344ccb
> >
> > (Reland change: initializing
> > WebNavigationTimings::parent_resource_timing_access, caught by MSAN)
> > Original change's description:
> > > Consolidate iframe & object resource timing code paths
> > >
> > > So far some of the logic in resource timing for subframe navigations
> > > iframe/object/embed) was duplicated, e.g. both in blink and in content.
> > >
> > > This has led to race conditions, inconsistencies and sometimes
> > > XSS leaks.
> > >
> > > This patch attempts to improve the situation by consolidating the code
> > > paths:
> > >
> > > - NavigationRequest receives is_container_initiated, which ensures only
> > > container-initiated navigations are reported to the parent. This
> > > is a clarification of something that was ambiguous in the spec
> > > previously (https://github.com/whatwg/html/issues/8846).
> > > It later uses ParentResourceTimingAccess to decide if a navigation
> > > should report to its parent with/without response details
> > > (status code and mime-type), or not report at all (TAO-fail, not
> > > an iframe, not container-initiated).
> > >
> > > - Both object fallbacks and cancelled navigations (204/205) report
> > > to the parent via RenderFrameImpl, and blink converts that to a
> > > ResourceTimingInfo object. This allows us to remove the duplicated
> > > resource timing creation code in //content.
> > >
> > > - We report fallback resource timing also for plugin error events and
> > > not only for load events.
> > >
> > > Bug: 1399862
> > > Bug: 1410705
> > > Change-Id: Id37d23cd02eee9e38f812e6f3da99caedafdee3d
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4214695
> > > Reviewed-by: Takashi Toyoshima <[email protected]>
> > > Reviewed-by: Daniel Cheng <[email protected]>
> > > Reviewed-by: Arthur Sonzogni <[email protected]>
> > > Commit-Queue: Noam Rosenthal <[email protected]>
> > > Cr-Commit-Position: refs/heads/main@{#1110433}
> >
> > Bug: 1399862
> > Bug: 1410705
> > Change-Id: Ica01bcc861ffd60909e9adad79ef2f71ab23f98e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4296794
> > Reviewed-by: Arthur Sonzogni <[email protected]>
> > Reviewed-by: Takashi Toyoshima <[email protected]>
> > Commit-Queue: Noam Rosenthal <[email protected]>
> > Reviewed-by: Yoav Weiss <[email protected]>
> > Reviewed-by: Daniel Cheng <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#1110858}
>
> Bug: 1399862
> Bug: 1410705
> Change-Id: I35e3a03d38be4d2cc42d18ee0ed0296b978da090
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4299069
> Auto-Submit: Sergey Poromov <[email protected]>
> Reviewed-by: Sergey Poromov <[email protected]>
> Owners-Override: Sergey Poromov <[email protected]>
> Bot-Commit: Rubber Stamper <[email protected]>
> Commit-Queue: Sergey Poromov <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1111499}
Bug: 1399862
Bug: 1410705
Change-Id: I3458949b0632b266e24a000a10f864189fd8d1db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4299070
Auto-Submit: Sergey Poromov <[email protected]>
Owners-Override: Sergey Poromov <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Commit-Queue: Sergey Poromov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1111522}
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index 358540b..b74775eb 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -2692,7 +2692,8 @@
base::TimeTicks navigation_start_time,
bool is_embedder_initiated_fenced_frame_navigation,
bool is_unfenced_top_navigation,
- bool force_new_browsing_instance) {
+ bool force_new_browsing_instance,
+ bool is_container_initiated) {
if (is_renderer_initiated)
DCHECK(initiator_origin.has_value());
@@ -2817,7 +2818,7 @@
false /* has_user_gesture */, std::move(source_location),
ReloadType::NONE, entry.get(), frame_entry.get(),
navigation_start_time, is_embedder_initiated_fenced_frame_navigation,
- is_unfenced_top_navigation);
+ is_unfenced_top_navigation, is_container_initiated);
if (!request)
return;
@@ -3760,7 +3761,8 @@
FrameNavigationEntry* frame_entry,
base::TimeTicks navigation_start_time,
bool is_embedder_initiated_fenced_frame_navigation,
- bool is_unfenced_top_navigation) {
+ bool is_unfenced_top_navigation,
+ bool is_container_initiated) {
DCHECK_EQ(-1, GetIndexOfEntry(entry));
DCHECK(frame_entry);
// All renderer-initiated navigations must have an initiator_origin.
@@ -3931,7 +3933,8 @@
params.is_form_submission,
params.navigation_ui_data ? params.navigation_ui_data->Clone() : nullptr,
params.impression, params.initiator_activation_and_ad_status,
- params.is_pdf, is_embedder_initiated_fenced_frame_navigation);
+ params.is_pdf, is_embedder_initiated_fenced_frame_navigation,
+ is_container_initiated);
navigation_request->set_from_download_cross_origin_redirect(
params.from_download_cross_origin_redirect);
navigation_request->set_force_new_browsing_instance(