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

Side by Side Diff: chrome/app/chrome_main_delegate.cc

Issue 999883002: Profiler-instrumentation of the startup time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 9 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 "chrome/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/metrics/statistics_recorder.h" 14 #include "base/metrics/statistics_recorder.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/process/memory.h" 16 #include "base/process/memory.h"
17 #include "base/process/process_handle.h" 17 #include "base/process/process_handle.h"
18 #include "base/profiler/scoped_tracker.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "build/build_config.h" 20 #include "build/build_config.h"
20 #include "chrome/browser/chrome_content_browser_client.h" 21 #include "chrome/browser/chrome_content_browser_client.h"
21 #include "chrome/browser/defaults.h" 22 #include "chrome/browser/defaults.h"
22 #include "chrome/common/chrome_constants.h" 23 #include "chrome/common/chrome_constants.h"
23 #include "chrome/common/chrome_content_client.h" 24 #include "chrome/common/chrome_content_client.h"
24 #include "chrome/common/chrome_paths.h" 25 #include "chrome/common/chrome_paths.h"
25 #include "chrome/common/chrome_paths_internal.h" 26 #include "chrome/common/chrome_paths_internal.h"
26 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/chrome_version_info.h" 28 #include "chrome/common/chrome_version_info.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 } 965 }
965 966
966 content::ContentUtilityClient* 967 content::ContentUtilityClient*
967 ChromeMainDelegate::CreateContentUtilityClient() { 968 ChromeMainDelegate::CreateContentUtilityClient() {
968 #if defined(CHROME_MULTIPLE_DLL_BROWSER) 969 #if defined(CHROME_MULTIPLE_DLL_BROWSER)
969 return NULL; 970 return NULL;
970 #else 971 #else
971 return g_chrome_content_utility_client.Pointer(); 972 return g_chrome_content_utility_client.Pointer();
972 #endif 973 #endif
973 } 974 }
975
976 bool ChromeMainDelegate::EnableProfilerRecording() {
977 switch (chrome::VersionInfo::GetChannel()) {
978 case chrome::VersionInfo::CHANNEL_UNKNOWN:
979 case chrome::VersionInfo::CHANNEL_CANARY:
980 tracked_objects::ScopedTracker::Enable();
vadimt 2015/03/12 18:23:03 We don't need BOTH returning bool and enabling.
yao 2015/03/12 18:32:19 I don't really have a strong opinion, but what's t
vadimt 2015/03/12 18:37:26 Hypothetically, another implementation may overrid
yao 2015/03/13 15:24:49 Changed as you suggested.
981 return true;
982 case chrome::VersionInfo::CHANNEL_DEV:
983 case chrome::VersionInfo::CHANNEL_BETA:
984 case chrome::VersionInfo::CHANNEL_STABLE:
985 default:
986 // Don't enable instrumentation.
987 return false;
988 }
989 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698