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

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

Issue 109933006: Implement sampling profiler (chromium side change) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #endif 181 #endif
182 } 182 }
183 183
184 void StartShutdownTracing() { 184 void StartShutdownTracing() {
185 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 185 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
186 if (command_line.HasSwitch(switches::kTraceShutdown)) { 186 if (command_line.HasSwitch(switches::kTraceShutdown)) {
187 base::debug::CategoryFilter category_filter( 187 base::debug::CategoryFilter category_filter(
188 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); 188 command_line.GetSwitchValueASCII(switches::kTraceShutdown));
189 base::debug::TraceLog::GetInstance()->SetEnabled( 189 base::debug::TraceLog::GetInstance()->SetEnabled(
190 category_filter, 190 category_filter,
191 base::debug::TraceLog::RECORDING_MODE,
191 base::debug::TraceLog::RECORD_UNTIL_FULL); 192 base::debug::TraceLog::RECORD_UNTIL_FULL);
192 } 193 }
193 TRACE_EVENT0("shutdown", "StartShutdownTracing"); 194 TRACE_EVENT0("shutdown", "StartShutdownTracing");
194 } 195 }
195 196
196 // The Android implementation is in application_lifetime_android.cc 197 // The Android implementation is in application_lifetime_android.cc
197 #if !defined(OS_ANDROID) 198 #if !defined(OS_ANDROID)
198 void AttemptRestart() { 199 void AttemptRestart() {
199 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? 200 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead?
200 for (chrome::BrowserIterator it; !it.done(); it.Next()) 201 for (chrome::BrowserIterator it; !it.done(); it.Next())
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // environment is still active. 396 // environment is still active.
396 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) 397 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE)
397 return !ash::Shell::HasInstance(); 398 return !ash::Shell::HasInstance();
398 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) 399 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
399 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); 400 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty();
400 #endif 401 #endif
401 return true; 402 return true;
402 } 403 }
403 404
404 } // namespace chrome 405 } // namespace chrome
OLDNEW
« no previous file with comments | « base/test/trace_event_analyzer_unittest.cc ('k') | components/tracing/child_trace_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698