| 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..2f250f51e038717b13b9cf54ac0ad047a7d2eb9e
|
| --- /dev/null
|
| +++ b/content/renderer/v8_heap_statistics_collector_impl.h
|
| @@ -0,0 +1,40 @@
|
| +// 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:
|
| + static V8HeapStatisticsCollector* Instance();
|
| +
|
| + V8HeapStatisticsCollectorImpl();
|
| +
|
| + // 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_
|
|
|