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

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: rebased 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
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..a7abe782400bf315351228390b0514c037f5777e
--- /dev/null
+++ b/content/renderer/v8_heap_statistics_collector_impl.h
@@ -0,0 +1,39 @@
+// Copyright 2013 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_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:
+ V8HeapStatisticsCollectorImpl();
+ static V8HeapStatisticsCollector* Instance();
+
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698