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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << | 633 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << |
633 locale; | 634 locale; |
634 | 635 |
635 #if defined(OS_MACOSX) | 636 #if defined(OS_MACOSX) |
636 // Update the process name (need resources to get the strings, so | 637 // Update the process name (need resources to get the strings, so |
637 // only do this when ResourcesBundle has been initialized). | 638 // only do this when ResourcesBundle has been initialized). |
638 SetMacProcessName(command_line); | 639 SetMacProcessName(command_line); |
639 #endif // defined(OS_MACOSX) | 640 #endif // defined(OS_MACOSX) |
640 | 641 |
641 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 642 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
642 if (process_type == switches::kUtilityProcess) | 643 if (process_type == switches::kUtilityProcess) { |
643 chrome::ChromeContentUtilityClient::PreSandboxStartup(); | 644 base::FilePath media_path; |
645 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); | |
Lei Zhang
2013/08/07 20:56:21
Why not just do this in PreSandboxStartup() ?
vandebo (ex-Chrome)
2013/08/07 21:00:43
Layering violation - utility doesn't depend on con
Lei Zhang
2013/08/07 22:30:14
chrome/DEPS says anyone can use content/public/com
vandebo (ex-Chrome)
2013/08/07 23:26:12
Hmm, indeed. Fixed.
| |
646 chrome::ChromeContentUtilityClient::PreSandboxStartup(media_path); | |
647 } | |
644 #endif | 648 #endif |
645 } | 649 } |
646 | 650 |
647 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 651 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
648 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain | 652 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain |
649 // sets this up for the browser process in a different manner. Zygotes | 653 // sets this up for the browser process in a different manner. Zygotes |
650 // need to call InitCrashReporter() in RunZygote(). | 654 // need to call InitCrashReporter() in RunZygote(). |
651 if (!process_type.empty() && process_type != switches::kZygoteProcess) { | 655 if (!process_type.empty() && process_type != switches::kZygoteProcess) { |
652 #if defined(OS_ANDROID) | 656 #if defined(OS_ANDROID) |
653 InitNonBrowserCrashReporterForAndroid(); | 657 InitNonBrowserCrashReporterForAndroid(); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
789 } | 793 } |
790 | 794 |
791 content::ContentUtilityClient* | 795 content::ContentUtilityClient* |
792 ChromeMainDelegate::CreateContentUtilityClient() { | 796 ChromeMainDelegate::CreateContentUtilityClient() { |
793 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 797 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
794 return NULL; | 798 return NULL; |
795 #else | 799 #else |
796 return &g_chrome_content_utility_client.Get(); | 800 return &g_chrome_content_utility_client.Get(); |
797 #endif | 801 #endif |
798 } | 802 } |
OLD | NEW |