Skip to content

Commit

Permalink
Split Empty URL to a seperate Dropped Reason
Browse files Browse the repository at this point in the history
Bug: 842012
Change-Id: Ifc35114d2f1a4b6045e97aa45c1c56ed96abae19
Reviewed-on: https://chromium-review.googlesource.com/1055936
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559312}
  • Loading branch information
holte authored and Commit Bot committed May 16, 2018
1 parent 2e66dc7 commit bda6893
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/ukm/ukm_recorder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ enum class DroppedDataReason {
EXTENSION_URLS_DISABLED = 6,
EXTENSION_NOT_SYNCED = 7,
NOT_MATCHED = 8,
EMPTY_URL = 9,
NUM_DROPPED_DATA_REASONS
};

Expand Down Expand Up @@ -342,6 +343,11 @@ void UkmRecorderImpl::UpdateSourceURL(SourceId source_id,
return;
}

if (unsanitized_url.is_empty()) {
RecordDroppedSource(DroppedDataReason::EMPTY_URL);
return;
}

source_counts_.observed++;
if (GetSourceIdType(source_id) == SourceIdType::NAVIGATION_ID)
source_counts_.navigation_sources++;
Expand All @@ -350,6 +356,8 @@ void UkmRecorderImpl::UpdateSourceURL(SourceId source_id,

if (!HasSupportedScheme(url)) {
RecordDroppedSource(DroppedDataReason::UNSUPPORTED_URL_SCHEME);
DVLOG(2) << "Dropped Unsupported UKM URL:" << source_id << ":"
<< url.spec();
return;
}

Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45495,6 +45495,7 @@ Full version information for the fingerprint enum values:
<int value="6" label="Extension URLs disabled"/>
<int value="7" label="Extension not synced"/>
<int value="8" label="Not matched"/>
<int value="9" label="Empty URL"/>
</enum>

<enum name="UkmSyncDisableInfo">
Expand Down

0 comments on commit bda6893

Please sign in to comment.