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

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

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: int32_t -> uint32_t 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..d7540cd9cb1101a5e2088f106e440d558b35e618 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(const std::set<uint32_t>& used_features) {
+ used_features_ = used_features;
+ }
+ const std::set<uint32_t>& used_features() const { return used_features_; }
+
private:
friend class base::RefCounted<ServiceWorkerVersion>;
friend class ServiceWorkerMetrics;
@@ -844,6 +850,11 @@ class CONTENT_EXPORT ServiceWorkerVersion
// FinishStartWorker().
base::Optional<ServiceWorkerMetrics::EventType> start_worker_first_purpose_;
+ // This is the set of features that were used up until installation of this
+ // version completed, or used during the lifetime of |this|. The values must
+ // be from blink::UseCounter::Feature enum.
+ 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