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 11 matching lines...) Expand all Loading... |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
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/app/content_main.h" |
32 #include "content/common/content_counters.h" | 33 #include "content/common/content_counters.h" |
| 34 #include "content/public/app/content_main_delegate.h" |
33 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
34 #include "content/public/common/content_client.h" | 36 #include "content/public/common/content_client.h" |
35 #include "content/public/common/content_paths.h" | 37 #include "content/public/common/content_paths.h" |
36 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
37 #include "media/base/media.h" | 39 #include "media/base/media.h" |
38 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
39 #include "ui/base/ui_base_switches.h" | 41 #include "ui/base/ui_base_switches.h" |
40 | 42 |
41 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
42 #include <algorithm> | 44 #include <algorithm> |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 #if !defined(DISABLE_NACL) | 692 #if !defined(DISABLE_NACL) |
691 { switches::kNaClLoaderProcess, NaClMain }, | 693 { switches::kNaClLoaderProcess, NaClMain }, |
692 #endif // DISABLE_NACL | 694 #endif // DISABLE_NACL |
693 }; | 695 }; |
694 | 696 |
695 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { | 697 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { |
696 if (process_type == kMainFunctions[i].name) | 698 if (process_type == kMainFunctions[i].name) |
697 return kMainFunctions[i].function(main_function_params); | 699 return kMainFunctions[i].function(main_function_params); |
698 } | 700 } |
699 | 701 |
700 return -1; | 702 NOTREACHED() << "Unknown process type: " << process_type; |
| 703 return 1; |
701 } | 704 } |
702 | 705 |
703 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { | 706 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { |
704 if (SubprocessNeedsResourceBundle(process_type)) | 707 if (SubprocessNeedsResourceBundle(process_type)) |
705 ResourceBundle::CleanupSharedInstance(); | 708 ResourceBundle::CleanupSharedInstance(); |
706 | 709 |
707 logging::CleanupChromeLogging(); | 710 logging::CleanupChromeLogging(); |
708 } | 711 } |
709 | 712 |
710 #if defined(OS_MACOSX) | 713 #if defined(OS_MACOSX) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 756 |
754 #if defined(USE_LINUX_BREAKPAD) | 757 #if defined(USE_LINUX_BREAKPAD) |
755 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets | 758 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets |
756 // this up for the browser process in a different manner. | 759 // this up for the browser process in a different manner. |
757 InitCrashReporter(); | 760 InitCrashReporter(); |
758 #endif | 761 #endif |
759 | 762 |
760 InitializeChromeContentClient(process_type); | 763 InitializeChromeContentClient(process_type); |
761 } | 764 } |
762 #endif // OS_MACOSX | 765 #endif // OS_MACOSX |
OLD | NEW |