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 #include "components/tracing/trace_config_file.h" | 5 #include "components/tracing/trace_config_file.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 FILE_PATH_LITERAL("chrometrace.log"); | 34 FILE_PATH_LITERAL("chrometrace.log"); |
35 | 35 |
36 // String parameters that can be used to parse the trace config file content. | 36 // String parameters that can be used to parse the trace config file content. |
37 const char kTraceConfigParam[] = "trace_config"; | 37 const char kTraceConfigParam[] = "trace_config"; |
38 const char kStartupDurationParam[] = "startup_duration"; | 38 const char kStartupDurationParam[] = "startup_duration"; |
39 const char kResultFileParam[] = "result_file"; | 39 const char kResultFileParam[] = "result_file"; |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 TraceConfigFile* TraceConfigFile::GetInstance() { | 43 TraceConfigFile* TraceConfigFile::GetInstance() { |
44 return Singleton<TraceConfigFile, | 44 return base::Singleton<TraceConfigFile, |
45 DefaultSingletonTraits<TraceConfigFile>>::get(); | 45 base::DefaultSingletonTraits<TraceConfigFile>>::get(); |
46 } | 46 } |
47 | 47 |
48 TraceConfigFile::TraceConfigFile() | 48 TraceConfigFile::TraceConfigFile() |
49 : is_enabled_(false), | 49 : is_enabled_(false), |
50 trace_config_(base::trace_event::TraceConfig()), | 50 trace_config_(base::trace_event::TraceConfig()), |
51 startup_duration_(0), | 51 startup_duration_(0), |
52 result_file_(kDefaultResultFile) { | 52 result_file_(kDefaultResultFile) { |
53 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
54 base::FilePath trace_config_file(kAndroidTraceConfigFile); | 54 base::FilePath trace_config_file(kAndroidTraceConfigFile); |
55 #else | 55 #else |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 131 } |
132 | 132 |
133 #if !defined(OS_ANDROID) | 133 #if !defined(OS_ANDROID) |
134 base::FilePath TraceConfigFile::GetResultFile() const { | 134 base::FilePath TraceConfigFile::GetResultFile() const { |
135 DCHECK(IsEnabled()); | 135 DCHECK(IsEnabled()); |
136 return result_file_; | 136 return result_file_; |
137 } | 137 } |
138 #endif | 138 #endif |
139 | 139 |
140 } // namespace tracing | 140 } // namespace tracing |
OLD | NEW |