Commit 5afcfd99 authored by Bryan McQuade's avatar Bryan McQuade Committed by Commit Bot

Move shouldGetPageLoadMetrics to notifyPageLoadMetrics.

This ensures that the shouldGetPageLoadMetrics policy is applied
consistently to all page load metrics, as some invoke
notifyPageLoadMetrics directly, bypassing the check that was
previously in notifySinglePageLoadMetric.

Change-Id: Iecc8f88ae9a5062894513d89483238a52d8c3f5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773888Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Commit-Queue: Bryan McQuade <bmcquade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692308}
parent e7621906
...@@ -1155,7 +1155,6 @@ public class CustomTabsConnection { ...@@ -1155,7 +1155,6 @@ public class CustomTabsConnection {
*/ */
boolean notifySinglePageLoadMetric(CustomTabsSessionToken session, String metricName, boolean notifySinglePageLoadMetric(CustomTabsSessionToken session, String metricName,
long navigationStartTick, long offsetMs) { long navigationStartTick, long offsetMs) {
if (!mClientManager.shouldGetPageLoadMetrics(session)) return false;
if (!mNativeTickOffsetUsComputed) { if (!mNativeTickOffsetUsComputed) {
// Compute offset from time ticks to uptimeMillis. // Compute offset from time ticks to uptimeMillis.
mNativeTickOffsetUsComputed = true; mNativeTickOffsetUsComputed = true;
...@@ -1186,6 +1185,7 @@ public class CustomTabsConnection { ...@@ -1186,6 +1185,7 @@ public class CustomTabsConnection {
* should be a key specifying the metric name and the metric value as the value. * should be a key specifying the metric name and the metric value as the value.
*/ */
boolean notifyPageLoadMetrics(CustomTabsSessionToken session, Bundle args) { boolean notifyPageLoadMetrics(CustomTabsSessionToken session, Bundle args) {
if (!mClientManager.shouldGetPageLoadMetrics(session)) return false;
if (safeExtraCallback(session, PAGE_LOAD_METRICS_CALLBACK, args)) { if (safeExtraCallback(session, PAGE_LOAD_METRICS_CALLBACK, args)) {
logPageLoadMetricsCallback(args); logPageLoadMetricsCallback(args);
return true; return true;
......
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