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

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed)

Created:
9 years, 4 months ago by brettw
Modified:
9 years, 4 months ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, Paweł Hajdan Jr., acolwell+watch_chromium.org, annacc+watch_chromium.org, darin-cc_chromium.org, ajwong+watch_chromium.org, vrk (LEFT CHROMIUM), brettw-cc_chromium.org, scherkus (not reviewing)
Visibility:
Public.

Description

Add a unified resource tracker shared between the proxy and the impl. This renames the old ResourceObjectBase to Resource and removes the old PluginResource. It moves the resource tracker from the impl to the shared_impl, and makes the proxy use it. Some things become a little less neat because there's no proxy resource base class. In particular GetDispatcher() is now gone. I considered whether to add a helper base class that provides this function, but decided against it and had individual resource classes implement this when their implementation would find it useful. This is because ultimately I want more of this functionality to move into the shared_impl, and it's easier to do that if there are fewer proxy-specific things in the resources. This changes the way that plugins are added to the tracker. Previously they would only be in the tracker if the plugin had a reference to them, although they could be alive if the impl had a scoped_ptr referencing an object. This actually has the bug that if we then give the resource back to the plugin, it wouldn't be refcounted properly and everything would get confused. Now the tracker tracks all live resource objects whether or not the plugin has a ref. This works basically like the var tracker (it would be nice if the var and resource trackers shared more code, but that would further complicate this already overcomplicated patch). The resource tracker takes an extra ref whenever the plugin has one or more, and otherwise just tracks live resources. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97314

Patch Set 1 #

Patch Set 2 : Correct patch #

Patch Set 3 : Merged to trunk #

Patch Set 4 : test_shell_tests fixed #

Patch Set 5 : Try errors fixed #

Patch Set 6 : Assertion fixed #

Total comments: 23

Patch Set 7 : Address review comments #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1111 lines, -1178 lines) Patch
M chrome/renderer/chrome_ppb_pdf_impl.cc View 2 chunks +7 lines, -6 lines 0 comments Download
M ppapi/ppapi_proxy.gypi View 1 1 chunk +0 lines, -2 lines 0 comments Download
M ppapi/ppapi_shared.gypi View 1 1 chunk +4 lines, -2 lines 0 comments Download
M ppapi/ppapi_tests.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/proxy/mock_resource.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/proxy/mock_resource.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.h View 2 chunks +5 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 3 chunks +8 lines, -0 lines 0 comments Download
D ppapi/proxy/plugin_resource.h View 1 1 chunk +0 lines, -45 lines 0 comments Download
D ppapi/proxy/plugin_resource.cc View 1 1 chunk +0 lines, -27 lines 0 comments Download
M ppapi/proxy/plugin_resource_tracker.h View 1 6 chunks +9 lines, -43 lines 0 comments Download
M ppapi/proxy/plugin_resource_tracker.cc View 1 2 3 4 5 5 chunks +32 lines, -106 lines 0 comments Download
M ppapi/proxy/plugin_resource_tracker_unittest.cc View 1 2 2 chunks +5 lines, -10 lines 0 comments Download
M ppapi/proxy/ppapi_param_traits.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppapi_proxy_test.cc View 1 2 3 chunks +3 lines, -0 lines 0 comments Download
M ppapi/proxy/ppb_audio_config_proxy.cc View 1 2 chunks +5 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_audio_proxy.cc View 1 2 3 4 5 6 7 chunks +9 lines, -8 lines 2 comments Download
M ppapi/proxy/ppb_broker_proxy.cc View 1 5 chunks +8 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_context_3d_proxy.h View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_context_3d_proxy.cc View 1 2 3 4 5 6 8 chunks +14 lines, -10 lines 0 comments Download
M ppapi/proxy/ppb_cursor_control_proxy.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_file_chooser_proxy.cc View 1 4 chunks +8 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_file_ref_proxy.cc View 1 8 chunks +19 lines, -16 lines 0 comments Download
M ppapi/proxy/ppb_file_system_proxy.cc View 1 6 chunks +8 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_flash_file_proxy.cc View 1 2 3 4 5 6 3 chunks +9 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_flash_menu_proxy.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_flash_menu_proxy.cc View 1 5 chunks +8 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_flash_net_connector_proxy.cc View 1 6 chunks +6 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_flash_proxy.cc View 1 3 chunks +10 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_flash_tcp_socket_proxy.cc View 1 2 3 4 5 6 5 chunks +11 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.h View 1 2 3 4 5 6 3 chunks +6 lines, -4 lines 1 comment Download
M ppapi/proxy/ppb_font_proxy.cc View 1 2 3 chunks +7 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.cc View 1 2 3 4 5 6 7 chunks +17 lines, -14 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.h View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.cc View 1 2 3 4 5 6 5 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.h View 1 4 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_input_event_proxy.cc View 1 3 chunks +7 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_instance_proxy.cc View 1 3 chunks +3 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_pdf_proxy.cc View 1 3 chunks +5 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_surface_3d_proxy.h View 1 3 chunks +3 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_surface_3d_proxy.cc View 1 5 chunks +4 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_testing_proxy.cc View 1 2 chunks +8 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_url_loader_proxy.cc View 1 7 chunks +11 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_url_request_info_proxy.cc View 1 5 chunks +10 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.h View 1 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.cc View 1 6 chunks +12 lines, -11 lines 0 comments Download
M ppapi/proxy/ppb_video_capture_proxy.cc View 1 5 chunks +9 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_video_decoder_proxy.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_video_decoder_proxy.cc View 1 2 3 4 5 6 6 chunks +15 lines, -33 lines 0 comments Download
M ppapi/proxy/ppp_graphics_3d_proxy.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/proxy/ppp_instance_private_proxy.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/proxy/ppp_instance_proxy.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M ppapi/proxy/ppp_video_decoder_proxy.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/proxy_module.h View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/resource_creation_proxy.cc View 1 2 3 4 5 6 2 chunks +3 lines, -5 lines 0 comments Download
M ppapi/shared_impl/audio_config_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M ppapi/shared_impl/audio_impl.h View 1 chunk +1 line, -1 line 0 comments Download
A ppapi/shared_impl/resource.h View 1 2 3 4 5 6 1 chunk +141 lines, -0 lines 0 comments Download
A ppapi/shared_impl/resource.cc View 1 2 1 chunk +54 lines, -0 lines 0 comments Download
D ppapi/shared_impl/resource_object_base.h View 1 1 chunk +0 lines, -93 lines 0 comments Download
D ppapi/shared_impl/resource_object_base.cc View 1 1 chunk +0 lines, -26 lines 0 comments Download
A ppapi/shared_impl/resource_tracker.h View 1 2 3 4 5 6 1 chunk +93 lines, -0 lines 0 comments Download
A ppapi/shared_impl/resource_tracker.cc View 1 2 3 4 5 6 1 chunk +163 lines, -0 lines 3 comments Download
A ppapi/shared_impl/resource_tracker_unittest.cc View 1 2 3 4 5 6 1 chunk +148 lines, -0 lines 0 comments Download
M ppapi/shared_impl/tracker_base.h View 2 chunks +2 lines, -9 lines 0 comments Download
M ppapi/shared_impl/video_decoder_impl.h View 1 2 2 chunks +1 line, -6 lines 0 comments Download
M ppapi/shared_impl/video_decoder_impl.cc View 1 2 3 chunks +3 lines, -2 lines 0 comments Download
M ppapi/thunk/enter.h View 3 chunks +13 lines, -5 lines 0 comments Download
M webkit/plugins/ppapi/callbacks_unittest.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M webkit/plugins/ppapi/plugin_module.cc View 1 2 3 4 5 6 1 chunk +2 lines, -6 lines 0 comments Download
webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 4 5 6 2 chunks +2 lines, -6 lines 0 comments Download
M webkit/plugins/ppapi/ppb_audio_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/ppb_audio_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_broker_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_broker_impl.cc View 1 chunk +1 line, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_buffer_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_context_3d_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_directory_reader_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_directory_reader_impl.cc View 3 chunks +4 lines, -9 lines 0 comments Download
M webkit/plugins/ppapi/ppb_file_chooser_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_file_chooser_impl.cc View 2 chunks +2 lines, -6 lines 0 comments Download
M webkit/plugins/ppapi/ppb_file_io_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_file_io_impl.cc View 1 chunk +1 line, -3 lines 0 comments Download
webkit/plugins/ppapi/ppb_file_ref_impl.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_file_ref_impl.cc View 1 2 3 4 5 6 5 chunks +6 lines, -12 lines 0 comments Download
M webkit/plugins/ppapi/ppb_file_system_impl.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_file_system_impl.cc View 2 chunks +2 lines, -5 lines 0 comments Download
M webkit/plugins/ppapi/ppb_flash_menu_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_flash_menu_impl.cc View 1 chunk +1 line, -7 lines 0 comments Download
M webkit/plugins/ppapi/ppb_flash_net_connector_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc View 2 chunks +2 lines, -14 lines 0 comments Download
M webkit/plugins/ppapi/ppb_font_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_font_impl.cc View 1 chunk +1 line, -2 lines 0 comments Download
M webkit/plugins/ppapi/ppb_graphics_3d_impl.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_graphics_3d_impl.cc View 1 2 3 4 5 6 2 chunks +0 lines, -4 lines 0 comments Download
M webkit/plugins/ppapi/ppb_input_event_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_input_event_impl.cc View 1 chunk +1 line, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_layer_compositor_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_proxy_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/ppb_scrollbar_impl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_surface_3d_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_surface_3d_impl.cc View 1 chunk +1 line, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_transport_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_transport_impl.cc View 4 chunks +4 lines, -12 lines 0 comments Download
M webkit/plugins/ppapi/ppb_url_loader_impl.h View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M webkit/plugins/ppapi/ppb_url_loader_impl.cc View 1 2 3 chunks +14 lines, -23 lines 0 comments Download
M webkit/plugins/ppapi/ppb_url_request_info_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_url_response_info_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_decoder_impl.h View 2 chunks +1 line, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_decoder_impl.cc View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_layer_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_video_layer_impl.cc View 1 chunk +1 line, -4 lines 0 comments Download
M webkit/plugins/ppapi/ppb_widget_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/resource.h View 1 2 3 chunks +7 lines, -36 lines 0 comments Download
M webkit/plugins/ppapi/resource.cc View 1 2 1 chunk +9 lines, -20 lines 0 comments Download
webkit/plugins/ppapi/resource_creation_impl.cc View 1 2 3 4 5 6 6 chunks +7 lines, -31 lines 0 comments Download
M webkit/plugins/ppapi/resource_tracker.h View 1 2 3 4 4 chunks +9 lines, -32 lines 0 comments Download
M webkit/plugins/ppapi/resource_tracker.cc View 1 2 3 8 chunks +16 lines, -146 lines 0 comments Download
M webkit/plugins/ppapi/resource_tracker_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -78 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
brettw
Sorry...
9 years, 4 months ago (2011-08-15 19:32:54 UTC) #1
dmichael (off chromium)
Still looking, but thought I'd publish what I've found so far. Mostly just optional nits. ...
9 years, 4 months ago (2011-08-17 16:28:07 UTC) #2
brettw
http://codereview.chromium.org/7629017/diff/10001/ppapi/proxy/ppb_audio_proxy.cc File ppapi/proxy/ppb_audio_proxy.cc (right): http://codereview.chromium.org/7629017/diff/10001/ppapi/proxy/ppb_audio_proxy.cc#newcode184 ppapi/proxy/ppb_audio_proxy.cc:184: GetReference(); I want to be consistent so people that ...
9 years, 4 months ago (2011-08-17 17:16:25 UTC) #3
dmichael (off chromium)
More comments... still going. http://codereview.chromium.org/7629017/diff/10001/ppapi/proxy/ppb_video_decoder_proxy.cc File ppapi/proxy/ppb_video_decoder_proxy.cc (right): http://codereview.chromium.org/7629017/diff/10001/ppapi/proxy/ppb_video_decoder_proxy.cc#newcode239 ppapi/proxy/ppb_video_decoder_proxy.cc:239: scoped_refptr<VideoDecoder> decoder(new VideoDecoder(result)); Why are ...
9 years, 4 months ago (2011-08-17 19:02:54 UTC) #4
dmichael (off chromium)
I'm done for now... only a couple more comments. http://codereview.chromium.org/7629017/diff/10001/webkit/plugins/ppapi/ppb_url_loader_impl.h File webkit/plugins/ppapi/ppb_url_loader_impl.h (right): http://codereview.chromium.org/7629017/diff/10001/webkit/plugins/ppapi/ppb_url_loader_impl.h#newcode42 webkit/plugins/ppapi/ppb_url_loader_impl.h:42: ...
9 years, 4 months ago (2011-08-17 20:33:44 UTC) #5
brettw
I think I addressed everything. http://codereview.chromium.org/7629017/diff/10001/webkit/plugins/ppapi/resource.h File webkit/plugins/ppapi/resource.h (right): http://codereview.chromium.org/7629017/diff/10001/webkit/plugins/ppapi/resource.h#newcode17 webkit/plugins/ppapi/resource.h:17: class Resource : public ...
9 years, 4 months ago (2011-08-17 20:43:18 UTC) #6
dmichael (off chromium)
9 years, 4 months ago (2011-08-17 21:35:50 UTC) #7
just some nits left. o/w LGTM

http://codereview.chromium.org/7629017/diff/14005/ppapi/proxy/ppb_audio_proxy.cc
File ppapi/proxy/ppb_audio_proxy.cc (right):

http://codereview.chromium.org/7629017/diff/14005/ppapi/proxy/ppb_audio_proxy...
ppapi/proxy/ppb_audio_proxy.cc:90:
PluginDispatcher::GetForInstance(pp_instance())->Send(
Sorry, didn't mean to imply that I marked all the places that could use
GetForResource. This is another.

http://codereview.chromium.org/7629017/diff/14005/ppapi/proxy/ppb_audio_proxy...
ppapi/proxy/ppb_audio_proxy.cc:99:
PluginDispatcher::GetForInstance(pp_instance())->Send(
ditto

http://codereview.chromium.org/7629017/diff/14005/ppapi/proxy/ppb_font_proxy.h
File ppapi/proxy/ppb_font_proxy.h (right):

http://codereview.chromium.org/7629017/diff/14005/ppapi/proxy/ppb_font_proxy....
ppapi/proxy/ppb_font_proxy.h:9: #include "base/memory/ref_counted.h"
So callback and ref_counted are necessary? I don't see them used.

http://codereview.chromium.org/7629017/diff/14005/ppapi/shared_impl/resource_...
File ppapi/shared_impl/resource_tracker.cc (right):

http://codereview.chromium.org/7629017/diff/14005/ppapi/shared_impl/resource_...
ppapi/shared_impl/resource_tracker.cc:61: // When we go from 0 to 1 plugin ref
count, free the additional "real" ref
0 to 1 -> 1 to 0

http://codereview.chromium.org/7629017/diff/14005/ppapi/shared_impl/resource_...
ppapi/shared_impl/resource_tracker.cc:66: return;
nit: the last return is unnecessary here and in AddRefResource

http://codereview.chromium.org/7629017/diff/14005/ppapi/shared_impl/resource_...
ppapi/shared_impl/resource_tracker.cc:81: // Due to the infrastructure of some
tests, the instance is uyregistered
uyregistered->unregistered

Powered by Google App Engine
This is Rietveld 408576698