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

Side by Side Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address joechan's comments Created 6 years, 4 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
« no previous file with comments | « base/test/trace_event_analyzer_unittest.cc ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void StartShutdownTracing() { 177 void StartShutdownTracing() {
178 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 178 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
179 if (command_line.HasSwitch(switches::kTraceShutdown)) { 179 if (command_line.HasSwitch(switches::kTraceShutdown)) {
180 base::debug::CategoryFilter category_filter( 180 base::debug::CategoryFilter category_filter(
181 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); 181 command_line.GetSwitchValueASCII(switches::kTraceShutdown));
182 base::debug::TraceLog::GetInstance()->SetEnabled( 182 base::debug::TraceLog::GetInstance()->SetEnabled(
183 category_filter, 183 category_filter,
184 base::debug::TraceLog::RECORDING_MODE, 184 base::debug::TraceLog::RECORDING_MODE,
185 base::debug::TraceLog::RECORD_UNTIL_FULL); 185 base::debug::TraceOptions());
186 } 186 }
187 TRACE_EVENT0("shutdown", "StartShutdownTracing"); 187 TRACE_EVENT0("shutdown", "StartShutdownTracing");
188 } 188 }
189 189
190 // The Android implementation is in application_lifetime_android.cc 190 // The Android implementation is in application_lifetime_android.cc
191 #if !defined(OS_ANDROID) 191 #if !defined(OS_ANDROID)
192 void AttemptRestart() { 192 void AttemptRestart() {
193 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? 193 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead?
194 for (chrome::BrowserIterator it; !it.done(); it.Next()) 194 for (chrome::BrowserIterator it; !it.done(); it.Next())
195 content::BrowserContext::SaveSessionState(it->profile()); 195 content::BrowserContext::SaveSessionState(it->profile());
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // environment is still active. 419 // environment is still active.
420 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) 420 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE)
421 return !ash::Shell::HasInstance(); 421 return !ash::Shell::HasInstance();
422 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) 422 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
423 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); 423 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty();
424 #endif 424 #endif
425 return true; 425 return true;
426 } 426 }
427 427
428 } // namespace chrome 428 } // namespace chrome
OLDNEW
« no previous file with comments | « base/test/trace_event_analyzer_unittest.cc ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698