service worker: Add targetted UMA for ActivatedWorkerPreparationForMainFrame

Desktop / Chromium - Matt Falkenhagen [chromium.org] - 14 July 2017 00:35 EDT

This is to help track the effectiveness of warming up the service worker for search from the omnibox.

This rather unfortunately adds a public content API since all the smarts about detecting Google Search URLs are (rightly) in //chrome but we want to log the UMA in //content. I think someday a patch like https://chromium-review.googlesource.com/c/566764/ can be landed that moves the UMA entirely to //chrome.

Bug: 724337, 732681 Change-Id: I1a4671111c583a30963b5a34a1c4bc605fc07f14 Reviewed-on: https://chromium-review.googlesource.com/569550 Commit-Queue: Matt Falkenhagen

8479b20 service worker: Add targetted UMA for ActivatedWorkerPreparationForMainFrame
chrome/browser/chrome_content_browser_client.cc | 13 +++++
chrome/browser/chrome_content_browser_client.h | 1 +
.../chrome_content_browser_client_unittest.cc | 16 +++++++
.../service_worker/service_worker_metrics.cc | 43 ++++++++++++-----
.../service_worker/service_worker_metrics.h | 3 +-
.../service_worker_metrics_unittest.cc | 55 ++++++++++++++++++++--
.../service_worker_url_request_job.cc | 2 +-
content/public/browser/content_browser_client.cc | 4 ++
content/public/browser/content_browser_client.h | 7 +++
tools/metrics/histograms/histograms.xml | 2 +
10 files changed, 128 insertions(+), 18 deletions(-)

Upstream: git.chromium.org


  • Share