Chromium Code Reviews| 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..45b0ae6329aff5078366497edb9194a98e147320 |
| --- /dev/null |
| +++ b/content/public/renderer/v8_heap_statistics_collector.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
fmeawad
2014/07/10 18:22:23
2014?
Dai Mikurube (NOT FULLTIME)
2014/07/11 04:34:38
Done.
|
| +// 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 { |
| + |
| +// Retrievs statistics about v8, asynchronously. |
| +class CONTENT_EXPORT V8HeapStatisticsCollector { |
| + public: |
| + static V8HeapStatisticsCollector* Instance(); |
| + |
| + 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; |
| + |
| + protected: |
| + V8HeapStatisticsCollector() {} |
| + virtual ~V8HeapStatisticsCollector() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_ |