| 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/files/file_path.h" |
| 8 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
| 11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 12 #include "base/process/memory.h" | 13 #include "base/process/memory.h" |
| 13 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
| 14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 17 #include "chrome/browser/chrome_content_browser_client.h" | 18 #include "chrome/browser/chrome_content_browser_client.h" |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << | 687 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << |
| 687 locale; | 688 locale; |
| 688 | 689 |
| 689 #if defined(OS_MACOSX) | 690 #if defined(OS_MACOSX) |
| 690 // Update the process name (need resources to get the strings, so | 691 // Update the process name (need resources to get the strings, so |
| 691 // only do this when ResourcesBundle has been initialized). | 692 // only do this when ResourcesBundle has been initialized). |
| 692 SetMacProcessName(command_line); | 693 SetMacProcessName(command_line); |
| 693 #endif // defined(OS_MACOSX) | 694 #endif // defined(OS_MACOSX) |
| 694 | 695 |
| 695 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 696 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 696 if (process_type == switches::kUtilityProcess) | 697 if (process_type == switches::kUtilityProcess) { |
| 697 chrome::ChromeContentUtilityClient::PreSandboxStartup(); | 698 base::FilePath media_path; |
| 699 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); |
| 700 chrome::ChromeContentUtilityClient::PreSandboxStartup(media_path); |
| 701 } |
| 698 #endif | 702 #endif |
| 699 } | 703 } |
| 700 | 704 |
| 701 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 705 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 702 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain | 706 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain |
| 703 // sets this up for the browser process in a different manner. Zygotes | 707 // sets this up for the browser process in a different manner. Zygotes |
| 704 // need to call InitCrashReporter() in RunZygote(). | 708 // need to call InitCrashReporter() in RunZygote(). |
| 705 if (!process_type.empty() && process_type != switches::kZygoteProcess) { | 709 if (!process_type.empty() && process_type != switches::kZygoteProcess) { |
| 706 #if defined(OS_ANDROID) | 710 #if defined(OS_ANDROID) |
| 707 InitNonBrowserCrashReporterForAndroid(); | 711 InitNonBrowserCrashReporterForAndroid(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } | 847 } |
| 844 | 848 |
| 845 content::ContentUtilityClient* | 849 content::ContentUtilityClient* |
| 846 ChromeMainDelegate::CreateContentUtilityClient() { | 850 ChromeMainDelegate::CreateContentUtilityClient() { |
| 847 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 851 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 848 return NULL; | 852 return NULL; |
| 849 #else | 853 #else |
| 850 return &g_chrome_content_utility_client.Get(); | 854 return &g_chrome_content_utility_client.Get(); |
| 851 #endif | 855 #endif |
| 852 } | 856 } |
| OLD | NEW |