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"
11 class DictionaryValue;
15 namespace tracked_objects {
16 struct ProcessDataSnapshot;
19 namespace task_profiler {
21 // This class collects task profiler data and serializes it to a file. The file
22 // format is compatible with the about:profiler UI.
23 class TaskProfilerDataSerializer {
25 TaskProfilerDataSerializer() {}
27 // Writes the contents of |process_data| and |process_type| into |dictionary|.
28 static void ToValue(const tracked_objects::ProcessDataSnapshot& process_data,
30 base::DictionaryValue* dictionary);
32 bool WriteToFile(const base::FilePath& path);
35 DISALLOW_COPY_AND_ASSIGN(TaskProfilerDataSerializer);
38 } // namespace task_profiler
40 #endif // CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_