| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ | 5 #ifndef COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ |
| 6 #define COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ | 6 #define COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/trace_event/trace_config.h" | 10 #include "base/trace_event/trace_config.h" |
| 11 #include "components/tracing/tracing_export.h" | 11 #include "components/tracing/tracing_export.h" |
| 12 | 12 |
| 13 namespace base { |
| 13 template <typename Type> struct DefaultSingletonTraits; | 14 template <typename Type> struct DefaultSingletonTraits; |
| 15 } // namespace base |
| 14 | 16 |
| 15 namespace tracing { | 17 namespace tracing { |
| 16 | 18 |
| 17 // TraceConfigFile is a singleton that contains the configurations of tracing. | 19 // TraceConfigFile is a singleton that contains the configurations of tracing. |
| 18 // One can create a trace config file and use it to configure startup and/or | 20 // One can create a trace config file and use it to configure startup and/or |
| 19 // shutdown tracing. | 21 // shutdown tracing. |
| 20 // | 22 // |
| 21 // The trace config file should be JSON formated. One example is: | 23 // The trace config file should be JSON formated. One example is: |
| 22 // { | 24 // { |
| 23 // "trace_config": { | 25 // "trace_config": { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool IsEnabled() const; | 70 bool IsEnabled() const; |
| 69 base::trace_event::TraceConfig GetTraceConfig() const; | 71 base::trace_event::TraceConfig GetTraceConfig() const; |
| 70 int GetStartupDuration() const; | 72 int GetStartupDuration() const; |
| 71 #if !defined(OS_ANDROID) | 73 #if !defined(OS_ANDROID) |
| 72 base::FilePath GetResultFile() const; | 74 base::FilePath GetResultFile() const; |
| 73 #endif | 75 #endif |
| 74 | 76 |
| 75 private: | 77 private: |
| 76 // This allows constructor and destructor to be private and usable only | 78 // This allows constructor and destructor to be private and usable only |
| 77 // by the Singleton class. | 79 // by the Singleton class. |
| 78 friend struct DefaultSingletonTraits<TraceConfigFile>; | 80 friend struct base::DefaultSingletonTraits<TraceConfigFile>; |
| 79 TraceConfigFile(); | 81 TraceConfigFile(); |
| 80 ~TraceConfigFile(); | 82 ~TraceConfigFile(); |
| 81 | 83 |
| 82 bool ParseTraceConfigFileContent(std::string content); | 84 bool ParseTraceConfigFileContent(std::string content); |
| 83 | 85 |
| 84 bool is_enabled_; | 86 bool is_enabled_; |
| 85 base::trace_event::TraceConfig trace_config_; | 87 base::trace_event::TraceConfig trace_config_; |
| 86 int startup_duration_; | 88 int startup_duration_; |
| 87 base::FilePath result_file_; | 89 base::FilePath result_file_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(TraceConfigFile); | 91 DISALLOW_COPY_AND_ASSIGN(TraceConfigFile); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 } // namespace tracing | 94 } // namespace tracing |
| 93 | 95 |
| 94 #endif // COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ | 96 #endif // COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ |
| OLD | NEW |