Index: chrome/browser/gpu_process_host.cc |
=================================================================== |
--- chrome/browser/gpu_process_host.cc (revision 67491) |
+++ chrome/browser/gpu_process_host.cc (working copy) |
@@ -177,6 +177,9 @@ |
OnAcceleratedSurfaceSetIOSurface) |
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
OnAcceleratedSurfaceBuffersSwapped) |
+#elif defined(OS_WIN) |
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateCompositorHostWindow, |
+ OnCreateCompositorHostWindow) |
#endif |
// If the IO thread does not handle the message then automatically route it |
// to the UI thread. The UI thread will report an error if it does not |
@@ -305,8 +308,8 @@ |
class BuffersSwappedDispatcher : public Task { |
public: |
BuffersSwappedDispatcher( |
- int32 renderer_id, |
- int32 render_view_id, |
+ int renderer_id, |
+ int render_view_id, |
gfx::PluginWindowHandle window, |
uint64 surface_id, |
int32 route_id, |
@@ -338,8 +341,8 @@ |
} |
private: |
- int32 renderer_id_; |
- int32 render_view_id_; |
+ int renderer_id_; |
+ int render_view_id_; |
gfx::PluginWindowHandle window_; |
uint64 surface_id_; |
int32 route_id_; |
@@ -366,6 +369,47 @@ |
params.route_id, |
params.swap_buffers_count)); |
} |
+ |
+#elif defined(OS_WIN) |
+ |
+namespace { |
+ |
+void SendDelayedReply(IPC::Message* reply_msg) { |
+ GpuProcessHost::Get()->Send(reply_msg); |
+} |
+ |
+void CreateCompositorHostWindowDispatcher( |
+ int renderer_id, |
+ int render_view_id, |
+ IPC::Message* reply_msg) { |
+ RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
+ render_view_id); |
+ if (!host) { |
+ return; |
+ } |
+ |
+ RenderWidgetHostView* view = host->view(); |
+ gfx::PluginWindowHandle id = view->CreateCompositorHostWindow(); |
+ |
+ |
+ GpuHostMsg_CreateCompositorHostWindow::WriteReplyParams(reply_msg, id); |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ NewRunnableFunction(&SendDelayedReply, reply_msg)); |
+} |
+ |
+} // namespace |
+ |
+void GpuProcessHost::OnCreateCompositorHostWindow( |
+ int renderer_id, |
+ int render_view_id, |
+ IPC::Message* reply_message) { |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, FROM_HERE, |
+ NewRunnableFunction(&CreateCompositorHostWindowDispatcher, |
+ renderer_id, render_view_id, reply_message)); |
+} |
+ |
#endif |
void GpuProcessHost::SendEstablishChannelReply( |