Commit 0a999393 authored by scottmg@chromium.org's avatar scottmg@chromium.org

Add chrome_split_dll gyp variable, and duplicate chrome_main_dll target

Currently contains chrome_browser_dll target. Removes some paths from browser->webcore
via content that are there due to single process mode, and removes dependency of content
on content_renderer.

Current remaining paths from chrome_browser_dll to webcore: http://i.imgur.com/7WWRvpA.jpg

R=cpu@chromium.org
BUG=237249

Review URL: https://chromiumcodereview.appspot.com/14682014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198834 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d2d5a40
......@@ -888,6 +888,10 @@
# to get incremental linking to be faster in debug builds.
'incremental_chrome_dll%': '0',
# Experimental setting to break chrome.dll in to chrome_browser.dll and
# chrome_child.dll.
'chrome_split_dll%': '0',
# The default settings for third party code for treating
# warnings-as-errors. Ideally, this would not be required, however there
# is some third party code that takes a long time to fix/roll. So, this
......@@ -1809,6 +1813,9 @@
'<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
],
}],
['chrome_split_dll', {
'defines': ['CHROME_SPLIT_DLL'],
}],
['OS=="linux" and clang==1 and host_arch=="ia32"', {
# TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
# See http://crbug.com/162818.
......
......@@ -88,12 +88,16 @@
base::LazyInstance<chrome::ChromeContentBrowserClient>
g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER;
// TODO(scottmg): http://crbug.com/237249 This will have to be split out into
// browser and child parts.
#if !defined(CHROME_SPLIT_DLL)
base::LazyInstance<chrome::ChromeContentRendererClient>
g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<chrome::ChromeContentUtilityClient>
g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<chrome::ChromeContentPluginClient>
g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
#endif
extern int NaClMain(const content::MainFunctionParams&);
extern int ServiceProcessMain(const content::MainFunctionParams&);
......@@ -631,7 +635,8 @@ int ChromeMainDelegate::RunProcess(
{ switches::kRelauncherProcess,
mac_relauncher::internal::RelauncherMain },
#endif
#if !defined(DISABLE_NACL)
// TODO(scottmg): http://crbug.com/237249 NaCl -> child.
#if !defined(DISABLE_NACL) && !defined(CHROME_SPLIT_DLL)
{ switches::kNaClLoaderProcess, NaClMain },
#endif // DISABLE_NACL
};
......@@ -705,15 +710,33 @@ content::ContentBrowserClient*
}
content::ContentPluginClient* ChromeMainDelegate::CreateContentPluginClient() {
// TODO(scottmg): http://crbug.com/237249 This will have to be split out into
// browser and child parts.
#if defined(CHROME_SPLIT_DLL)
return NULL;
#else
return &g_chrome_content_plugin_client.Get();
#endif
}
content::ContentRendererClient*
ChromeMainDelegate::CreateContentRendererClient() {
// TODO(scottmg): http://crbug.com/237249 This will have to be split out into
// browser and child parts.
#if defined(CHROME_SPLIT_DLL)
return NULL;
#else
return &g_chrome_content_renderer_client.Get();
#endif
}
content::ContentUtilityClient*
ChromeMainDelegate::CreateContentUtilityClient() {
// TODO(scottmg): http://crbug.com/237249 This will have to be split out into
// browser and child parts.
#if defined(CHROME_SPLIT_DLL)
return NULL;
#else
return &g_chrome_content_utility_client.Get();
#endif
}
......@@ -10,12 +10,17 @@
# the link of the actual chrome (or chromium) executable on
# Linux or Mac, and into chrome.dll on Windows.
# NOTE: Most new includes should go in the OS!="ios" condition below.
'chromium_dependencies': [
'chromium_browser_dependencies': [
'common',
'browser',
'../content/content.gyp:content_app',
'../sync/sync.gyp:sync',
],
'chromium_child_dependencies': [
'common',
'../content/content.gyp:content_app',
'../sync/sync.gyp:sync',
],
'allocator_target': '../base/allocator/allocator.gyp:allocator',
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
......@@ -24,7 +29,12 @@
'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'],
'conditions': [
['OS!="ios"', {
'chromium_dependencies': [
'chromium_browser_dependencies': [
'debugger',
'../content/content.gyp:content_ppapi_plugin',
'../printing/printing.gyp:printing',
],
'chromium_child_dependencies': [
'debugger',
'plugin',
'renderer',
......@@ -46,7 +56,7 @@
'app/resources/locale_settings_win.grd',
},],
['OS!="android" and OS!="ios"', {
'chromium_dependencies': [
'chromium_browser_dependencies': [
# Android doesn't use the service process (only needed for print).
'service',
],
......
......@@ -2,6 +2,75 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'browser_dll_sources': [
'app/chrome_command_ids.h',
'app/chrome_dll.rc',
'app/chrome_dll_resource.h',
'app/chrome_main.cc',
'app/chrome_main_delegate.cc',
'app/chrome_main_delegate.h',
'app/delay_load_hook_win.cc',
'app/delay_load_hook_win.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
'../base/win/dllmain.cc',
'../ui/resources/cursors/aliasb.cur',
'../ui/resources/cursors/cell.cur',
'../ui/resources/cursors/col_resize.cur',
'../ui/resources/cursors/copy.cur',
'../ui/resources/cursors/none.cur',
'../ui/resources/cursors/row_resize.cur',
'../ui/resources/cursors/vertical_text.cur',
'../ui/resources/cursors/zoom_in.cur',
'../ui/resources/cursors/zoom_out.cur',
# TODO: It would be nice to have these pulled in
# automatically from direct_dependent_settings in
# their various targets (net.gyp:net_resources, etc.),
# but that causes errors in other targets when
# resulting .res files get referenced multiple times.
'<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
],
'delay_load_dlls_win': [
'comdlg32.dll',
'crypt32.dll',
'cryptui.dll',
'dhcpcsvc.dll',
'imagehlp.dll',
'imm32.dll',
'iphlpapi.dll',
'setupapi.dll',
'urlmon.dll',
'winhttp.dll',
'wininet.dll',
'winspool.drv',
'ws2_32.dll',
'wsock32.dll',
],
'browser_dependencies_win': [
# On Windows, link the dependencies (libraries) that make
# up actual Chromium functionality into this .dll.
'chrome_resources.gyp:chrome_resources',
'chrome_version_resources',
'../chrome/chrome_resources.gyp:chrome_unscaled_resources',
'../crypto/crypto.gyp:crypto',
'../printing/printing.gyp:printing',
'../net/net.gyp:net_resources',
'../third_party/cld/cld.gyp:cld',
'../ui/views/views.gyp:views',
'../webkit/support/webkit_support.gyp:webkit_resources',
],
'manifest_files_win': '$(ProjectDir)\\app\\chrome.dll.manifest',
},
'conditions': [
['OS=="mac" or OS=="win"', {
'targets': [
......@@ -74,7 +143,10 @@
'enable_wexit_time_destructors': 1,
},
'dependencies': [
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
'chrome_dll_pdb_workaround',
'../content/content.gyp:content_worker',
'app/policy/cloud_policy_codegen.gyp:policy',
],
'conditions': [
......@@ -98,66 +170,14 @@
['OS=="win"', {
'product_name': 'chrome',
'dependencies': [
# On Windows, link the dependencies (libraries) that make
# up actual Chromium functionality into this .dll.
'chrome_dll_pdb_workaround',
'chrome_resources.gyp:chrome_resources',
'chrome_version_resources',
'../chrome/chrome_resources.gyp:chrome_unscaled_resources',
'../content/content.gyp:content_worker',
'../crypto/crypto.gyp:crypto',
'../printing/printing.gyp:printing',
'../net/net.gyp:net_resources',
'../third_party/cld/cld.gyp:cld',
'../ui/views/views.gyp:views',
'../webkit/support/webkit_support.gyp:webkit_resources',
'<@(browser_dependencies_win)',
],
'sources': [
'app/chrome_command_ids.h',
'app/chrome_dll.rc',
'app/chrome_dll_resource.h',
'app/chrome_main.cc',
'app/chrome_main_delegate.cc',
'app/chrome_main_delegate.h',
'app/delay_load_hook_win.cc',
'app/delay_load_hook_win.h',
'<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
'../base/win/dllmain.cc',
'../ui/resources/cursors/aliasb.cur',
'../ui/resources/cursors/cell.cur',
'../ui/resources/cursors/col_resize.cur',
'../ui/resources/cursors/copy.cur',
'../ui/resources/cursors/none.cur',
'../ui/resources/cursors/row_resize.cur',
'../ui/resources/cursors/vertical_text.cur',
'../ui/resources/cursors/zoom_in.cur',
'../ui/resources/cursors/zoom_out.cur',
# TODO: It would be nice to have these pulled in
# automatically from direct_dependent_settings in
# their various targets (net.gyp:net_resources, etc.),
# but that causes errors in other targets when
# resulting .res files get referenced multiple times.
'<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
'<@(browser_dll_sources)',
],
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
],
'defines': [
'CHROME_DLL',
'BROWSER_DLL',
'RENDERER_DLL',
'PLUGIN_DLL',
],
'configurations': {
'Debug_Base': {
'msvs_settings': {
......@@ -210,24 +230,11 @@
}],
],
'DelayLoadDLLs': [
'comdlg32.dll',
'crypt32.dll',
'cryptui.dll',
'dhcpcsvc.dll',
'imagehlp.dll',
'imm32.dll',
'iphlpapi.dll',
'setupapi.dll',
'urlmon.dll',
'winhttp.dll',
'wininet.dll',
'winspool.drv',
'ws2_32.dll',
'wsock32.dll',
'<@(delay_load_dlls_win)',
],
},
'VCManifestTool': {
'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.dll.manifest',
'AdditionalManifestFiles': '<(manifest_files_win)',
},
},
}], # OS=="win"
......@@ -297,7 +304,59 @@
], # conditions
}], # OS=="mac"
], # conditions
}, # target chrome_dll
}, # target chrome_main_dll
{
'target_name': 'chrome_browser_dll',
'type': 'shared_library',
'variables': {
'enable_wexit_time_destructors': 1,
},
'dependencies': [
'<@(chromium_browser_dependencies)',
'app/policy/cloud_policy_codegen.gyp:policy',
# TODO(scottmg): http://crbug.com/237249 Probably should be
# renderer.
'../ppapi/ppapi_internal.gyp:ppapi_host',
],
'conditions': [
['use_aura==1', {
'dependencies': [
'../ui/compositor/compositor.gyp:compositor',
],
}],
['use_ash==1', {
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/ash/ash_resources/ash_wallpaper_resources.rc',
],
}],
['OS=="win"', {
'product_name': 'chrome_browser',
'dependencies': [
'<@(browser_dependencies_win)',
],
'sources': [
'<@(browser_dll_sources)',
],
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
],
'msvs_settings': {
'VCLinkerTool': {
'BaseAddress': '0x01c30000',
'ImportLibrary': '$(OutDir)\\lib\\chrome_browser_dll.lib',
# Set /SUBSYSTEM:WINDOWS for chrome_browser.dll (for consistency).
'SubSystem': '2',
'DelayLoadDLLs': [
'<@(delay_load_dlls_win)',
],
},
'VCManifestTool': {
'AdditionalManifestFiles': '<(manifest_files_win)',
},
},
}], # OS=="win"
], # conditions
}, # target chrome_browser_dll
], # targets
}], # OS=="mac" or OS=="win"
['OS=="win"', {
......
......@@ -142,7 +142,8 @@
'dependencies': [
# On Linux, link the dependencies (libraries) that make up actual
# Chromium functionality directly into the executable.
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
# Needed for chrome_main.cc initialization of libraries.
'../build/linux/system.gyp:gtk',
# Needed to use the master_preferences functions
......@@ -152,7 +153,8 @@
'dependencies': [
# On Linux, link the dependencies (libraries) that make up actual
# Chromium functionality directly into the executable.
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
# Needed for chrome_main.cc initialization of libraries.
'../build/linux/system.gyp:x11',
'../build/linux/system.gyp:pangocairo',
......
......@@ -413,7 +413,8 @@
# dependencies block below, rather than here.
# Unit tests should only depend on:
# 1) everything that the chrome binaries depend on:
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
# 2) test-specific support libraries:
'../base/base.gyp:test_support_base',
'../media/media.gyp:media_test_support',
......@@ -2394,7 +2395,8 @@
'dependencies': [
# unit tests should only depend on
# 1) everything that the chrome binaries depend on:
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
# 2) test-specific support libraries:
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
......
......@@ -102,7 +102,8 @@
'chrome',
],
'dependencies': [
'<@(chromium_dependencies)',
'<@(chromium_browser_dependencies)',
'<@(chromium_child_dependencies)',
'chrome_resources.gyp:packed_resources',
'chrome_resources.gyp:packed_extra_resources',
],
......
......@@ -165,7 +165,8 @@ namespace content {
base::LazyInstance<ContentBrowserClient>
g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER;
#if !defined(OS_IOS)
// TODO(scottmg): http://crbug.com/237249 Split into browser and child.
#if !defined(OS_IOS) && !defined(CHROME_SPLIT_DLL)
base::LazyInstance<ContentPluginClient>
g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<ContentRendererClient>
......@@ -297,8 +298,13 @@ class ContentClientInitializer {
process_type == switches::kPpapiPluginProcess) {
if (delegate)
content_client->plugin_ = delegate->CreateContentPluginClient();
// TODO(scottmg): http://crbug.com/237249 Should be in _child.
#if !defined(CHROME_SPLIT_DLL)
if (!content_client->plugin_)
content_client->plugin_ = &g_empty_content_plugin_client.Get();
#endif
// Single process not supported in split dll mode.
#if !defined(CHROME_SPLIT_DLL)
} else if (process_type == switches::kRendererProcess ||
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) {
......@@ -306,11 +312,15 @@ class ContentClientInitializer {
content_client->renderer_ = delegate->CreateContentRendererClient();
if (!content_client->renderer_)
content_client->renderer_ = &g_empty_content_renderer_client.Get();
#endif
} else if (process_type == switches::kUtilityProcess) {
if (delegate)
content_client->utility_ = delegate->CreateContentUtilityClient();
// TODO(scottmg): http://crbug.com/237249 Should be in _child.
#if !defined(CHROME_SPLIT_DLL)
if (!content_client->utility_)
content_client->utility_ = &g_empty_content_utility_client.Get();
#endif
}
#endif // !OS_IOS
}
......@@ -401,14 +411,22 @@ int RunNamedProcessTypeMain(
ContentMainDelegate* delegate) {
static const MainFunction kMainFunctions[] = {
{ "", BrowserMain },
{ switches::kRendererProcess, RendererMain },
#if defined(ENABLE_PLUGINS)
// TODO(scottmg): http://crbug.com/237249 This will have to be split into
// content_main_runner_browser and content_main_runner_child.
#if !defined(CHROME_SPLIT_DLL)
{ switches::kPluginProcess, PluginMain },
{ switches::kWorkerProcess, WorkerMain },
#endif
{ switches::kPpapiPluginProcess, PpapiPluginMain },
{ switches::kPpapiBrokerProcess, PpapiBrokerMain },
#endif
// TODO(scottmg): http://crbug.com/237249 This will have to be split into
// content_main_runner_browser and content_main_runner_child.
#if !defined(CHROME_SPLIT_DLL)
{ switches::kUtilityProcess, UtilityMain },
{ switches::kRendererProcess, RendererMain },
#endif
{ switches::kGpuProcess, GpuMain },
};
......
......@@ -496,6 +496,8 @@ bool RenderProcessHostImpl::Init() {
CreateMessageFilters();
// Single-process mode not supported in split-dll mode.
#if !defined(CHROME_SPLIT_DLL)
if (run_renderer_in_process()) {
// Crank up a thread and run the initialization there. With the way that
// messages flow between the browser and renderer, this thread is required
......@@ -517,7 +519,9 @@ bool RenderProcessHostImpl::Init() {
in_process_renderer_->StartWithOptions(options);
OnProcessLaunched(); // Fake a callback that the process is ready.
} else {
} else
#endif // !CHROME_SPLIT_DLL
{
// Build command line for renderer. We call AppendRendererCommandLine()
// first so the process type argument will appear first.
CommandLine* cmd_line = new CommandLine(renderer_path);
......
......@@ -64,7 +64,7 @@
'content_common',
],
'conditions': [
['OS != "ios"', {
['OS != "ios" and chrome_split_dll != 1', {
'dependencies': [
'content_gpu',
'content_plugin',
......@@ -99,12 +99,17 @@
'content_resources.gyp:content_resources',
],
'conditions': [
['OS != "ios"', {
['OS != "ios" and chrome_split_dll != 1', {
'dependencies': [
'content_gpu',
'content_renderer',
],
}],
['chrome_split_dll', {
'dependencies': [
'content_gpu',
],
}],
],
},
{
......
......@@ -61,7 +61,8 @@ ContentPluginClient* ContentMainDelegate::CreateContentPluginClient() {
}
ContentRendererClient* ContentMainDelegate::CreateContentRendererClient() {
#if defined(OS_IOS)
// TODO(scottmg): http://crbug.com/237249 Need split for chrome_child.dll.
#if defined(OS_IOS) || defined(CHROME_SPLIT_DLL)
return NULL;
#else
return new ContentRendererClient();
......@@ -69,7 +70,8 @@ ContentRendererClient* ContentMainDelegate::CreateContentRendererClient() {
}
ContentUtilityClient* ContentMainDelegate::CreateContentUtilityClient() {
#if defined(OS_IOS)
// TODO(scottmg): http://crbug.com/237249 Need split for chrome_child.dll.
#if defined(OS_IOS) || defined(CHROME_SPLIT_DLL)
return NULL;
#else
return new ContentUtilityClient();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment