Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / task_profiler / task_profiler_data_serializer.h
blob47410f1eccd8897ecfbaed3c190af39918ae3654
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"
10 namespace base {
11 class DictionaryValue;
12 class FilePath;
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 {
24 public:
25 TaskProfilerDataSerializer() {}
27 // Writes the contents of |process_data| and |process_type| into |dictionary|.
28 static void ToValue(const tracked_objects::ProcessDataSnapshot& process_data,
29 int process_type,
30 base::DictionaryValue* dictionary);
32 bool WriteToFile(const base::FilePath& path);
34 private:
35 DISALLOW_COPY_AND_ASSIGN(TaskProfilerDataSerializer);
38 } // namespace task_profiler
40 #endif // CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_