Index: content/browser/service_worker/service_worker_version.cc |
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc |
index 6170731e33d4d0923c154d7d6fa641b6d1f14109..a2e61492b8064090da209018f59626daaf254036 100644 |
--- a/content/browser/service_worker/service_worker_version.cc |
+++ b/content/browser/service_worker/service_worker_version.cc |
@@ -305,11 +305,12 @@ ServiceWorkerVersion::ServiceWorkerVersion( |
registration_id_(registration->id()), |
script_url_(script_url), |
scope_(registration->pattern()), |
+ site_for_uma_(ServiceWorkerMetrics::SiteFromURL(scope_, base::nullopt)), |
context_(context), |
script_cache_map_(this, context), |
ping_controller_(new PingController(this)), |
should_exclude_from_uma_( |
- ServiceWorkerMetrics::ShouldExcludeURLFromHistogram(scope_)), |
+ ServiceWorkerMetrics::ShouldExcludeSiteFromHistogram(site_for_uma_)), |
weak_factory_(this) { |
DCHECK_NE(kInvalidServiceWorkerVersionId, version_id); |
DCHECK(context_); |
@@ -409,6 +410,17 @@ ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { |
return info; |
} |
+void ServiceWorkerVersion::set_has_fetch_handler(bool has_fetch_handler) { |
+ DCHECK(!has_fetch_handler_); |
+ has_fetch_handler_ = has_fetch_handler; |
+ if (site_for_uma_ != ServiceWorkerMetrics::Site::OTHER) |
shimazu
2016/08/18 06:53:24
How about using SiteFromURL for keeping consistenc
horo
2016/08/21 08:39:58
I removed FetchHandlerExistence from the arguments
shimazu
2016/08/22 02:48:02
Sure.
|
+ return; |
+ if (has_fetch_handler) |
+ site_for_uma_ = ServiceWorkerMetrics::Site::WITH_FETCH_HANDLER; |
+ else |
+ site_for_uma_ = ServiceWorkerMetrics::Site::WITHOUT_FETCH_HANDLER; |
+} |
+ |
void ServiceWorkerVersion::StartWorker(ServiceWorkerMetrics::EventType purpose, |
const StatusCallback& callback) { |
TRACE_EVENT_INSTANT2( |