Introducing phased profiling framework.
[chromium-blink-merge.git] / chrome / browser / task_profiler / task_profiler_data_serializer.h
blob1b5c8d002bde819dbf46ac6a062f85fb6678e1cc
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_
6 #define CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_
8 #include "base/basictypes.h"
9 #include "base/process/process_handle.h"
11 namespace base {
12 class DictionaryValue;
13 class FilePath;
16 namespace tracked_objects {
17 struct ProcessDataPhaseSnapshot;
20 namespace task_profiler {
22 // This class collects task profiler data and serializes it to a file. The file
23 // format is compatible with the about:profiler UI.
24 class TaskProfilerDataSerializer {
25 public:
26 TaskProfilerDataSerializer() {}
28 // Writes the contents of |process_data_phase|, |process_id| and
29 // |process_type| into |dictionary|.
30 static void ToValue(
31 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase,
32 base::ProcessId process_id,
33 int process_type,
34 base::DictionaryValue* dictionary);
36 private:
37 DISALLOW_COPY_AND_ASSIGN(TaskProfilerDataSerializer);
40 } // namespace task_profiler
42 #endif // CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_