diff options
33 files changed, 69 insertions, 95 deletions
diff --git a/chrome/app/DEPS b/chrome/app/DEPS index 9993526..346b793 100644 --- a/chrome/app/DEPS +++ b/chrome/app/DEPS @@ -5,6 +5,7 @@ include_rules = [ "+chrome/renderer/chrome_content_renderer_client.h", "+chrome/utility/chrome_content_utility_client.h", "+grit", # For generated headers + "+media", "+policy", # For generated headers and source "+sandbox", "+tools/memory_watcher", diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 1cc8c21..3f0652c 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -44,6 +44,7 @@ #include "content/common/sandbox_init_wrapper.h" #include "content/common/set_process_title.h" #include "ipc/ipc_switches.h" +#include "media/base/media.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" @@ -430,6 +431,13 @@ int RunZygote(const MainFunctionParams& main_function_params) { #endif }; + // Each Renderer we spawn will re-attempt initialization of the media + // libraries, at which point failure will be detected and handled, so + // we do not need to cope with initialization failures here. + FilePath media_path; + if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) + media::InitializeMediaLibrary(media_path); + // This function call can return multiple times, once per fork(). if (!ZygoteMain(main_function_params)) return 1; diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 3c4b52e..771f67e 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -766,6 +766,16 @@ void BrowserProcessImpl::CreateIOThread() { webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); } +#if defined(OS_POSIX) + // Also find plugins in a user-specific plugins dir, + // e.g. ~/.config/chromium/Plugins. + FilePath user_data_dir; + if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { + webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( + user_data_dir.Append("Plugins")); + } +#endif + scoped_ptr<IOThread> thread(new IOThread( local_state(), net_log_.get(), extension_event_router_forwarder_.get())); base::Thread::Options options; diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 03e1755..6f09c2f 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -41,6 +41,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_messages.h" +#include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -218,6 +219,9 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( } #endif // OS_MACOSX + if (logging::DialogsAreSuppressed()) + command_line->AppendSwitch(switches::kNoErrorDialogs); + std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index d6d610e..2a90072 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -112,8 +112,6 @@ const FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); const FilePath::CharType kWebAppDirname[] = FPL("Web Applications"); const FilePath::CharType kServiceStateFileName[] = FPL("Service State"); -// This number used to be limited to 32 in the past (see b/535234). -const unsigned int kMaxRendererProcessCount = 42; const int kStatsMaxThreads = 32; const int kStatsMaxCounters = 3000; diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index d0e2652..5d6b416 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -71,7 +71,6 @@ extern const FilePath::CharType kJumpListIconDirname[]; extern const FilePath::CharType kWebAppDirname[]; extern const FilePath::CharType kServiceStateFileName[]; -extern const unsigned int kMaxRendererProcessCount; extern const int kStatsMaxThreads; extern const int kStatsMaxCounters; diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 88c41b4..78148d3 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -504,12 +504,6 @@ bool ChromeContentRendererClient::WillSendRequest(WebKit::WebFrame* frame, return false; } -FilePath ChromeContentRendererClient::GetMediaLibraryPath() { - FilePath rv; - PathService::Get(chrome::DIR_MEDIA_LIBS, &rv); - return rv; -} - bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { // We only need to pump events for chrome frame processes as the // cookie policy is controlled by the host browser (IE). If the diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index 794c9e6..ad629bd 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h @@ -58,7 +58,6 @@ class ChromeContentRendererClient : public content::ContentRendererClient { virtual bool WillSendRequest(WebKit::WebFrame* frame, const GURL& url, GURL* new_url) OVERRIDE; - virtual FilePath GetMediaLibraryPath() OVERRIDE; virtual bool ShouldPumpEventsDuringCookieMessage() OVERRIDE; virtual void DidCreateScriptContext(WebKit::WebFrame* frame) OVERRIDE; virtual void DidDestroyScriptContext(WebKit::WebFrame* frame) OVERRIDE; diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc index d34e985..1721723 100644 --- a/chrome/renderer/chrome_render_process_observer.cc +++ b/chrome/renderer/chrome_render_process_observer.cc @@ -26,6 +26,8 @@ #include "content/renderer/render_view.h" #include "content/renderer/render_view_visitor.h" #include "crypto/nss_util.h" +#include "media/base/media.h" +#include "media/base/media_switches.h" #include "net/base/net_errors.h" #include "net/base/net_module.h" #include "third_party/sqlite/sqlite3.h" @@ -34,6 +36,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflightResultCache.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "v8/include/v8.h" @@ -49,6 +52,7 @@ using WebKit::WebCache; using WebKit::WebCrossOriginPreflightResultCache; using WebKit::WebFontCache; +using WebKit::WebRuntimeFeatures; namespace { @@ -379,6 +383,22 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver() { std::string error; base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error); #endif + + // Note that under Linux, the media library will normally already have + // been initialized by the Zygote before this instance became a Renderer. + FilePath media_path; + PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path); + if (!media_path.empty()) + media::InitializeMediaLibrary(media_path); + +#if !defined(OS_MACOSX) + // TODO(hclam): Add more checks here. Currently this is not used. + if (media::IsMediaLibraryInitialized() && + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableOpenMax)) { + media::InitializeOpenMaxLibrary(media_path); + } +#endif } ChromeRenderProcessObserver::~ChromeRenderProcessObserver() { @@ -405,6 +425,15 @@ bool ChromeRenderProcessObserver::OnControlMessageReceived( return handled; } +void ChromeRenderProcessObserver::WebKitInitialized() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + + WebRuntimeFeatures::enableMediaPlayer(media::IsMediaLibraryInitialized()); + + WebRuntimeFeatures::enableSpellCheckAPI( + !command_line.HasSwitch(switches::kDisableSpellcheckAPI)); +} + void ChromeRenderProcessObserver::OnSetIsIncognitoProcess( bool is_incognito_process) { is_incognito_process_ = is_incognito_process; diff --git a/chrome/renderer/chrome_render_process_observer.h b/chrome/renderer/chrome_render_process_observer.h index 8657d79..39506d5 100644 --- a/chrome/renderer/chrome_render_process_observer.h +++ b/chrome/renderer/chrome_render_process_observer.h @@ -30,6 +30,7 @@ class ChromeRenderProcessObserver : public RenderProcessObserver { private: // RenderProcessObserver implementation. virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; + virtual void WebKitInitialized() OVERRIDE; void OnSetIsIncognitoProcess(bool is_incognito_process); void OnSetContentSettingsForCurrentURL( diff --git a/content/browser/DEPS b/content/browser/DEPS index 2977484..2a04b2b 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -30,10 +30,6 @@ include_rules = [ "+chrome/browser/tab_contents/render_view_host_delegate_helper.h", - "+chrome/common/chrome_constants.h", - "+chrome/common/chrome_paths.h", - "+chrome/common/logging_chrome.h", - # ONLY USED BY TESTS "+chrome/browser/net/url_request_failed_dns_job.h", "+chrome/browser/net/url_request_mock_http_job.h", diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index bb2e10f..4c80634 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -6,7 +6,6 @@ #include "base/memory/ref_counted.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" -#include "chrome/common/chrome_constants.h" #include "chrome/test/testing_browser_process.h" #include "chrome/test/testing_browser_process_test.h" #include "chrome/test/thread_test_helper.h" @@ -15,6 +14,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/appcache/appcache_storage_impl.h" +namespace { +const FilePath::CharType kTestingAppCacheDirname[] = + FILE_PATH_LITERAL("Application Cache"); +} + namespace appcache { class ChromeAppCacheServiceTest : public TestingBrowserProcessTest { @@ -40,7 +44,7 @@ class ChromeAppCacheServiceTest : public TestingBrowserProcessTest { TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - FilePath appcache_path = temp_dir_.path().Append(chrome::kAppCacheDirname); + FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname); scoped_refptr<ChromeAppCacheService> appcache_service = new ChromeAppCacheService(NULL); const content::ResourceContext* resource_context = NULL; @@ -72,7 +76,7 @@ TEST_F(ChromeAppCacheServiceTest, KeepOnDestruction) { TEST_F(ChromeAppCacheServiceTest, RemoveOnDestruction) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - FilePath appcache_path = temp_dir_.path().Append(chrome::kAppCacheDirname); + FilePath appcache_path = temp_dir_.path().Append(kTestingAppCacheDirname); scoped_refptr<ChromeAppCacheService> appcache_service = new ChromeAppCacheService(NULL); const content::ResourceContext* resource_context = NULL; diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc index 0d30143..4a65aa0 100644 --- a/content/browser/browser_child_process_host.cc +++ b/content/browser/browser_child_process_host.cc @@ -13,7 +13,6 @@ #include "base/process_util.h" #include "base/stl_util-inl.h" #include "base/string_util.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/resource_message_filter.h" diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index c1b9111..d8344b5 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -19,8 +19,6 @@ #include "base/path_service.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/logging_chrome.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/browser/resolve_proxy_msg_helper.h" @@ -178,9 +176,6 @@ bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kPluginProcess); cmd_line->AppendSwitchPath(switches::kPluginPath, info.path); - if (logging::DialogsAreSuppressed()) - cmd_line->AppendSwitch(switches::kNoErrorDialogs); - // Propagate the following switches to the plugin command line (along with // any associated values) if present in the browser command line static const char* const kSwitchNames[] = { diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc index bbd2fe9..52bb519 100644 --- a/content/browser/plugin_service.cc +++ b/content/browser/plugin_service.cc @@ -14,7 +14,6 @@ #include "base/threading/thread.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "chrome/common/chrome_paths.h" #include "content/browser/browser_thread.h" #include "content/browser/content_browser_client.h" #include "content/browser/ppapi_plugin_process_host.h" @@ -106,14 +105,6 @@ PluginService::PluginService() registrar_.Add(this, NotificationType::APP_ACTIVATED, NotificationService::AllSources()); #elif defined(OS_POSIX) - // Also find plugins in a user-specific plugins dir, - // e.g. ~/.config/chromium/Plugins. - FilePath user_data_dir; - if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { - webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( - user_data_dir.Append("Plugins")); - } - // The FilePathWatcher produces too many false positives on MacOS (access time // updates?) which will lead to enforcing updates of the plugins way too often. // On ChromeOS the user can't install plugins anyway and on Windows all diff --git a/content/browser/plugin_service_browsertest.cc b/content/browser/plugin_service_browsertest.cc index 437e403..ba70b31 100644 --- a/content/browser/plugin_service_browsertest.cc +++ b/content/browser/plugin_service_browsertest.cc @@ -6,7 +6,6 @@ #include "base/command_line.h" #include "base/path_service.h" -#include "chrome/common/chrome_paths.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/browser_thread.h" diff --git a/content/browser/renderer_host/backing_store_manager.cc b/content/browser/renderer_host/backing_store_manager.cc index b39a24f..75c7ccd 100644 --- a/content/browser/renderer_host/backing_store_manager.cc +++ b/content/browser/renderer_host/backing_store_manager.cc @@ -7,7 +7,6 @@ #include "base/command_line.h" #include "base/memory/mru_cache.h" #include "base/sys_info.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/renderer_host/backing_store.h" #include "content/browser/renderer_host/render_widget_host.h" #include "content/common/content_switches.h" diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc index 1f40576..3b5dad0 100644 --- a/content/browser/renderer_host/browser_render_process_host.cc +++ b/content/browser/renderer_host/browser_render_process_host.cc @@ -27,8 +27,6 @@ #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/logging_chrome.h" #include "content/browser/appcache/appcache_dispatcher_host.h" #include "content/browser/browser_child_process_host.h" #include "content/browser/child_process_security_policy.h" @@ -472,9 +470,6 @@ void BrowserRenderProcessHost::AppendRendererCommandLine( is_extension_process_ ? switches::kExtensionProcess : switches::kRendererProcess); - if (logging::DialogsAreSuppressed()) - command_line->AppendSwitch(switches::kNoErrorDialogs); - if (accessibility_enabled_) command_line->AppendSwitch(switches::kEnableAccessibility); diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index 5466004..f58444f 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -6,10 +6,10 @@ #include "base/rand_util.h" #include "base/sys_info.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" #include "content/common/child_process_info.h" +#include "content/common/content_constants.h" #include "content/common/notification_service.h" namespace { @@ -51,7 +51,7 @@ size_t GetMaxRendererProcessCount() { if (!max_count) { size_t memory_tier = base::SysInfo::AmountOfPhysicalMemoryMB() / 256; if (memory_tier >= arraysize(kMaxRenderersByRamTier)) - max_count = chrome::kMaxRendererProcessCount; + max_count = content::kMaxRendererProcessCount; else max_count = kMaxRenderersByRamTier[memory_tier]; } diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc index df5f306..8a9ebce 100644 --- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc @@ -7,7 +7,6 @@ #include "base/path_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_paths.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/site_instance.h" diff --git a/content/browser/site_instance_unittest.cc b/content/browser/site_instance_unittest.cc index 6931e5a..4fb3670 100644 --- a/content/browser/site_instance_unittest.cc +++ b/content/browser/site_instance_unittest.cc @@ -5,7 +5,6 @@ #include "base/compiler_specific.h" #include "base/stl_util-inl.h" #include "base/string16.h" -#include "chrome/common/chrome_constants.h" #include "chrome/test/testing_profile.h" #include "content/browser/browser_thread.h" #include "content/browser/browsing_instance.h" @@ -19,6 +18,7 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/webui/empty_web_ui_factory.h" #include "content/common/content_client.h" +#include "content/common/content_constants.h" #include "content/common/url_constants.h" #include "testing/gtest/include/gtest/gtest.h" @@ -472,7 +472,7 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) { // Make a bunch of mock renderers so that we hit the limit. std::vector<MockRenderProcessHost*> hosts; - for (size_t i = 0; i < chrome::kMaxRendererProcessCount; ++i) + for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) hosts.push_back(new MockRenderProcessHost(NULL)); // Create some extension instances and make sure they share a process. @@ -502,7 +502,7 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) { // Make sure none of differing privilege processes are mixed. EXPECT_NE(extension1_instance->GetProcess(), webui1_instance->GetProcess()); - for (size_t i = 0; i < chrome::kMaxRendererProcessCount; ++i) { + for (size_t i = 0; i < content::kMaxRendererProcessCount; ++i) { EXPECT_NE(extension1_instance->GetProcess(), hosts[i]); EXPECT_NE(webui1_instance->GetProcess(), hosts[i]); } diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index f304a92..538bbfb 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -11,7 +11,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browser_url_handler.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/in_process_webkit/session_storage_namespace.h" #include "content/browser/site_instance.h" diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc index c8c81f4..3fb5f79 100644 --- a/content/browser/tab_contents/navigation_entry.cc +++ b/content/browser/tab_contents/navigation_entry.cc @@ -7,7 +7,6 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/site_instance.h" #include "content/common/content_constants.h" #include "content/common/url_constants.h" diff --git a/content/browser/zygote_host_linux.cc b/content/browser/zygote_host_linux.cc index b3ab212..328c603 100644 --- a/content/browser/zygote_host_linux.cc +++ b/content/browser/zygote_host_linux.cc @@ -22,7 +22,6 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/common/chrome_constants.h" #include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/render_sandbox_host_linux.h" #include "content/common/content_switches.h" diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc index 8a30120..99a7735 100644 --- a/content/browser/zygote_main_linux.cc +++ b/content/browser/zygote_main_linux.cc @@ -21,14 +21,12 @@ #include "base/hash_tables.h" #include "base/linux_util.h" #include "base/memory/scoped_ptr.h" -#include "base/path_service.h" #include "base/pickle.h" #include "base/process_util.h" #include "base/rand_util.h" #include "base/sys_info.h" #include "build/build_config.h" #include "crypto/nss_util.h" -#include "chrome/common/chrome_paths.h" #include "content/common/chrome_descriptors.h" #include "content/common/content_switches.h" #include "content/common/font_config_ipc_linux.h" @@ -39,7 +37,6 @@ #include "content/common/sandbox_methods_linux.h" #include "content/common/set_process_title.h" #include "content/common/unix_domain_socket_posix.h" -#include "media/base/media.h" #include "seccompsandbox/sandbox.h" #include "skia/ext/SkFontHost_fontconfig_control.h" #include "unicode/timezone.h" @@ -603,12 +600,6 @@ static void PreSandboxInit() { // cached and there's no more need to access the file system. scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); - // Each Renderer we spawn will re-attempt initialization of the media - // libraries, at which point failure will be detected and handled, so - // we do not need to cope with initialization failures here. - FilePath media_path; - if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) - media::InitializeMediaLibrary(media_path); #if defined(USE_NSS) // NSS libraries are loaded before sandbox is activated. This is to allow // successful initialization of NSS which tries to load extra library files. diff --git a/content/common/content_constants.cc b/content/common/content_constants.cc index 3ecda57..3118867 100644 --- a/content/common/content_constants.cc +++ b/content/common/content_constants.cc @@ -6,6 +6,8 @@ namespace content { +// This number used to be limited to 32 in the past (see b/535234). +const unsigned int kMaxRendererProcessCount = 42; const int kMaxSessionHistoryEntries = 50; const size_t kMaxTitleChars = 4 * 1024; const size_t kMaxURLChars = 2 * 1024 * 1024; diff --git a/content/common/content_constants.h b/content/common/content_constants.h index 05739ff..b34f4bf 100644 --- a/content/common/content_constants.h +++ b/content/common/content_constants.h @@ -12,6 +12,8 @@ namespace content { +extern const unsigned int kMaxRendererProcessCount; + // The maximum number of session history entries per tab. extern const int kMaxSessionHistoryEntries; diff --git a/content/renderer/content_renderer_client.cc b/content/renderer/content_renderer_client.cc index ff5822e..db96ca8 100644 --- a/content/renderer/content_renderer_client.cc +++ b/content/renderer/content_renderer_client.cc @@ -65,10 +65,6 @@ bool ContentRendererClient::WillSendRequest(WebFrame* frame, return false; } -FilePath ContentRendererClient::GetMediaLibraryPath() { - return FilePath(); -} - bool ContentRendererClient::ShouldPumpEventsDuringCookieMessage() { return false; } diff --git a/content/renderer/content_renderer_client.h b/content/renderer/content_renderer_client.h index 5c87bc6..3f012c1 100644 --- a/content/renderer/content_renderer_client.h +++ b/content/renderer/content_renderer_client.h @@ -83,9 +83,6 @@ class ContentRendererClient { const GURL& url, GURL* new_url); - // Returns the file path where the media library files are. - virtual FilePath GetMediaLibraryPath(); - // Whether to pump events when sending sync cookie messages. Needed if the // embedder can potentiall put up a modal dialog on the UI thread as a result. virtual bool ShouldPumpEventsDuringCookieMessage(); diff --git a/content/renderer/render_process.h b/content/renderer/render_process.h index 2fb2a61..8ae6611 100644 --- a/content/renderer/render_process.h +++ b/content/renderer/render_process.h @@ -48,8 +48,6 @@ class RenderProcess : public ChildProcess { // Returns true if plugisn should be loaded in-process. virtual bool UseInProcessPlugins() const = 0; - virtual bool HasInitializedMediaLibrary() const = 0; - // Returns a pointer to the RenderProcess singleton instance. Assuming that // we're actually a renderer or a renderer test, this static cast will // be correct. diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc index 1ded505..3e67c64 100644 --- a/content/renderer/render_process_impl.cc +++ b/content/renderer/render_process_impl.cc @@ -25,8 +25,6 @@ #include "content/renderer/render_view.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message_utils.h" -#include "media/base/media.h" -#include "media/base/media_switches.h" #include "skia/ext/platform_canvas.h" #include "ui/gfx/surface/transport_dib.h" #include "webkit/plugins/npapi/plugin_instance.h" @@ -74,22 +72,6 @@ RenderProcessImpl::RenderProcessImpl() webkit_glue::SetJavaScriptFlags( command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); } - - // Note that under Linux, the media library will normally already have - // been initialized by the Zygote before this instance became a Renderer. - FilePath media_path = - content::GetContentClient()->renderer()->GetMediaLibraryPath(); - if (!media_path.empty()) - media::InitializeMediaLibrary(media_path); - -#if !defined(OS_MACOSX) - // TODO(hclam): Add more checks here. Currently this is not used. - if (media::IsMediaLibraryInitialized() && - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableOpenMax)) { - media::InitializeOpenMaxLibrary(media_path); - } -#endif } RenderProcessImpl::~RenderProcessImpl() { @@ -195,10 +177,6 @@ bool RenderProcessImpl::UseInProcessPlugins() const { return in_process_plugins_; } -bool RenderProcessImpl::HasInitializedMediaLibrary() const { - return media::IsMediaLibraryInitialized(); -} - bool RenderProcessImpl::GetTransportDIBFromCache(TransportDIB** mem, size_t size) { // look for a cached object that is suitable for the requested size. diff --git a/content/renderer/render_process_impl.h b/content/renderer/render_process_impl.h index c5cbabe..7b74d6f 100644 --- a/content/renderer/render_process_impl.h +++ b/content/renderer/render_process_impl.h @@ -27,7 +27,6 @@ class RenderProcessImpl : public RenderProcess { const gfx::Rect& rect); virtual void ReleaseTransportDIB(TransportDIB* memory); virtual bool UseInProcessPlugins() const; - virtual bool HasInitializedMediaLibrary() const; // Like UseInProcessPlugins(), but called before RenderProcess is created // and does not allow overriding by tests. This just checks the command line diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc index b1eba86..3d9fc8b 100644 --- a/content/renderer/render_thread.cc +++ b/content/renderer/render_thread.cc @@ -569,9 +569,6 @@ void RenderThread::EnsureWebKitInitialized() { web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this)); WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); - WebRuntimeFeatures::enableMediaPlayer( - RenderProcess::current()->HasInitializedMediaLibrary()); - WebRuntimeFeatures::enableSockets( !command_line.HasSwitch(switches::kDisableWebSockets)); @@ -627,9 +624,6 @@ void RenderThread::EnsureWebKitInitialized() { WebRuntimeFeatures::enableQuota(true); - WebRuntimeFeatures::enableSpellCheckAPI( - !command_line.HasSwitch(switches::kDisableSpellcheckAPI)); - FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); } |