OLD | NEW |
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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/common/chrome_paths_internal.h" | 23 #include "chrome/common/chrome_paths_internal.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/chrome_version_info.h" |
26 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/profiling.h" | 27 #include "chrome/common/profiling.h" |
28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
29 #include "chrome/plugin/chrome_content_plugin_client.h" | 29 #include "chrome/plugin/chrome_content_plugin_client.h" |
30 #include "chrome/renderer/chrome_content_renderer_client.h" | 30 #include "chrome/renderer/chrome_content_renderer_client.h" |
31 #include "chrome/utility/chrome_content_utility_client.h" | 31 #include "chrome/utility/chrome_content_utility_client.h" |
32 #include "content/common/content_counters.h" | 32 #include "content/common/content_counters.h" |
33 #include "content/public/browser/render_process_host.h" | |
34 #include "content/public/common/content_client.h" | 33 #include "content/public/common/content_client.h" |
35 #include "content/public/common/content_paths.h" | 34 #include "content/public/common/content_paths.h" |
36 #include "content/public/common/content_switches.h" | 35 #include "content/public/common/content_switches.h" |
37 #include "ui/base/ui_base_switches.h" | 36 #include "ui/base/ui_base_switches.h" |
38 | 37 |
39 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
40 #include <algorithm> | 39 #include <algorithm> |
41 #include <atlbase.h> | 40 #include <atlbase.h> |
42 #include <malloc.h> | 41 #include <malloc.h> |
43 #include "base/string_util.h" | 42 #include "base/string_util.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> | 572 startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> |
574 (content::Counters::chrome_main())); | 573 (content::Counters::chrome_main())); |
575 | 574 |
576 // Enable the heap profiler as early as possible! | 575 // Enable the heap profiler as early as possible! |
577 EnableHeapProfiler(command_line); | 576 EnableHeapProfiler(command_line); |
578 | 577 |
579 // Enable Message Loop related state asap. | 578 // Enable Message Loop related state asap. |
580 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 579 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
581 MessageLoop::EnableHistogrammer(true); | 580 MessageLoop::EnableHistogrammer(true); |
582 | 581 |
583 // Single-process is an unsupported and not fully tested mode, so | 582 if (command_line.HasSwitch(switches::kSingleProcess)) |
584 // don't enable it for official Chrome builds. | |
585 #if !defined(GOOGLE_CHROME_BUILD) | |
586 if (command_line.HasSwitch(switches::kSingleProcess)) { | |
587 content::RenderProcessHost::set_run_renderer_in_process(true); | |
588 InitializeChromeContentRendererClient(); | 583 InitializeChromeContentRendererClient(); |
589 } | |
590 #endif // GOOGLE_CHROME_BUILD | |
591 | 584 |
592 logging::OldFileDeletionState file_state = | 585 logging::OldFileDeletionState file_state = |
593 logging::APPEND_TO_OLD_LOG_FILE; | 586 logging::APPEND_TO_OLD_LOG_FILE; |
594 if (process_type.empty()) { | 587 if (process_type.empty()) { |
595 file_state = logging::DELETE_OLD_LOG_FILE; | 588 file_state = logging::DELETE_OLD_LOG_FILE; |
596 } | 589 } |
597 logging::InitChromeLogging(command_line, file_state); | 590 logging::InitChromeLogging(command_line, file_state); |
598 | 591 |
599 // Register internal Chrome schemes so they'll be parsed correctly. This | 592 // Register internal Chrome schemes so they'll be parsed correctly. This |
600 // must happen before we process any URLs with the affected schemes, and | 593 // must happen before we process any URLs with the affected schemes, and |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 | 729 |
737 #if defined(USE_LINUX_BREAKPAD) | 730 #if defined(USE_LINUX_BREAKPAD) |
738 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 731 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
739 // this up for the browser process in a different manner. | 732 // this up for the browser process in a different manner. |
740 InitCrashReporter(); | 733 InitCrashReporter(); |
741 #endif | 734 #endif |
742 | 735 |
743 InitializeChromeContentClient(process_type); | 736 InitializeChromeContentClient(process_type); |
744 } | 737 } |
745 #endif // OS_MACOSX | 738 #endif // OS_MACOSX |
OLD | NEW |