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

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

Issue 1431053003: Revert of Move components/startup_metric_utils/* to components/startup_metric_utils/browser/*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 | « chrome/app/chrome_exe_main_win.cc ('k') | chrome/browser/BUILD.gn » ('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/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"
(...skipping 22 matching lines...) Expand all
33 #include "chrome/common/logging_chrome.h" 33 #include "chrome/common/logging_chrome.h"
34 #include "chrome/common/profiling.h" 34 #include "chrome/common/profiling.h"
35 #include "chrome/common/switch_utils.h" 35 #include "chrome/common/switch_utils.h"
36 #include "chrome/common/trace_event_args_whitelist.h" 36 #include "chrome/common/trace_event_args_whitelist.h"
37 #include "chrome/common/url_constants.h" 37 #include "chrome/common/url_constants.h"
38 #include "chrome/plugin/chrome_content_plugin_client.h" 38 #include "chrome/plugin/chrome_content_plugin_client.h"
39 #include "chrome/renderer/chrome_content_renderer_client.h" 39 #include "chrome/renderer/chrome_content_renderer_client.h"
40 #include "chrome/utility/chrome_content_utility_client.h" 40 #include "chrome/utility/chrome_content_utility_client.h"
41 #include "components/component_updater/component_updater_paths.h" 41 #include "components/component_updater/component_updater_paths.h"
42 #include "components/content_settings/core/common/content_settings_pattern.h" 42 #include "components/content_settings/core/common/content_settings_pattern.h"
43 #include "components/startup_metric_utils/startup_metric_utils.h"
43 #include "components/version_info/version_info.h" 44 #include "components/version_info/version_info.h"
44 #include "content/public/common/content_client.h" 45 #include "content/public/common/content_client.h"
45 #include "content/public/common/content_paths.h" 46 #include "content/public/common/content_paths.h"
46 #include "content/public/common/content_switches.h" 47 #include "content/public/common/content_switches.h"
47 #include "extensions/common/constants.h" 48 #include "extensions/common/constants.h"
48 #include "ui/base/resource/resource_bundle.h" 49 #include "ui/base/resource/resource_bundle.h"
49 #include "ui/base/ui_base_switches.h" 50 #include "ui/base/ui_base_switches.h"
50 51
51 #if defined(OS_WIN) 52 #if defined(OS_WIN)
52 #include <atlbase.h> 53 #include <atlbase.h>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 #if !defined(DISABLE_NACL) 119 #if !defined(DISABLE_NACL)
119 #include "components/nacl/common/nacl_switches.h" 120 #include "components/nacl/common/nacl_switches.h"
120 #include "components/nacl/renderer/plugin/ppapi_entrypoints.h" 121 #include "components/nacl/renderer/plugin/ppapi_entrypoints.h"
121 #endif 122 #endif
122 123
123 #if defined(ENABLE_PLUGINS) && (defined(CHROME_MULTIPLE_DLL_CHILD) || \ 124 #if defined(ENABLE_PLUGINS) && (defined(CHROME_MULTIPLE_DLL_CHILD) || \
124 !defined(CHROME_MULTIPLE_DLL_BROWSER)) 125 !defined(CHROME_MULTIPLE_DLL_BROWSER))
125 #include "pdf/pdf.h" 126 #include "pdf/pdf.h"
126 #endif 127 #endif
127 128
128 #if !defined(CHROME_MULTIPLE_DLL_CHILD)
129 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
130 #endif
131
132 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) 129 #if !defined(CHROME_MULTIPLE_DLL_BROWSER)
133 #include "chrome/child/pdf_child_init.h" 130 #include "chrome/child/pdf_child_init.h"
134 131
135 base::LazyInstance<ChromeContentRendererClient> 132 base::LazyInstance<ChromeContentRendererClient>
136 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; 133 g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
137 base::LazyInstance<ChromeContentUtilityClient> 134 base::LazyInstance<ChromeContentUtilityClient>
138 g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER; 135 g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER;
139 base::LazyInstance<ChromeContentPluginClient> 136 base::LazyInstance<ChromeContentPluginClient>
140 g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER; 137 g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
141 #endif 138 #endif
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 logging::APPEND_TO_OLD_LOG_FILE; 396 logging::APPEND_TO_OLD_LOG_FILE;
400 if (process_type.empty()) { 397 if (process_type.empty()) {
401 file_state = logging::DELETE_OLD_LOG_FILE; 398 file_state = logging::DELETE_OLD_LOG_FILE;
402 } 399 }
403 const base::CommandLine& command_line = 400 const base::CommandLine& command_line =
404 *base::CommandLine::ForCurrentProcess(); 401 *base::CommandLine::ForCurrentProcess();
405 logging::InitChromeLogging(command_line, file_state); 402 logging::InitChromeLogging(command_line, file_state);
406 } 403 }
407 #endif 404 #endif
408 405
409 #if !defined(CHROME_MULTIPLE_DLL_CHILD) 406 } // namespace
410 void RecordMainStartupMetrics() { 407
408 ChromeMainDelegate::ChromeMainDelegate() {
411 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) 409 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
412 // Record the startup process creation time on supported platforms. 410 // Record the startup process creation time on supported platforms.
413 startup_metric_utils::RecordStartupProcessCreationTime( 411 startup_metric_utils::RecordStartupProcessCreationTime(
414 base::CurrentProcessInfo::CreationTime()); 412 base::CurrentProcessInfo::CreationTime());
415 #endif 413 #endif
416 414
417 // On Android the main entry point time is the time when the Java code starts. 415 // On Android the main entry point time is the time when the Java code starts.
418 // This happens before the shared library containing this code is even loaded. 416 // This happens before the shared library containing this code is even loaded.
419 // The Java startup code has recorded that time, but the C++ code can't fetch it 417 // The Java startup code has recorded that time, but the C++ code can't fetch it
420 // from the Java side until it has initialized the JNI. See 418 // from the Java side until it has initialized the JNI. See
421 // ChromeMainDelegateAndroid. 419 // ChromeMainDelegateAndroid.
422 #if !defined(OS_ANDROID) 420 #if !defined(OS_ANDROID)
423 startup_metric_utils::RecordMainEntryPointTime(base::Time::Now()); 421 startup_metric_utils::RecordMainEntryPointTime(base::Time::Now());
424 #endif 422 #endif
425 } 423 }
426 #endif // !defined(CHROME_MULTIPLE_DLL_CHILD)
427
428 } // namespace
429
430 ChromeMainDelegate::ChromeMainDelegate() {
431 #if !defined(CHROME_MULTIPLE_DLL_CHILD)
432 // Record startup metrics in the browser process. For component builds, there
433 // is no way to know the type of process (process command line is not yet
434 // initialized), so the function below will also be called in renderers.
435 // This doesn't matter as it simply sets global variables.
436 RecordMainStartupMetrics();
437 #endif // !defined(CHROME_MULTIPLE_DLL_CHILD)
438 }
439 424
440 ChromeMainDelegate::~ChromeMainDelegate() { 425 ChromeMainDelegate::~ChromeMainDelegate() {
441 } 426 }
442 427
443 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { 428 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
444 #if defined(OS_CHROMEOS) 429 #if defined(OS_CHROMEOS)
445 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats(); 430 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats();
446 #endif 431 #endif
447 432
448 const base::CommandLine& command_line = 433 const base::CommandLine& command_line =
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 case version_info::Channel::CANARY: 965 case version_info::Channel::CANARY:
981 return true; 966 return true;
982 case version_info::Channel::DEV: 967 case version_info::Channel::DEV:
983 case version_info::Channel::BETA: 968 case version_info::Channel::BETA:
984 case version_info::Channel::STABLE: 969 case version_info::Channel::STABLE:
985 default: 970 default:
986 // Don't enable instrumentation. 971 // Don't enable instrumentation.
987 return false; 972 return false;
988 } 973 }
989 } 974 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_exe_main_win.cc ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698