Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_ | |
| 6 #define CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "content/common/content_export.h" | |
| 10 | |
| 11 namespace base { | |
| 12 class Value; | |
| 13 } | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 // Retrievs statistics about v8, asynchronously. | |
| 18 class CONTENT_EXPORT V8HeapStatisticsCollector { | |
| 19 public: | |
| 20 static V8HeapStatisticsCollector* Instance(); | |
| 21 | |
| 22 struct Statistics { | |
| 23 Statistics() : total_bytes(0), used_bytes(0) {} | |
| 24 size_t total_bytes; | |
| 25 size_t used_bytes; | |
| 26 }; | |
| 27 typedef base::Callback<void(const Statistics&)> ResultCallback; | |
| 28 | |
| 29 // Begins collecting heap statistics. Only one collection can be pending at | |
| 30 // once. Returns true on success. Callback will not be called if initiation | |
| 31 // fails. | |
| 32 // | |
| 33 // Must be called on the RenderThread. | |
| 34 virtual bool InitiateCollection(const ResultCallback& callback) = 0; | |
| 35 | |
| 36 protected: | |
| 37 V8HeapStatisticsCollector() {} | |
| 38 virtual ~V8HeapStatisticsCollector() {} | |
| 39 }; | |
| 40 | |
| 41 } // namespace content | |
| 42 | |
| 43 #endif // CONTENT_PUBLIC_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_H_ | |
| OLD | NEW |