Commit db8562c1 authored by shess@chromium.org's avatar shess@chromium.org

Enable --single-process for Mac and Linux.

Additionally, wire in a bit of setup for the --single-process case,
because it cannot be done by the renderer thread because that thread
is not the main thread.

Fair warning: --single-process often seems to be broken by various
unrelated changes, which may-or-may-not make assumptions about the
process architecture.  I will try to stay on top of these.

Review URL: http://codereview.chromium.org/21330

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10559 0039d316-1c4b-4281-b951-d872f2087c98
parent 2c4f5143
......@@ -32,9 +32,9 @@
#include "base/string_util.h"
#if defined(OS_WIN)
#include "base/win_util.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#endif
#include "chrome/app/scoped_ole_initializer.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_counters.h"
#include "chrome/common/chrome_paths.h"
......@@ -47,6 +47,9 @@
#include "sandbox/src/sandbox.h"
#include "tools/memory_watcher/memory_watcher.h"
#endif
#if defined(OS_MACOSX)
#include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
#endif
extern int BrowserMain(const MainFunctionParams&);
extern int RendererMain(const MainFunctionParams&);
......@@ -275,13 +278,18 @@ int ChromeMain(int argc, const char** argv) {
if (!user_data_dir.empty())
PathService::Override(chrome::DIR_USER_DATA, user_data_dir);
#if defined(OS_WIN)
// TODO(port): pull in when render_process_host.h compiles on posix. There's
// nothing win-specific about these lines.
bool single_process =
parsed_command_line.HasSwitch(switches::kSingleProcess);
if (single_process)
RenderProcessHost::set_run_renderer_in_process(true);
#if defined(OS_MACOSX)
// TODO(port-mac): This is from renderer_main_platform_delegate.cc.
// shess tried to refactor things appropriately, but it sprawled out
// of control because different platforms needed different styles of
// initialization. Try again once we understand the process
// architecture needed and where it should live.
if (single_process)
InitWebCoreSystemInterface();
#endif
bool icu_result = icu_util::Initialize();
......
......@@ -25,6 +25,9 @@ RendererMainPlatformDelegate::RendererMainPlatformDelegate(
RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
}
// TODO(mac-port): Any code needed to initialize a process for
// purposes of running a renderer needs to also be reflected in
// chrome_dll_main.cc for --single-process support.
void RendererMainPlatformDelegate::PlatformInitialize() {
// Load WebKit system interfaces.
InitWebCoreSystemInterface();
......
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