diff options
author | sievers@google.com <sievers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-11 01:28:54 +0000 |
---|---|---|
committer | sievers@google.com <sievers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-11 01:28:54 +0000 |
commit | d6d3c7f27ae400b02f213ae7f6c518af214af7a1 (patch) | |
tree | f3e57f9bb61e3fde217dcc68947ba74ac74cbed5 /content/browser/browser_main_loop.cc | |
parent | 93b1c4e979784d6741cad83cedbc2405878b0ecf (diff) | |
download | chromium_src-d6d3c7f27ae400b02f213ae7f6c518af214af7a1.zip chromium_src-d6d3c7f27ae400b02f213ae7f6c518af214af7a1.tar.gz chromium_src-d6d3c7f27ae400b02f213ae7f6c518af214af7a1.tar.bz2 |
Android: Fix default filename for kTraceStartup file
Putting chrometrace.log in the current working directory is not
useful on Android. Generate a filepath on the sdcard instead the
same way we do it for intent triggered tracing.
R=piman@chromium.org, wangxianzhu@chromium.org
Review URL: https://codereview.chromium.org/232053002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_main_loop.cc')
-rw-r--r-- | content/browser/browser_main_loop.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 2a6b823..5a7c5b9 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -70,6 +70,7 @@ #include "base/android/jni_android.h" #include "content/browser/android/browser_startup_controller.h" #include "content/browser/android/surface_texture_peer_browser_impl.h" +#include "content/browser/android/tracing_controller_android.h" #include "ui/gl/gl_surface.h" #endif @@ -253,6 +254,10 @@ static void SetUpGLibLogHandler() { } #endif +void OnStoppedStartupTracing(const base::FilePath& trace_file) { + LOG(INFO) << "Completed startup tracing to " << trace_file.value(); +} + } // namespace // The currently-running BrowserMainLoop. There can be one or zero. @@ -1095,8 +1100,12 @@ void BrowserMainLoop::InitStartupTracing(const CommandLine& command_line) { return; if (trace_file.empty()) { +#if defined(OS_ANDROID) + TracingControllerAndroid::GenerateTracingFilePath(&trace_file); +#else // Default to saving the startup trace into the current dir. trace_file = base::FilePath().AppendASCII("chrometrace.log"); +#endif } std::string delay_str = command_line.GetSwitchValueASCII( @@ -1118,7 +1127,7 @@ void BrowserMainLoop::InitStartupTracing(const CommandLine& command_line) { void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { is_tracing_startup_ = false; TracingController::GetInstance()->DisableRecording( - trace_file, TracingController::TracingFileResultCallback()); + trace_file, base::Bind(&OnStoppedStartupTracing)); } } // namespace content |