OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ | 5 #ifndef CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ |
6 #define CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ | 6 #define CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 class DictionaryValue; | 11 class DictionaryValue; |
12 class FilePath; | 12 class FilePath; |
13 } | 13 } |
14 | 14 |
15 namespace tracked_objects { | 15 namespace tracked_objects { |
16 struct ProcessDataSnapshot; | 16 struct ProcessDataPhaseSnapshot; |
17 } | 17 } |
18 | 18 |
19 namespace task_profiler { | 19 namespace task_profiler { |
20 | 20 |
21 // This class collects task profiler data and serializes it to a file. The file | 21 // This class collects task profiler data and serializes it to a file. The file |
22 // format is compatible with the about:profiler UI. | 22 // format is compatible with the about:profiler UI. |
23 class TaskProfilerDataSerializer { | 23 class TaskProfilerDataSerializer { |
24 public: | 24 public: |
25 TaskProfilerDataSerializer() {} | 25 TaskProfilerDataSerializer() {} |
26 | 26 |
27 // Writes the contents of |process_data| and |process_type| into |dictionary|. | 27 // Writes the contents of |process_data_phase|, |int process_id| and |
28 static void ToValue(const tracked_objects::ProcessDataSnapshot& process_data, | 28 // |process_type| into |dictionary|. |
29 int process_type, | 29 static void ToValue( |
30 base::DictionaryValue* dictionary); | 30 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, |
| 31 int process_id, |
| 32 int process_type, |
| 33 base::DictionaryValue* dictionary); |
31 | 34 |
32 private: | 35 private: |
33 DISALLOW_COPY_AND_ASSIGN(TaskProfilerDataSerializer); | 36 DISALLOW_COPY_AND_ASSIGN(TaskProfilerDataSerializer); |
34 }; | 37 }; |
35 | 38 |
36 } // namespace task_profiler | 39 } // namespace task_profiler |
37 | 40 |
38 #endif // CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ | 41 #endif // CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ |
OLD | NEW |