OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 | 1225 |
1226 std::string delay_str = command_line.GetSwitchValueASCII( | 1226 std::string delay_str = command_line.GetSwitchValueASCII( |
1227 switches::kTraceStartupDuration); | 1227 switches::kTraceStartupDuration); |
1228 int delay_secs = 5; | 1228 int delay_secs = 5; |
1229 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) { | 1229 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) { |
1230 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration | 1230 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration |
1231 << "=" << delay_str << " defaulting to 5 (secs)"; | 1231 << "=" << delay_str << " defaulting to 5 (secs)"; |
1232 delay_secs = 5; | 1232 delay_secs = 5; |
1233 } | 1233 } |
1234 | 1234 |
| 1235 #if defined(OS_ANDROID) |
| 1236 TracingControllerAndroid::SetupEarlyJavaTracing(); |
| 1237 #endif |
| 1238 |
1235 startup_trace_timer_.Start(FROM_HERE, | 1239 startup_trace_timer_.Start(FROM_HERE, |
1236 base::TimeDelta::FromSeconds(delay_secs), | 1240 base::TimeDelta::FromSeconds(delay_secs), |
1237 this, | 1241 this, |
1238 &BrowserMainLoop::EndStartupTracing); | 1242 &BrowserMainLoop::EndStartupTracing); |
1239 } | 1243 } |
1240 | 1244 |
1241 void BrowserMainLoop::EndStartupTracing() { | 1245 void BrowserMainLoop::EndStartupTracing() { |
1242 is_tracing_startup_ = false; | 1246 is_tracing_startup_ = false; |
| 1247 |
1243 TracingController::GetInstance()->DisableRecording( | 1248 TracingController::GetInstance()->DisableRecording( |
1244 TracingController::CreateFileSink( | 1249 TracingController::CreateFileSink( |
1245 startup_trace_file_, | 1250 startup_trace_file_, |
1246 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1251 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1247 } | 1252 } |
1248 | 1253 |
1249 } // namespace content | 1254 } // namespace content |
OLD | NEW |