Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 874543003: Add support for TraceEvent before the native library is loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 1255
1256 std::string delay_str = command_line.GetSwitchValueASCII( 1256 std::string delay_str = command_line.GetSwitchValueASCII(
1257 switches::kTraceStartupDuration); 1257 switches::kTraceStartupDuration);
1258 int delay_secs = 5; 1258 int delay_secs = 5;
1259 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) { 1259 if (!delay_str.empty() && !base::StringToInt(delay_str, &delay_secs)) {
1260 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration 1260 DLOG(WARNING) << "Could not parse --" << switches::kTraceStartupDuration
1261 << "=" << delay_str << " defaulting to 5 (secs)"; 1261 << "=" << delay_str << " defaulting to 5 (secs)";
1262 delay_secs = 5; 1262 delay_secs = 5;
1263 } 1263 }
1264 1264
1265 #if defined(OS_ANDROID)
1266 TracingControllerAndroid::SetupEarlyJavaTracing();
1267 #endif
1268
1265 startup_trace_timer_.Start(FROM_HERE, 1269 startup_trace_timer_.Start(FROM_HERE,
1266 base::TimeDelta::FromSeconds(delay_secs), 1270 base::TimeDelta::FromSeconds(delay_secs),
1267 this, 1271 this,
1268 &BrowserMainLoop::EndStartupTracing); 1272 &BrowserMainLoop::EndStartupTracing);
1269 } 1273 }
1270 1274
1271 void BrowserMainLoop::EndStartupTracing() { 1275 void BrowserMainLoop::EndStartupTracing() {
1272 is_tracing_startup_ = false; 1276 is_tracing_startup_ = false;
1277
1273 TracingController::GetInstance()->DisableRecording( 1278 TracingController::GetInstance()->DisableRecording(
1274 TracingController::CreateFileSink( 1279 TracingController::CreateFileSink(
1275 startup_trace_file_, 1280 startup_trace_file_,
1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1281 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1277 } 1282 }
1278 1283
1279 } // namespace content 1284 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698