Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Unified Diff: content/renderer/v8_heap_statistics_collector_impl.h

Issue 196103006: Add V8 heap statistics in a time-line manner in tracing. (Closed) Base URL: /home/dmikurube/repos/chromium@work-sai-json
Patch Set: addressed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/renderer/v8_heap_statistics_collector_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/renderer/v8_heap_statistics_collector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698