Commit 52b634e1 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Revert "COOP: CreateCoopReporter unconditionally."

This reverts:
https://chromium-review.googlesource.com/c/chromium/src/+/2332265
and adds a comment.

Not creating a CrossOriginOpenerPolicyReporter prevents accesses checks
from being made, which prevents the ReportingObservers's events from
being emitted.

The current COOP specification requires not to send ReportingObserver
reports when no network endpoint are defined. The previous behavior was
unexpectedly to me correct.

Bug: 1112263
Change-Id: Id3cec5893e2952887cc86c9d1c850b7747835828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340916Reviewed-by: default avatarPâris Meuleman <pmeuleman@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795879}
parent 07a00e11
......@@ -1714,6 +1714,23 @@ void NavigationRequest::CreateCoopReporter(
return;
}
// If the main document hasn't specified any network report endpoint(s),
// then it is likely not interested in receiving:
// 1. Network reports (for obvious reasons).
// 2. ReportingObserver's reports.
// 3. Devtools warnings.
//
// Not creating a COOP reporter currently prevents all of these.
//
// TODO(arthursonzogni): Reconsider this decision later, developers might be
// interested in (2) and (3), despite not being interested in (1).
if (!render_frame_host_->cross_origin_opener_policy().reporting_endpoint &&
!render_frame_host_->cross_origin_opener_policy()
.report_only_reporting_endpoint) {
return;
}
DCHECK(IsInMainFrame());
coop_reporter_ = std::make_unique<CrossOriginOpenerPolicyReporter>(
storage_partition, frame_tree_node_->current_frame_host(),
common_params_->url, render_frame_host_->cross_origin_opener_policy());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment