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

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

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: ready to review Created 3 years, 10 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_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index f8f95eff88a97be3d681e9a1bebfb4d35c49b5d9..d84370094e864c6f480169fb7a05c2db4fa457fe 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -466,6 +466,12 @@ class CONTENT_EXPORT ServiceWorkerVersion
// for both A and B case. So the methods and attributes are available in JS.
NavigationPreloadSupportStatus GetNavigationPreloadSupportStatus() const;
+ void CountFeature(uint32_t feature);
+ void set_used_features(std::set<uint32_t> used_features) {
+ used_features_ = used_features;
+ }
+ std::set<uint32_t> used_features() const { return used_features_; }
+
private:
friend class base::RefCounted<ServiceWorkerVersion>;
friend class ServiceWorkerMetrics;
@@ -844,6 +850,10 @@ class CONTENT_EXPORT ServiceWorkerVersion
// FinishStartWorker().
base::Optional<ServiceWorkerMetrics::EventType> start_worker_first_purpose_;
+ // This is the set of features that this worker has used. The values must be
+ // from blink::UseCounter::Feature enum.
falken 2017/02/08 05:01:53 Can we mention this is the used features that were
nhiroki 2017/02/09 05:11:32 That's correct. Updated.
+ std::set<uint32_t> used_features_;
+
base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);

Powered by Google App Engine
This is Rietveld 408576698