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

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed)

Created:
9 years, 11 months ago by brettw
Modified:
9 years, 7 months ago
Reviewers:
viettrungluu
CC:
chromium-reviews, piman+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Refactor PPAPI proxy resource handling to maintain which host they came from, and to map back to that host when calling functions on them. Adds a mapping between resources generated by the hosts to a new list inside the plugin so there can't be overlaps. This means there are now two meanings for a PP_Resource, one in the plugin process and one in the host process. This is potentially very confusing. I introduced a new object called a HostResource that always represents a "host" PP_Resource to try to prevent errors. In the plugin side of the proxy, it only deals with PP_Resources valid in the plugin, and SerializedResources valid in the host. It also encapsulates the associated instance, which simplifies some code. Each PluginResource object maintains its SerializedResource which the proxy uses to send to the host for requests. This requires getting the PluginResource object in more proxy calls. This fixes a bug in var sending introduced in my previous patch. The var releasing from EndSendPassRef used the host var rather than the plugin var. I had to add more plumbing to get the dispatcher at this location and convert to a plugin var. I removed the separate file for ImageData and put it in ppb_image_data_proxy like for the other resource types. TEST=some unit tests included BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72879

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 10

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 1

Patch Set 10 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1668 lines, -829 lines) Patch
M ppapi/c/dev/ppb_cursor_control_dev.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/ppapi_shared_proxy.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -2 lines 0 comments Download
M ppapi/ppapi_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -1 line 0 comments Download
M ppapi/proxy/dispatcher.h View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -0 lines 0 comments Download
M ppapi/proxy/dispatcher.cc View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -0 lines 0 comments Download
A ppapi/proxy/host_resource.h View 1 2 3 4 5 6 7 1 chunk +60 lines, -0 lines 0 comments Download
M ppapi/proxy/host_var_serialization_rules.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/host_var_serialization_rules.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/image_data.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -49 lines 0 comments Download
M ppapi/proxy/image_data.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -97 lines 0 comments Download
A ppapi/proxy/mock_resource.h View 1 2 3 4 5 6 7 8 9 1 chunk +29 lines, -0 lines 0 comments Download
A ppapi/proxy/mock_resource.cc View 1 2 3 4 5 6 7 8 9 1 chunk +22 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_resource.h View 1 2 3 4 5 6 7 8 5 chunks +14 lines, -4 lines 0 comments Download
M ppapi/proxy/plugin_resource.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M ppapi/proxy/plugin_resource_tracker.h View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -25 lines 0 comments Download
M ppapi/proxy/plugin_resource_tracker.cc View 1 2 3 4 5 6 7 8 5 chunks +48 lines, -25 lines 0 comments Download
A ppapi/proxy/plugin_resource_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +75 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_var_serialization_rules.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/plugin_var_serialization_rules.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -2 lines 0 comments Download
M ppapi/proxy/plugin_var_tracker.h View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -1 line 0 comments Download
M ppapi/proxy/plugin_var_tracker.cc View 1 2 3 4 5 6 7 8 3 chunks +29 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_var_tracker_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +63 lines, -54 lines 0 comments Download
M ppapi/proxy/ppapi_messages_internal.h View 1 2 3 4 5 6 7 8 14 chunks +58 lines, -62 lines 0 comments Download
M ppapi/proxy/ppapi_param_traits.h View 1 2 3 4 5 6 7 8 5 chunks +32 lines, -4 lines 0 comments Download
M ppapi/proxy/ppapi_param_traits.cc View 1 2 3 4 5 6 7 8 9 10 chunks +121 lines, -27 lines 0 comments Download
A ppapi/proxy/ppapi_proxy_test.h View 1 2 3 4 5 6 1 chunk +46 lines, -0 lines 0 comments Download
A ppapi/proxy/ppapi_proxy_test.cc View 1 2 3 1 chunk +59 lines, -0 lines 0 comments Download
M ppapi/proxy/ppb_audio_config_proxy.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_audio_config_proxy.cc View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -13 lines 0 comments Download
M ppapi/proxy/ppb_audio_proxy.h View 1 2 3 4 5 6 7 8 9 4 chunks +11 lines, -11 lines 0 comments Download
M ppapi/proxy/ppb_audio_proxy.cc View 1 2 3 4 5 6 7 8 9 9 chunks +55 lines, -41 lines 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.cc View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -11 lines 0 comments Download
M ppapi/proxy/ppb_core_proxy.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_core_proxy.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_cursor_control_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_cursor_control_proxy.cc View 1 2 3 4 5 6 7 8 3 chunks +21 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_flash_proxy.cc View 1 2 3 4 5 6 7 8 2 chunks +15 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.cc View 1 2 3 4 5 6 7 8 16 chunks +38 lines, -28 lines 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +13 lines, -10 lines 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.cc View 1 2 3 4 5 6 7 8 9 chunks +70 lines, -44 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.cc View 1 2 3 4 5 6 7 8 4 chunks +131 lines, -15 lines 0 comments Download
M ppapi/proxy/ppb_instance_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_instance_proxy.cc View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_pdf_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_pdf_proxy.cc View 1 2 3 4 5 6 7 8 4 chunks +18 lines, -16 lines 0 comments Download
M ppapi/proxy/ppb_testing_proxy.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_testing_proxy.cc View 1 2 3 4 5 6 7 8 6 chunks +21 lines, -11 lines 0 comments Download
M ppapi/proxy/ppb_url_loader_proxy.h View 1 2 3 4 5 6 7 8 5 chunks +18 lines, -18 lines 0 comments Download
M ppapi/proxy/ppb_url_loader_proxy.cc View 1 2 3 4 5 6 7 8 15 chunks +141 lines, -111 lines 0 comments Download
M ppapi/proxy/ppb_url_request_info_proxy.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_url_request_info_proxy.cc View 1 2 3 4 5 6 7 8 7 chunks +50 lines, -35 lines 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.h View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.cc View 1 2 3 4 5 6 7 8 5 chunks +19 lines, -16 lines 0 comments Download
M ppapi/proxy/ppp_instance_proxy.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M ppapi/proxy/ppp_instance_proxy.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -4 lines 0 comments Download
M ppapi/proxy/serialized_structs.h View 1 2 3 4 5 6 7 8 9 5 chunks +23 lines, -5 lines 0 comments Download
M ppapi/proxy/serialized_structs.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/serialized_var.h View 1 2 3 4 5 6 7 8 8 chunks +50 lines, -14 lines 0 comments Download
M ppapi/proxy/serialized_var.cc View 1 2 3 4 5 6 7 8 10 chunks +46 lines, -8 lines 0 comments Download
A ppapi/proxy/serialized_var_unittest.cc View 1 2 3 4 5 1 chunk +74 lines, -0 lines 0 comments Download
M ppapi/proxy/var_serialization_rules.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
brettw
9 years, 11 months ago (2011-01-26 18:05:23 UTC) #1
viettrungluu
LG[*] with a few nits. [*] Well, I'm just rubberstamping the boilerplate changes.... http://codereview.chromium.org/6334016/diff/36003/ppapi/proxy/dispatcher.h File ...
9 years, 11 months ago (2011-01-27 16:52:57 UTC) #2
brettw
I did your suggestion for SerializedResource including an instance and renamed it to be HostResource. ...
9 years, 11 months ago (2011-01-27 18:41:20 UTC) #3
viettrungluu
9 years, 11 months ago (2011-01-27 20:16:30 UTC) #4
Okay, everything LGTM (other than an indentation nit), assuming green-ish
trybots, etc.

http://codereview.chromium.org/6334016/diff/118005/ppapi/proxy/ppapi_param_tr...
File ppapi/proxy/ppapi_param_traits.cc (right):

http://codereview.chromium.org/6334016/diff/118005/ppapi/proxy/ppapi_param_tr...
ppapi/proxy/ppapi_param_traits.cc:414: const param_type& p) {
Nit: indentation. (And elsewhere in this file.)

Powered by Google App Engine
This is Rietveld 408576698