Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: content/browser/service_worker/service_worker_metrics.h

Issue 2250623003: Keep ServiceWorkerMetrics::Site in ServiceWorkerVersion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: diff from https://codereview.chromium.org/2251633002/#ps40001 Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_metrics.h
diff --git a/content/browser/service_worker/service_worker_metrics.h b/content/browser/service_worker/service_worker_metrics.h
index 11522bd3324e680dff54bd659127ec6f12402fed..5120d8d774c44aec48105b07f41d1f76820230d1 100644
--- a/content/browser/service_worker/service_worker_metrics.h
+++ b/content/browser/service_worker/service_worker_metrics.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include "base/macros.h"
+#include "base/optional.h"
#include "content/browser/service_worker/service_worker_database.h"
#include "content/common/service_worker/service_worker_types.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponseError.h"
@@ -136,6 +137,12 @@ class ServiceWorkerMetrics {
// Converts an event type to a string. Used for tracing.
static const char* EventTypeToString(EventType event_type);
+ // Returns Site for the |url|. When the |url| is not a NPT site, if
+ // |has_fetch_handler| is not set it returns OTHER, othewise returns
+ // WITH_FETCH_HANDLER or WITHOUT_FETCH_HANDLER depending on the bool value.
+ static Site SiteFromURL(const GURL& url,
+ base::Optional<bool> has_fetch_handler);
+
// Returns true when the event is for a navigation hint.
static bool IsNavigationHintEvent(EventType event_type);
@@ -143,7 +150,6 @@ class ServiceWorkerMetrics {
// makes the results largely skewed. Some metrics don't follow this policy
// and hence don't call this function.
static bool ShouldExcludeSiteFromHistogram(Site site);
- static bool ShouldExcludeURLFromHistogram(const GURL& url);
// Used for ServiceWorkerDiskCache.
static void CountInitDiskCacheResult(bool result);
@@ -161,8 +167,8 @@ class ServiceWorkerMetrics {
static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result);
// Counts the number of page loads controlled by a Service Worker.
- static void CountControlledPageLoad(const GURL& url,
- bool has_fetch_handler,
+ static void CountControlledPageLoad(Site site,
+ const GURL& url,
bool is_main_frame_load);
// Records the result of trying to start a worker. |is_installed| indicates

Powered by Google App Engine
This is Rietveld 408576698