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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 | 1259 |
1260 std::string delay_str = command_line.GetSwitchValueASCII( | 1260 std::string delay_str = command_line.GetSwitchValueASCII( |
1261 switches::kTraceStartupDuration); | 1261 switches::kTraceStartupDuration); |
1262 int delay_secs = 5; | 1262 int delay_secs = 5; |
1263 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) { | 1263 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) { |
1264 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration | 1264 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration |
1265 << "=" << delay_str << " defaulting to 5 (secs)"; | 1265 << "=" << delay_str << " defaulting to 5 (secs)"; |
1266 delay_secs = 5; | 1266 delay_secs = 5; |
1267 } | 1267 } |
1268 | 1268 |
| 1269 #if defined(OS_ANDROID) |
| 1270 TracingControllerAndroid::SetupEarlyJavaTracing(); |
| 1271 #endif |
| 1272 |
1269 startup_trace_timer_.Start(FROM_HERE, | 1273 startup_trace_timer_.Start(FROM_HERE, |
1270 base::TimeDelta::FromSeconds(delay_secs), | 1274 base::TimeDelta::FromSeconds(delay_secs), |
1271 this, | 1275 this, |
1272 &BrowserMainLoop::EndStartupTracing); | 1276 &BrowserMainLoop::EndStartupTracing); |
1273 } | 1277 } |
1274 | 1278 |
1275 void BrowserMainLoop::EndStartupTracing() { | 1279 void BrowserMainLoop::EndStartupTracing() { |
1276 is_tracing_startup_ = false; | 1280 is_tracing_startup_ = false; |
| 1281 |
1277 TracingController::GetInstance()->DisableRecording( | 1282 TracingController::GetInstance()->DisableRecording( |
1278 TracingController::CreateFileSink( | 1283 TracingController::CreateFileSink( |
1279 startup_trace_file_, | 1284 startup_trace_file_, |
1280 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1285 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1281 } | 1286 } |
1282 | 1287 |
1283 } // namespace content | 1288 } // namespace content |
OLD | NEW |