summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/browser_render_process_host.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 05:15:42 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 05:15:42 +0000
commit7c4ea146bc033d89c1a0d527ae3d43b587a23cab (patch)
tree293c4da0b8fa44e5d4939c410434c51c8ffb872c /chrome/browser/renderer_host/browser_render_process_host.cc
parent877cbee0688984a2a00ce074f981bdfb1e42abfa (diff)
downloadchromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.zip
chromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.tar.gz
chromium_src-7c4ea146bc033d89c1a0d527ae3d43b587a23cab.tar.bz2
Create initial GPU backing store in the GPU process for X windows applications.
This gets the window from the RenderWidgetHostViewGtk and just does OpenGL calls directly into it. There are a lot of bugs, especially around expose events, which aren't really processed at all, and also tab teardown and reparenting. The new backing store defaults to off. This does some refactoring of the existing Windows GPU process backing store implementation to make some of it sharable by this Linux verion. This removes some previously defunct in-process GL backing store code and moves it to the GPU process. This patch does some refactoring around how child processes are created using zygoes or not. I found there were many places where a command line would be checked with special logic to know whether to enable zygote code or not. I tried to unify this so it could be computed once for each process type. This is what most of the changed files in chrome/browser are related to. BUG=none TEST=none Review URL: http://codereview.chromium.org/548112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/browser_render_process_host.cc')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 3ca726c..b4e57df 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -271,9 +271,19 @@ bool BrowserRenderProcessHost::Init(bool is_extensions_process,
widget_helper_,
request_context);
+ std::wstring renderer_prefix;
+#if defined(OS_POSIX)
+ // A command prefix is something prepended to the command line of the spawned
+ // process. It is supported only on POSIX systems.
+ const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+ renderer_prefix =
+ browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix);
+#endif // defined(OS_POSIX)
+
// Find the renderer before creating the channel so if this fails early we
// return without creating the channel.
- FilePath renderer_path = ChildProcessHost::GetChildPath();
+ FilePath renderer_path = ChildProcessHost::GetChildPath(
+ renderer_prefix.empty());
if (renderer_path.empty())
return false;
@@ -315,15 +325,20 @@ bool BrowserRenderProcessHost::Init(bool is_extensions_process,
// Build command line for renderer. We call AppendRendererCommandLine()
// first so the process type argument will appear first.
CommandLine* cmd_line = new CommandLine(renderer_path);
+ if (!renderer_prefix.empty())
+ cmd_line->PrependWrapper(renderer_prefix);
AppendRendererCommandLine(cmd_line);
cmd_line->AppendSwitchWithValue(switches::kProcessChannelID,
ASCIIToWide(channel_id));
// Spawn the child process asynchronously to avoid blocking the UI thread.
+ // As long as there's no renderer prefix, we can use the zygote process
+ // at this stage.
child_process_.reset(new ChildProcessLauncher(
#if defined(OS_WIN)
FilePath(),
#elif defined(POSIX)
+ renderer_prefix.empty(),
base::environment_vector(),
channel_->GetClientFileDescriptor(),
#endif
@@ -453,17 +468,6 @@ void BrowserRenderProcessHost::AppendRendererCommandLine(
field_trial_states);
}
- // A command prefix is something prepended to the command line of the spawned
- // process. It is supported only on POSIX systems.
-#if defined(OS_POSIX)
- if (browser_command_line.HasSwitch(switches::kRendererCmdPrefix)) {
- // launch the renderer child with some prefix (usually "gdb --args")
- const std::wstring prefix =
- browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix);
- command_line->PrependWrapper(prefix);
- }
-#endif // defined(OS_POSIX)
-
ChildProcessHost::SetCrashReporterCommandLine(command_line);
const std::string user_data_dir =