Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 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_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ | |
| 6 #define CONTENT_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/task_runner.h" | |
| 10 #include "content/public/renderer/v8_heap_statistics_collector.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 class V8HeapStatisticsCollectorImpl : public V8HeapStatisticsCollector { | |
| 15 public: | |
| 16 V8HeapStatisticsCollectorImpl(); | |
| 17 static V8HeapStatisticsCollector* Instance(); | |
|
jochen (gone - plz use gerrit)
2014/07/11 09:19:41
nit. static before ctor
Dai Mikurube (NOT FULLTIME)
2014/07/17 05:21:39
Done.
| |
| 18 | |
| 19 // V8ValueConverter implementation. | |
| 20 virtual bool InitiateCollection(const ResultCallback&) OVERRIDE; | |
| 21 | |
| 22 private: | |
| 23 virtual ~V8HeapStatisticsCollectorImpl(); | |
| 24 void CollectOnWorkerThread(scoped_refptr<base::TaskRunner> master, | |
| 25 int round_id); | |
| 26 void ReceiveStats(int round_id, size_t total_size, size_t used_size); | |
| 27 void SendStatsToCallback(int round_id); | |
| 28 | |
| 29 Statistics pending_stats_; | |
| 30 int workers_to_go_; | |
| 31 int round_id_; | |
| 32 scoped_ptr<ResultCallback> pending_result_callback_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(V8HeapStatisticsCollectorImpl); | |
| 35 }; | |
| 36 | |
| 37 } // namespace content | |
| 38 | |
| 39 #endif // CONTENT_RENDERER_V8_HEAP_STATISTICS_COLLECTOR_IMPL_H_ | |
| OLD | NEW |