summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gpu_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/gpu/gpu_channel.cc9
-rw-r--r--chrome/gpu/gpu_main.cc6
-rw-r--r--chrome/renderer/render_widget.cc7
6 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index 3261814..fc10107 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -171,6 +171,7 @@ void GpuProcessHost::PropagateBrowserCommandLineToGpu(
static const char* const switch_names[] = {
switches::kDisableLogging,
switches::kEnableLogging,
+ switches::kGpuStartupDialog,
switches::kLoggingLevel,
};
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 8e0ce91..6935a15 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -373,6 +373,9 @@ const char kGpuLauncher[] = "gpu-launcher";
// Makes this process a GPU sub-process.
const char kGpuProcess[] = "gpu-process";
+// Causes the GPU process to display a dialog on launch.
+const char kGpuStartupDialog[] = "gpu-startup-dialog";
+
// Make Windows happy by allowing it to show "Enable access to this program"
// checkbox in Add/Remove Programs->Set Program Access and Defaults. This
// only shows an error box because the only way to hide Chrome is by
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 652a344..06cdaf3 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -117,6 +117,7 @@ extern const char kFirstRun[];
extern const char kForceFieldTestNameAndValue[];
extern const char kGpuLauncher[];
extern const char kGpuProcess[];
+extern const char kGpuStartupDialog[];
extern const char kHideIcons[];
extern const char kHomePage[];
extern const char kHostResolverRules[];
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc
index 25bb951..4269022 100644
--- a/chrome/gpu/gpu_channel.cc
+++ b/chrome/gpu/gpu_channel.cc
@@ -177,6 +177,15 @@ void GpuChannel::OnDestroyCommandBuffer(int route_id) {
bool GpuChannel::Init(const std::string& channel_name) {
channel_name_ = channel_name;
+#if defined(OS_POSIX)
+ // This gets called when the GpuChannel is initially created. At this
+ // point, create the socketpair and assign the GPU side FD to the channel
+ // name. Keep the renderer side FD as a member variable in the PluginChannel
+ // to be able to transmit it through IPC.
+ int gpu_fd;
+ IPC::SocketPair(&gpu_fd, &renderer_fd_);
+ IPC::AddChannelSocket(channel_name, gpu_fd);
+#endif
channel_.reset(new IPC::SyncChannel(
channel_name, IPC::Channel::MODE_SERVER, this, NULL,
ChildProcess::current()->io_message_loop(), false,
diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc
index c633025..86652e5 100644
--- a/chrome/gpu/gpu_main.cc
+++ b/chrome/gpu/gpu_main.cc
@@ -5,6 +5,7 @@
#include "base/message_loop.h"
#include "build/build_config.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/main_function_params.h"
#include "chrome/gpu/gpu_config.h"
#include "chrome/gpu/gpu_process.h"
@@ -28,6 +29,11 @@ int GpuMain(const MainFunctionParams& parameters) {
InitCrashReporter();
#endif
+ const CommandLine& command_line = parameters.command_line_;
+ if (command_line.HasSwitch(switches::kGpuStartupDialog)) {
+ ChildProcess::WaitForDebugger(L"Gpu");
+ }
+
MessageLoop main_message_loop(MessageLoop::TYPE_UI);
std::wstring app_name = chrome::kBrowserAppName;
PlatformThread::SetName(WideToASCII(app_name + L"_GpuMain").c_str());
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 5872150..def6e47 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -27,6 +27,7 @@
#include "webkit/glue/webkit_glue.h"
#if defined(OS_POSIX)
+#include "ipc/ipc_channel_posix.h"
#include "third_party/skia/include/core/SkPixelRef.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
#endif // defined(OS_POSIX)
@@ -733,6 +734,12 @@ void RenderWidget::OnSetTextDirection(WebTextDirection direction) {
void RenderWidget::OnGpuChannelEstablished(
const IPC::ChannelHandle& channel_handle) {
+#if defined(OS_POSIX)
+ // If we received a ChannelHandle, register it now.
+ if (channel_handle.socket.fd >= 0)
+ IPC::AddChannelSocket(channel_handle.name, channel_handle.socket.fd);
+#endif
+
if (channel_handle.name.size() != 0) {
// Connect to the GPU process if a channel name was received.
gpu_channel_->Connect(channel_handle.name);