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" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // /data/local/chrome-trace-config.json | 63 // /data/local/chrome-trace-config.json |
64 // If this file exists, Chrome will start tracing according to the configuration | 64 // If this file exists, Chrome will start tracing according to the configuration |
65 // specified in the file, otherwise, Chrome will not start tracing. | 65 // specified in the file, otherwise, Chrome will not start tracing. |
66 class TRACING_EXPORT TraceConfigFile { | 66 class TRACING_EXPORT TraceConfigFile { |
67 public: | 67 public: |
68 static TraceConfigFile* GetInstance(); | 68 static TraceConfigFile* GetInstance(); |
69 | 69 |
70 bool IsEnabled() const; | 70 bool IsEnabled() const; |
71 base::trace_event::TraceConfig GetTraceConfig() const; | 71 base::trace_event::TraceConfig GetTraceConfig() const; |
72 int GetStartupDuration() const; | 72 int GetStartupDuration() const; |
73 #if !defined(OS_ANDROID) | 73 #if !defined(OS_ANDROID) || defined(USE_AURA) |
74 base::FilePath GetResultFile() const; | 74 base::FilePath GetResultFile() const; |
75 #endif | 75 #endif |
76 | 76 |
77 private: | 77 private: |
78 // This allows constructor and destructor to be private and usable only | 78 // This allows constructor and destructor to be private and usable only |
79 // by the Singleton class. | 79 // by the Singleton class. |
80 friend struct base::DefaultSingletonTraits<TraceConfigFile>; | 80 friend struct base::DefaultSingletonTraits<TraceConfigFile>; |
81 TraceConfigFile(); | 81 TraceConfigFile(); |
82 ~TraceConfigFile(); | 82 ~TraceConfigFile(); |
83 | 83 |
84 bool ParseTraceConfigFileContent(const std::string& content); | 84 bool ParseTraceConfigFileContent(const std::string& content); |
85 | 85 |
86 bool is_enabled_; | 86 bool is_enabled_; |
87 base::trace_event::TraceConfig trace_config_; | 87 base::trace_event::TraceConfig trace_config_; |
88 int startup_duration_; | 88 int startup_duration_; |
89 base::FilePath result_file_; | 89 base::FilePath result_file_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(TraceConfigFile); | 91 DISALLOW_COPY_AND_ASSIGN(TraceConfigFile); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace tracing | 94 } // namespace tracing |
95 | 95 |
96 #endif // COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ | 96 #endif // COMPONENTS_TRACING_TRACE_CONFIG_FILE_H_ |
OLD | NEW |