summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gpu_process_host.cc13
-rw-r--r--chrome/browser/gpu_process_host.h1
-rw-r--r--chrome/common/gpu_messages_internal.h5
-rw-r--r--chrome/gpu/gpu_command_buffer_stub.cc4
4 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index c321f97..eeb50bd 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -171,6 +171,7 @@ void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, OnSynchronizeReply)
#if defined(OS_LINUX)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetViewXID, OnGetViewXID)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ReleaseXID, OnReleaseXID)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID)
#elif defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface,
@@ -228,6 +229,11 @@ void GetViewXIDDispatcher(gfx::NativeViewId id, IPC::Message* reply_msg) {
NewRunnableFunction(&SendDelayedReply, reply_msg));
}
+void ReleaseXIDDispatcher(unsigned long xid) {
+ GtkNativeViewManager* manager = Singleton<GtkNativeViewManager>::get();
+ manager->ReleasePermanentXID(xid);
+}
+
void ResizeXIDDispatcher(unsigned long xid, gfx::Size size,
IPC::Message *reply_msg) {
GdkWindow* window = reinterpret_cast<GdkWindow*>(gdk_xid_table_lookup(xid));
@@ -255,6 +261,13 @@ void GpuProcessHost::OnGetViewXID(gfx::NativeViewId id,
NewRunnableFunction(&GetViewXIDDispatcher, id, reply_msg));
}
+void GpuProcessHost::OnReleaseXID(unsigned long xid) {
+ // Have to release a permanent XID from UI thread.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&ReleaseXIDDispatcher, xid));
+}
+
void GpuProcessHost::OnResizeXID(unsigned long xid, gfx::Size size,
IPC::Message *reply_msg) {
// Have to resize the window from UI thread.
diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h
index 8219355..05ae39e 100644
--- a/chrome/browser/gpu_process_host.h
+++ b/chrome/browser/gpu_process_host.h
@@ -87,6 +87,7 @@ class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe {
void OnSynchronizeReply();
#if defined(OS_LINUX)
void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg);
+ void OnReleaseXID(unsigned long xid);
void OnResizeXID(unsigned long xid, gfx::Size size, IPC::Message* reply_msg);
#elif defined(OS_MACOSX)
void OnAcceleratedSurfaceSetIOSurface(
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h
index 10b0961..6ad6449 100644
--- a/chrome/common/gpu_messages_internal.h
+++ b/chrome/common/gpu_messages_internal.h
@@ -94,6 +94,11 @@ IPC_BEGIN_MESSAGES(GpuHost)
gfx::NativeViewId, /* view */
unsigned long /* xid */)
+ // Release the lock on the window.
+ // If the associated view has been destroyed, destroy the window.
+ IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID,
+ unsigned long /* xid */)
+
IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID,
unsigned long, /* xid */
gfx::Size, /* size */
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc
index 3c87c99..6112782 100644
--- a/chrome/gpu/gpu_command_buffer_stub.cc
+++ b/chrome/gpu/gpu_command_buffer_stub.cc
@@ -159,6 +159,10 @@ GpuCommandBufferStub::~GpuCommandBufferStub() {
DestroyWindow(static_cast<HWND>(compositor_window_));
compositor_window_ = NULL;
}
+#elif defined(OS_LINUX)
+ ChildThread* gpu_thread = ChildThread::current();
+ gpu_thread->Send(
+ new GpuHostMsg_ReleaseXID(handle_));
#endif
}