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..57c4d0aed4857a32d22bda177dccaddac70eecb6 |
--- /dev/null |
+++ b/content/public/renderer/v8_heap_statistics_collector.h |
@@ -0,0 +1,43 @@ |
+// 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 { |
+ |
+// 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: |
jochen (gone - plz use gerrit)
2014/07/11 09:19:41
you don't need to make those protected, since you
Dai Mikurube (NOT FULLTIME)
2014/07/17 05:21:39
Done.
|
+ V8HeapStatisticsCollector() {} |
+ virtual ~V8HeapStatisticsCollector() {} |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_ |