| Index: content/public/renderer/v8_heap_statistics_collector.h
|
| diff --git a/content/public/renderer/v8_heap_statistics_collector.h b/content/public/renderer/v8_heap_statistics_collector.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2934018c489d085b87acccf02949118a5814efb1
|
| --- /dev/null
|
| +++ b/content/public/renderer/v8_heap_statistics_collector.h
|
| @@ -0,0 +1,40 @@
|
| +// Copyright (c) 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_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_
|
| +#define CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_
|
| +
|
| +#include "base/callback.h"
|
| +#include "content/common/content_export.h"
|
| +
|
| +namespace base {
|
| +class Value;
|
| +}
|
| +
|
| +namespace content {
|
| +
|
| +// Retrieves statistics about v8, asynchronously.
|
| +class CONTENT_EXPORT V8HeapStatisticsCollector {
|
| + public:
|
| + static V8HeapStatisticsCollector* Instance();
|
| + virtual ~V8HeapStatisticsCollector() {}
|
| +
|
| + struct Statistics {
|
| + Statistics() : total_bytes(0), used_bytes(0) {}
|
| + size_t total_bytes;
|
| + size_t used_bytes;
|
| + };
|
| + typedef base::Callback<void(const Statistics&)> ResultCallback;
|
| +
|
| + // Begins collecting heap statistics. Only one collection can be pending at
|
| + // once. Returns true on success. Callback will not be called if initiation
|
| + // fails.
|
| + //
|
| + // Must be called on the RenderThread.
|
| + virtual bool InitiateCollection(const ResultCallback& callback) = 0;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_
|
|
|