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

Unified Diff: content/common/worker_use_counter.h

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: ready to review Created 3 years, 11 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/common/worker_use_counter.h
diff --git a/content/common/worker_use_counter.h b/content/common/worker_use_counter.h
new file mode 100644
index 0000000000000000000000000000000000000000..5a7894783c2916f5ea442807186a50274432085a
--- /dev/null
+++ b/content/common/worker_use_counter.h
@@ -0,0 +1,37 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_WORKER_USE_COUNTER_H_
+#define CONTENT_COMMON_WORKER_USE_COUNTER_H_
+
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "content/common/content_export.h"
+
+namespace content {
+
+// A mirror of UseCounter on WorkerGlobalScope in Blink-side.
+class CONTENT_EXPORT WorkerUseCounter {
+ public:
+ WorkerUseCounter();
+ explicit WorkerUseCounter(std::vector<char> counter);
+ ~WorkerUseCounter();
+
+ void Count(uint32_t feature);
+ bool IsCounted(uint32_t feature);
+
+ // Returns an internal bit vector that represents a use counter.
+ std::vector<char> Dump();
+
+ size_t GetNumberOfBits() const;
+
+ private:
+ std::vector<char> counter_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_WORKER_USE_COUNTER_H_

Powered by Google App Engine
This is Rietveld 408576698