From ae849ea693102dd66d5f01d9ad6799e0bde070d0 Mon Sep 17 00:00:00 2001 From: "kkania@chromium.org" Date: Wed, 20 Oct 2010 18:00:36 +0000 Subject: On Windows, create a new TransportDIB::Handle struct which includes the file mapping HANDLE and the source process ID. Duplicating the handle for the remote process is done in TransportDIB::Map, instead of in various #ifdefs scattered across the code. Also on windows, remove the struct for the TransportDIB::Id which contained both the sequence number and the HANDLE and replace it with just the sequence number. Fix ThumbnailGenerator by mapping the TransportDIB on Windows and adding a method to duplicate the file mapping handle before sending across the channel. Also, add a ScopedHandle and fix some handle leaks. BUG=none TEST=none Review URL: http://codereview.chromium.org/3834003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63232 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/render_widget_host.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'chrome/browser/renderer_host/render_widget_host.h') diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 6c3fed7..26d1c2c 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -480,7 +480,9 @@ class RenderWidgetHost : public IPC::Channel::Listener, void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size); void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); void OnMsgCreateVideo(const gfx::Size& size); - void OnMsgUpdateVideo(TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect); + void OnMsgUpdateVideo(TransportDIB::Id dib_id, + TransportDIB::Handle dib_handle, + const gfx::Rect& bitmap_rect); void OnMsgDestroyVideo(); void OnMsgInputEventAck(const IPC::Message& message); virtual void OnMsgFocus(); @@ -523,7 +525,8 @@ class RenderWidgetHost : public IPC::Channel::Listener, // synchronously, and the bitmap is done being used. False means that the // backing store will paint the bitmap at a later time and that the DIB can't // be freed (it will be the backing store's job to free it later). - void PaintBackingStoreRect(TransportDIB::Id bitmap, + void PaintBackingStoreRect(TransportDIB::Id dib_id, + TransportDIB::Handle dib_handle, const gfx::Rect& bitmap_rect, const std::vector& copy_rects, const gfx::Size& view_size, @@ -538,7 +541,8 @@ class RenderWidgetHost : public IPC::Channel::Listener, // Paints the entire given bitmap into the current video layer, if it exists. // |bitmap_rect| specifies the destination size and absolute location of the // bitmap on the backing store. - void PaintVideoLayer(TransportDIB::Id bitmap, + void PaintVideoLayer(TransportDIB::Id dib_id, + TransportDIB::Handle dib_handle, const gfx::Rect& bitmap_rect); // Called by OnMsgInputEventAck() to process a keyboard event ack message. -- cgit v1.1