Chromium Code Reviews| Index: content/renderer/v8_heap_statistics_collector_impl.h |
| diff --git a/content/renderer/v8_heap_statistics_collector_impl.h b/content/renderer/v8_heap_statistics_collector_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ddf7083d0b4de71580fb88c7ba4f8988ce54eebe |
| --- /dev/null |
| +++ b/content/renderer/v8_heap_statistics_collector_impl.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2014 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_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ |
| +#define CONTENT_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/task_runner.h" |
| +#include "content/public/renderer/v8_heap_statistics_collector.h" |
| + |
| +namespace content { |
| + |
| +class V8HeapStatisticsCollectorImpl : public V8HeapStatisticsCollector { |
| + public: |
| + V8HeapStatisticsCollectorImpl(); |
| + static V8HeapStatisticsCollector* Instance(); |
|
jochen (gone - plz use gerrit)
2014/07/11 09:19:41
nit. static before ctor
Dai Mikurube (NOT FULLTIME)
2014/07/17 05:21:39
Done.
|
| + |
| + // V8ValueConverter implementation. |
| + virtual bool InitiateCollection(const ResultCallback&) OVERRIDE; |
| + |
| + private: |
| + virtual ~V8HeapStatisticsCollectorImpl(); |
| + void CollectOnWorkerThread(scoped_refptr<base::TaskRunner> master, |
| + int round_id); |
| + void ReceiveStats(int round_id, size_t total_size, size_t used_size); |
| + void SendStatsToCallback(int round_id); |
| + |
| + Statistics pending_stats_; |
| + int workers_to_go_; |
| + int round_id_; |
| + scoped_ptr<ResultCallback> pending_result_callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(V8HeapStatisticsCollectorImpl); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ |