OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/metrics/field_trial.h" |
8 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "base/process_util.h" | 11 #include "base/process_util.h" |
11 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "chrome/browser/chrome_content_browser_client.h" | 15 #include "chrome/browser/chrome_content_browser_client.h" |
15 #include "chrome/browser/defaults.h" | 16 #include "chrome/browser/defaults.h" |
16 #include "chrome/browser/diagnostics/diagnostics_main.h" | 17 #include "chrome/browser/diagnostics/diagnostics_main.h" |
17 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 413 } |
413 | 414 |
414 #if defined(OS_WIN) | 415 #if defined(OS_WIN) |
415 // Must do this before any other usage of command line! | 416 // Must do this before any other usage of command line! |
416 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { | 417 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { |
417 *exit_code = 1; | 418 *exit_code = 1; |
418 return true; | 419 return true; |
419 } | 420 } |
420 #endif | 421 #endif |
421 | 422 |
| 423 if (process_type == "" && |
| 424 command_line.HasSwitch(switches::kEnableBenchmarking)) { |
| 425 base::FieldTrial::EnableBenchmarking(); |
| 426 } |
422 return false; | 427 return false; |
423 } | 428 } |
424 | 429 |
425 #if defined(OS_MACOSX) | 430 #if defined(OS_MACOSX) |
426 void InitMacCrashReporter(const CommandLine& command_line, | 431 void InitMacCrashReporter(const CommandLine& command_line, |
427 const std::string& process_type) { | 432 const std::string& process_type) { |
428 | 433 |
429 // TODO(mark): Right now, InitCrashReporter() needs to be called after | 434 // TODO(mark): Right now, InitCrashReporter() needs to be called after |
430 // CommandLine::Init() and chrome::RegisterPathProvider(). Ideally, | 435 // CommandLine::Init() and chrome::RegisterPathProvider(). Ideally, |
431 // Breakpad initialization could occur sooner, preferably even before the | 436 // Breakpad initialization could occur sooner, preferably even before the |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, | 746 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, |
742 sandbox::SandboxInterfaceInfo* sandbox_info) { | 747 sandbox::SandboxInterfaceInfo* sandbox_info) { |
743 ChromeMainDelegate chrome_main_delegate; | 748 ChromeMainDelegate chrome_main_delegate; |
744 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); | 749 return content::ContentMain(instance, sandbox_info, &chrome_main_delegate); |
745 #elif defined(OS_POSIX) | 750 #elif defined(OS_POSIX) |
746 int ChromeMain(int argc, const char** argv) { | 751 int ChromeMain(int argc, const char** argv) { |
747 ChromeMainDelegate chrome_main_delegate; | 752 ChromeMainDelegate chrome_main_delegate; |
748 return content::ContentMain(argc, argv, &chrome_main_delegate); | 753 return content::ContentMain(argc, argv, &chrome_main_delegate); |
749 #endif | 754 #endif |
750 } | 755 } |
OLD | NEW |