Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 3834003: On Windows, create a new TransportDIB::Handle struct which includes the file (Closed)

Created:
10 years, 2 months ago by kkania
Modified:
9 years, 7 months ago
CC:
chromium-reviews, vrk (LEFT CHROMIUM), fbarchard, Alpha Left Google, ben+cc_chromium.org, brettw-cc_chromium.org, jam, apatrick_chromium, darin-cc_chromium.org, awong, Paweł Hajdan Jr., pam+watch_chromium.org, stuartmorgan+watch_chromium.org, scherkus (not reviewing)
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=63232

Patch Set 1 #

Patch Set 2 : Add ScopedHandle #

Total comments: 6

Patch Set 3 : Added comments and made is_valid inline #

Patch Set 4 : Rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+538 lines, -323 lines) Patch
M app/surface/transport_dib.h View 1 2 6 chunks +115 lines, -33 lines 0 comments Download
M app/surface/transport_dib_linux.cc View 1 2 chunks +36 lines, -10 lines 0 comments Download
M app/surface/transport_dib_mac.cc View 1 2 chunks +35 lines, -20 lines 3 comments Download
M app/surface/transport_dib_win.cc View 1 2 2 chunks +108 lines, -20 lines 0 comments Download
M chrome/browser/renderer_host/backing_store.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_mac.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_mac.mm View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/backing_store_manager.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_manager.cc View 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/backing_store_proxy.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_proxy.cc View 1 2 chunks +4 lines, -13 lines 0 comments Download
M chrome/browser/renderer_host/backing_store_win.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_win.cc View 1 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/backing_store_x.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/backing_store_x.cc View 1 2 3 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.h View 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 1 2 3 2 chunks +9 lines, -12 lines 0 comments Download
M chrome/browser/renderer_host/mock_render_process_host.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/mock_render_process_host.cc View 1 2 3 1 chunk +6 lines, -9 lines 0 comments Download
M chrome/browser/renderer_host/render_process_host.h View 1 2 3 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 8 chunks +25 lines, -11 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/test/test_backing_store.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/test/test_backing_store.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/video_layer.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/video_layer_proxy.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/video_layer_proxy.cc View 1 2 chunks +4 lines, -10 lines 0 comments Download
M chrome/browser/renderer_host/video_layer_x.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/video_layer_x.cc View 1 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/thumbnail_generator.cc View 1 2 3 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/common/common_param_traits.h View 2 chunks +25 lines, -10 lines 0 comments Download
M chrome/common/gpu_messages_internal.h View 1 2 3 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/render_messages_params.h View 1 2 3 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/common/render_messages_params.cc View 1 2 3 4 chunks +10 lines, -6 lines 0 comments Download
M chrome/gpu/gpu_backing_store_glx.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/gpu/gpu_backing_store_glx.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/gpu/gpu_backing_store_win.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/gpu/gpu_backing_store_win.cc View 2 chunks +2 lines, -14 lines 0 comments Download
M chrome/gpu/gpu_video_layer_glx.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/gpu/gpu_video_layer_glx.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/plugin/webplugin_proxy.h View 1 2 3 2 chunks +1 line, -3 lines 0 comments Download
M chrome/plugin/webplugin_proxy.cc View 1 2 3 5 chunks +40 lines, -71 lines 0 comments Download
M chrome/renderer/media/ipc_video_renderer.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/nacl_desc_wrapper_chrome.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/render_widget.cc View 1 2 3 7 chunks +16 lines, -15 lines 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.cc View 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
kkania
First patch is the unrevert, second is my latest additions. I'll delete the other code ...
10 years, 2 months ago (2010-10-15 19:25:23 UTC) #1
brettw
Thanks for the much improved diff. I just have some minor comments. http://codereview.chromium.org/3834003/diff/2001/3001 File app/surface/transport_dib.h ...
10 years, 2 months ago (2010-10-18 19:51:16 UTC) #2
kkania
http://codereview.chromium.org/3834003/diff/2001/3001 File app/surface/transport_dib.h (right): http://codereview.chromium.org/3834003/diff/2001/3001#newcode64 app/surface/transport_dib.h:64: void Close() const; On 2010/10/18 19:51:17, brettw wrote: > ...
10 years, 2 months ago (2010-10-18 20:31:18 UTC) #3
brettw
LGTM
10 years, 2 months ago (2010-10-18 23:17:50 UTC) #4
Scott Hess - ex-Googler
http://codereview.chromium.org/3834003/diff/36001/37003 File app/surface/transport_dib_mac.cc (right): http://codereview.chromium.org/3834003/diff/36001/37003#newcode19 app/surface/transport_dib_mac.cc:19: } AFAICT, handle_ is a file descriptor, and since ...
10 years, 2 months ago (2010-10-25 21:38:18 UTC) #5
kkania
http://codereview.chromium.org/3834003/diff/36001/37003 File app/surface/transport_dib_mac.cc (right): http://codereview.chromium.org/3834003/diff/36001/37003#newcode19 app/surface/transport_dib_mac.cc:19: } On 2010/10/25 21:38:19, shess wrote: > AFAICT, handle_ ...
10 years, 1 month ago (2010-10-27 18:12:59 UTC) #6
Scott Hess - ex-Googler
10 years, 1 month ago (2010-10-27 19:34:01 UTC) #7
http://codereview.chromium.org/3834003/diff/36001/37003
File app/surface/transport_dib_mac.cc (right):

http://codereview.chromium.org/3834003/diff/36001/37003#newcode19
app/surface/transport_dib_mac.cc:19: }
On 2010/10/27 18:12:59, kkania wrote:
> On 2010/10/25 21:38:19, shess wrote:
> > AFAICT, handle_ is a file descriptor, and since this doesn't reset to
> > DefaultHandle(), if Close() is called outside the destructor, it will be
> called
> > again in the destructor, which may result in closing someone else's file
> > descriptor.
> > 
> > Or did I miss something?
> > 
> > See http://crbug.com/60313
> 
> That is correct. However, since Close() is private and currently called only
by
> the destructor, it is ok.

Not if you happen to be multi-threaded.

> It might be a good idea to go ahead and reset it anyways though.

+1.

Powered by Google App Engine
This is Rietveld 408576698