Chromium Code Reviews| Index: content/browser/browser_main_runner.cc |
| diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc |
| index d7575f67b703ce95816c5c78a477d28744192a6c..aa138d7fe51a1126db7ace42f98a5910184d8314 100644 |
| --- a/content/browser/browser_main_runner.cc |
| +++ b/content/browser/browser_main_runner.cc |
| @@ -14,14 +14,20 @@ |
| #include "base/profiler/scoped_tracker.h" |
| #include "base/trace_event/trace_event.h" |
| #include "base/tracked_objects.h" |
| +#include "components/tracing/trace_config_file.h" |
| #include "components/tracing/tracing_switches.h" |
| #include "content/browser/browser_main_loop.h" |
| #include "content/browser/browser_shutdown_profile_dumper.h" |
| #include "content/browser/notification_service_impl.h" |
| +#include "content/public/browser/tracing_controller.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/public/common/main_function_params.h" |
| #include "ui/base/ime/input_method_initializer.h" |
| +#if defined(OS_ANDROID) |
| +#include "content/browser/android/tracing_controller_android.h" |
| +#endif |
| + |
| #if defined(OS_WIN) |
| #include "base/win/win_util.h" |
| #include "base/win/windows_version.h" |
| @@ -230,13 +236,22 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { |
| // with special version, which would save trace file on exit (i.e. |
| // startup tracing becomes a version of shutdown tracing). |
| scoped_ptr<BrowserShutdownProfileDumper> startup_profiler; |
| - if (main_loop_->is_tracing_startup()) { |
| + if (main_loop_->is_tracing_startup_for_duration()) { |
| main_loop_->StopStartupTracingTimer(); |
| if (main_loop_->startup_trace_file() != |
| base::FilePath().AppendASCII("none")) { |
| startup_profiler.reset( |
| new BrowserShutdownProfileDumper(main_loop_->startup_trace_file())); |
| } |
| + } else if (tracing::TraceConfigFile::GetInstance()->IsEnabled() && |
| + TracingController::GetInstance()->IsRecording()) { |
| + base::FilePath result_file; |
|
no sievers
2015/08/24 22:50:16
Just wondering: Is this a fix unrelated to the cl
Zhen Wang
2015/08/25 17:38:14
This is required for --trace-config-flag when dura
|
| +#if defined(OS_ANDROID) |
| + TracingControllerAndroid::GenerateTracingFilePath(&result_file); |
| +#else |
| + result_file = tracing::TraceConfigFile::GetInstance()->GetResultFile(); |
| +#endif |
| + startup_profiler.reset(new BrowserShutdownProfileDumper(result_file)); |
| } |
| // The shutdown tracing got enabled in AttemptUserExit earlier, but someone |