Commit dacfc31c authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Clear up usage of Frame::IsAdRoot()

IsAdRoot() implies IsAdSubframe(). However, some callers check whether
IsAdRoot() || IsAdSubframe(). This cl removes these redundant checks and
adds documentation to the methods to clarify their meaning.

Change-Id: I62a437dead30141854351f3c9e7aecf9ecceec75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550429Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829675}
parent a1afbc0c
......@@ -210,8 +210,11 @@ class CORE_EXPORT Frame : public GarbageCollected<Frame> {
return lifecycle_.GetState() == FrameLifecycle::kAttached;
}
// Ad Tagging
// Whether the frame is considered to be an ad subframe by Ad Tagging. Returns
// true for both root and child ad subframes.
bool IsAdSubframe() const;
// Whether the frame is considered to be a root ad subframe by Ad Tagging.
bool IsAdRoot() const;
// Called to make a frame inert or non-inert. A frame is inert when there
......
......@@ -1431,9 +1431,9 @@ void DocumentLoader::DidCommitNavigation() {
// Report legacy TLS versions after Page::DidCommitLoad, because the latter
// clears the console.
if (response_.IsLegacyTLSVersion()) {
GetFrameLoader().ReportLegacyTLSVersion(
response_.CurrentRequestUrl(), false /* is_subresource */,
frame_->IsAdSubframe() || frame_->IsAdRoot());
GetFrameLoader().ReportLegacyTLSVersion(response_.CurrentRequestUrl(),
false /* is_subresource */,
frame_->IsAdSubframe());
}
}
......
......@@ -152,8 +152,7 @@ void ReportMetrics(ExecutionContext* execution_context,
ukm::builders::Media_EME_CreateMediaKeys builder(document->UkmSourceID());
builder.SetKeySystem(KeySystemForUkm::kWidevine);
builder.SetIsAdFrame(
static_cast<int>(frame->IsAdRoot() || frame->IsAdSubframe()));
builder.SetIsAdFrame(static_cast<int>(frame->IsAdSubframe()));
builder.SetIsCrossOrigin(static_cast<int>(frame->IsCrossOriginToMainFrame()));
builder.SetIsTopFrame(static_cast<int>(frame->IsMainFrame()));
builder.Record(document->UkmRecorder());
......
......@@ -219,8 +219,7 @@ void MediaKeySystemAccessInitializerBase::GenerateWarningAndReportMetrics()
ukm::builders::Media_EME_RequestMediaKeySystemAccess builder(
DomWindow()->UkmSourceID());
builder.SetKeySystem(KeySystemForUkm::kWidevine);
builder.SetIsAdFrame(
static_cast<int>(frame->IsAdRoot() || frame->IsAdSubframe()));
builder.SetIsAdFrame(static_cast<int>(frame->IsAdSubframe()));
builder.SetIsCrossOrigin(static_cast<int>(frame->IsCrossOriginToMainFrame()));
builder.SetIsTopFrame(static_cast<int>(frame->IsMainFrame()));
builder.SetVideoCapabilities(static_cast<int>(has_video_capabilities));
......
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