| 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_
|
|
|