Commit 0e7f9e80 authored by gab's avatar gab Committed by Commit bot

Remove handling of invalid but non-empty main_frame_url.

It has been proven (via a live UMA experiment under "SBOffDomainInclusion.InvalidMainFrameURL")
to never happen in off-domain inclusion analysis.

BUG=412468

Review URL: https://codereview.chromium.org/789613008

Cr-Commit-Position: refs/heads/master@{#313915}
parent c8d4343f
...@@ -169,20 +169,14 @@ void OffDomainInclusionDetector::BeginAnalysis( ...@@ -169,20 +169,14 @@ void OffDomainInclusionDetector::BeginAnalysis(
DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
if (!off_domain_inclusion_info->main_frame_url.is_valid()) { if (!off_domain_inclusion_info->main_frame_url.is_valid()) {
if (off_domain_inclusion_info->main_frame_url.is_empty()) { // A live experiment confirmed that the only reason the |main_frame_url|
// This can happen in a few scenarios where the referrer is dropped (e.g., // would be invalid is if it's empty. The |main_frame_url| can be empty in
// HTTPS => HTTP requests). Consider adding the original referrer to // a few scenarios where the referrer is dropped (e.g., HTTPS => HTTP
// ResourceRequestInfo if that's an issue. // requests). Consider adding the original referrer to ResourceRequestInfo
ReportAnalysisResult(off_domain_inclusion_info.Pass(), // if that's an issue.
AnalysisEvent::ABORT_EMPTY_MAIN_FRAME_URL); DCHECK(off_domain_inclusion_info->main_frame_url.is_empty());
} else { ReportAnalysisResult(off_domain_inclusion_info.Pass(),
// There is no reason for the main frame to start loading resources if its AnalysisEvent::ABORT_EMPTY_MAIN_FRAME_URL);
// own URL is invalid but measure this in the wild to make sure.
// TODO(gab): UMA has proven that this never happens, remove this in a
// follow-up CL.
ReportAnalysisResult(off_domain_inclusion_info.Pass(),
AnalysisEvent::ABORT_INVALID_MAIN_FRAME_URL);
}
return; return;
} }
...@@ -306,9 +300,6 @@ void OffDomainInclusionDetector::ReportAnalysisResult( ...@@ -306,9 +300,6 @@ void OffDomainInclusionDetector::ReportAnalysisResult(
case AnalysisEvent::ABORT_EMPTY_MAIN_FRAME_URL: case AnalysisEvent::ABORT_EMPTY_MAIN_FRAME_URL:
histogram_name = "SBOffDomainInclusion.Abort.EmptyMainFrameURL"; histogram_name = "SBOffDomainInclusion.Abort.EmptyMainFrameURL";
break; break;
case AnalysisEvent::ABORT_INVALID_MAIN_FRAME_URL:
// TODO(gab): This never occurs in practice, remove the code handling it.
break;
case AnalysisEvent::ABORT_NO_PROFILE: case AnalysisEvent::ABORT_NO_PROFILE:
histogram_name = "SBOffDomainInclusion.Abort.NoProfile"; histogram_name = "SBOffDomainInclusion.Abort.NoProfile";
break; break;
......
...@@ -32,7 +32,6 @@ class OffDomainInclusionDetector { ...@@ -32,7 +32,6 @@ class OffDomainInclusionDetector {
enum class AnalysisEvent { enum class AnalysisEvent {
NO_EVENT, NO_EVENT,
ABORT_EMPTY_MAIN_FRAME_URL, ABORT_EMPTY_MAIN_FRAME_URL,
ABORT_INVALID_MAIN_FRAME_URL,
ABORT_NO_PROFILE, ABORT_NO_PROFILE,
ABORT_INCOGNITO, ABORT_INCOGNITO,
ABORT_NO_HISTORY_SERVICE, ABORT_NO_HISTORY_SERVICE,
......
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