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

Issue 7740038: Use macros to define pepper interfaces (Closed)

Created:
9 years, 3 months ago by brettw
Modified:
9 years, 3 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it with a list of macros. When files want to know which Pepper interface names and structs there are, they define what they want to do with the macros, and then include the relevant files for the classes of interfaces they want (stable, private, dev). This does not convert all the dev interfaces. I just did a few to keep the patch smaller. So there is still a lot of manual registration. This fixes the previous design problem where we assumed one *_Proxy object == one interface. We have been hacking around this lately with duplicate GetInfo calls, but this doesn't work for PPP interfaces. Now, a _Proxy object is just there to help keep things organized. One proxy can handle zero, one, or many interfaces, and this mapping is controlled by just one line in the interfaces file. So for example, to add a new function to a new version of an interface with backward compatibility, you would add that function to the _api.h file, and write a thunk for the new interface. Then you only need to add one line to the interfaces_ppb_public_stable.h file and that will be hooked up with the proxy and the implementation. This removes some _proxy objects/files that were used only to declare that the interfaces existed, since they're no longer necessary. I folded Console into the Instance API which removed a bunch of code. I removed FileChooser 0.4. I think everybody has converted to the new one, and I think parts of it weren't even hooked up properly anymore. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=100748

Patch Set 1 #

Patch Set 2 : Cleaned up #

Patch Set 3 : Initial #

Patch Set 4 : UI tests pass #

Patch Set 5 : Self review #

Total comments: 22

Patch Set 6 : Review comments. #

Patch Set 7 : Merge #

Patch Set 8 : New patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1620 lines, -2426 lines) Patch
M content/ppapi_plugin/ppapi_thread.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M ppapi/ppapi_proxy.gypi View 1 2 3 4 5 6 5 chunks +3 lines, -10 lines 0 comments Download
M ppapi/ppapi_shared.gypi View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M ppapi/proxy/dispatcher.h View 1 2 3 4 chunks +16 lines, -10 lines 0 comments Download
M ppapi/proxy/dispatcher.cc View 1 2 3 4 5 6 4 chunks +38 lines, -237 lines 0 comments Download
M ppapi/proxy/enter_proxy.h View 1 2 2 chunks +20 lines, -0 lines 0 comments Download
M ppapi/proxy/host_dispatcher.h View 1 2 3 4 5 6 7 3 chunks +9 lines, -28 lines 0 comments Download
M ppapi/proxy/host_dispatcher.cc View 1 2 3 4 5 6 7 4 chunks +18 lines, -81 lines 0 comments Download
M ppapi/proxy/host_dispatcher_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/interface_id.h View 1 2 3 4 5 6 2 chunks +0 lines, -5 lines 0 comments Download
A ppapi/proxy/interface_list.h View 1 2 1 chunk +77 lines, -0 lines 0 comments Download
A ppapi/proxy/interface_list.cc View 1 2 3 4 5 6 7 1 chunk +296 lines, -0 lines 0 comments Download
M ppapi/proxy/interface_proxy.h View 1 2 4 chunks +8 lines, -13 lines 0 comments Download
M ppapi/proxy/interface_proxy.cc View 1 2 1 chunk +2 lines, -4 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -10 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 1 2 3 4 5 6 7 6 chunks +19 lines, -90 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher_unittest.cc View 1 2 3 2 chunks +1 line, -6 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 3 4 5 6 2 chunks +9 lines, -11 lines 0 comments Download
D ppapi/proxy/ppb_audio_config_proxy.h View 1 2 1 chunk +0 lines, -36 lines 0 comments Download
D ppapi/proxy/ppb_audio_config_proxy.cc View 1 2 1 chunk +0 lines, -52 lines 0 comments Download
M ppapi/proxy/ppb_audio_proxy.h View 1 2 2 chunks +3 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_audio_proxy.cc View 1 2 5 chunks +9 lines, -24 lines 0 comments Download
M ppapi/proxy/ppb_broker_proxy.h View 1 2 1 chunk +3 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_broker_proxy.cc View 1 2 6 chunks +12 lines, -25 lines 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.h View 1 2 1 chunk +3 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_buffer_proxy.cc View 1 2 3 chunks +10 lines, -26 lines 0 comments Download
M ppapi/proxy/ppb_char_set_proxy.h View 1 2 2 chunks +5 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_char_set_proxy.cc View 1 2 3 4 4 chunks +7 lines, -33 lines 0 comments Download
D ppapi/proxy/ppb_console_proxy.h View 1 2 1 chunk +0 lines, -48 lines 0 comments Download
D ppapi/proxy/ppb_console_proxy.cc View 1 2 1 chunk +0 lines, -103 lines 0 comments Download
M ppapi/proxy/ppb_context_3d_proxy.h View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_context_3d_proxy.cc View 1 2 3 chunks +3 lines, -33 lines 0 comments Download
M ppapi/proxy/ppb_core_proxy.h View 1 2 2 chunks +10 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_core_proxy.cc View 1 2 2 chunks +11 lines, -19 lines 0 comments Download
M ppapi/proxy/ppb_crypto_proxy.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/ppb_crypto_proxy.cc View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_cursor_control_proxy.h View 1 2 2 chunks +5 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_cursor_control_proxy.cc View 1 2 1 chunk +2 lines, -24 lines 0 comments Download
M ppapi/proxy/ppb_file_chooser_proxy.h View 1 2 1 chunk +3 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_file_chooser_proxy.cc View 1 2 4 chunks +14 lines, -76 lines 0 comments Download
M ppapi/proxy/ppb_file_ref_proxy.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_file_ref_proxy.cc View 1 2 3 chunks +3 lines, -24 lines 0 comments Download
M ppapi/proxy/ppb_file_system_proxy.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_file_system_proxy.cc View 1 2 3 chunks +5 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_flash_clipboard_proxy.h View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_flash_clipboard_proxy.cc View 1 2 4 chunks +12 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_flash_file_proxy.h View 1 2 3 chunks +16 lines, -12 lines 0 comments Download
M ppapi/proxy/ppb_flash_file_proxy.cc View 1 2 9 chunks +37 lines, -29 lines 0 comments Download
M ppapi/proxy/ppb_flash_menu_proxy.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/ppb_flash_menu_proxy.cc View 1 2 2 chunks +5 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_flash_net_connector_proxy.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M ppapi/proxy/ppb_flash_net_connector_proxy.cc View 1 2 2 chunks +5 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_flash_proxy.h View 1 2 2 chunks +8 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_flash_proxy.cc View 1 2 7 chunks +19 lines, -20 lines 0 comments Download
M ppapi/proxy/ppb_flash_tcp_socket_proxy.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M ppapi/proxy/ppb_flash_tcp_socket_proxy.cc View 1 2 2 chunks +4 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.h View 1 2 2 chunks +5 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.cc View 1 2 1 chunk +2 lines, -20 lines 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.h View 1 2 2 chunks +5 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_graphics_2d_proxy.cc View 1 2 3 chunks +2 lines, -24 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.h View 1 2 3 4 5 6 1 chunk +3 lines, -7 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.cc View 1 2 3 4 5 6 4 chunks +3 lines, -20 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.h View 1 2 1 chunk +0 lines, -15 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.cc View 1 2 1 chunk +0 lines, -37 lines 0 comments Download
D ppapi/proxy/ppb_input_event_proxy.h View 1 2 1 chunk +0 lines, -40 lines 0 comments Download
D ppapi/proxy/ppb_input_event_proxy.cc View 1 2 1 chunk +0 lines, -105 lines 0 comments Download
M ppapi/proxy/ppb_instance_proxy.h View 1 2 3 4 5 6 4 chunks +17 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_instance_proxy.cc View 1 2 3 4 5 6 12 chunks +58 lines, -64 lines 0 comments Download
M ppapi/proxy/ppb_memory_proxy.h View 1 2 3 4 1 chunk +1 line, -17 lines 0 comments Download
M ppapi/proxy/ppb_memory_proxy.cc View 1 2 3 4 1 chunk +2 lines, -29 lines 0 comments Download
D ppapi/proxy/ppb_opengles2_proxy.h View 1 2 1 chunk +0 lines, -33 lines 0 comments Download
D ppapi/proxy/ppb_opengles2_proxy.cc View 1 2 3 4 5 6 1 chunk +0 lines, -44 lines 0 comments Download
M ppapi/proxy/ppb_pdf_proxy.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_pdf_proxy.cc View 1 2 3 chunks +12 lines, -9 lines 0 comments Download
M ppapi/proxy/ppb_surface_3d_proxy.h View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_surface_3d_proxy.cc View 1 2 4 chunks +6 lines, -8 lines 0 comments Download
M ppapi/proxy/ppb_testing_proxy.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_testing_proxy.cc View 1 2 2 chunks +13 lines, -10 lines 0 comments Download
M ppapi/proxy/ppb_url_loader_proxy.h View 1 2 3 chunks +3 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_url_loader_proxy.cc View 1 2 5 chunks +6 lines, -21 lines 0 comments Download
D ppapi/proxy/ppb_url_request_info_proxy.h View 1 2 1 chunk +0 lines, -36 lines 0 comments Download
D ppapi/proxy/ppb_url_request_info_proxy.cc View 1 2 1 chunk +0 lines, -50 lines 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.h View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_url_response_info_proxy.cc View 1 2 3 chunks +3 lines, -28 lines 0 comments Download
M ppapi/proxy/ppb_url_util_proxy.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_url_util_proxy.cc View 1 2 2 chunks +15 lines, -12 lines 0 comments Download
M ppapi/proxy/ppb_var_deprecated_proxy.h View 1 2 2 chunks +5 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_var_deprecated_proxy.cc View 1 2 12 chunks +21 lines, -18 lines 0 comments Download
M ppapi/proxy/ppb_var_proxy.h View 1 2 1 chunk +3 lines, -17 lines 0 comments Download
M ppapi/proxy/ppb_var_proxy.cc View 1 2 1 chunk +2 lines, -29 lines 0 comments Download
M ppapi/proxy/ppb_var_unittest.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_video_capture_proxy.h View 1 2 3 chunks +15 lines, -12 lines 0 comments Download
M ppapi/proxy/ppb_video_capture_proxy.cc View 1 2 11 chunks +27 lines, -40 lines 0 comments Download
M ppapi/proxy/ppb_video_decoder_proxy.h View 1 2 2 chunks +2 lines, -6 lines 0 comments Download
M ppapi/proxy/ppb_video_decoder_proxy.cc View 1 2 3 4 5 3 chunks +27 lines, -44 lines 0 comments Download
M ppapi/proxy/ppp_class_proxy.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M ppapi/proxy/ppp_class_proxy.cc View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M ppapi/proxy/ppp_graphics_3d_proxy.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -5 lines 0 comments Download
M ppapi/proxy/ppp_graphics_3d_proxy.cc View 1 2 3 4 5 6 7 2 chunks +11 lines, -8 lines 0 comments Download
M ppapi/proxy/ppp_input_event_proxy.h View 1 2 2 chunks +8 lines, -5 lines 0 comments Download
M ppapi/proxy/ppp_input_event_proxy.cc View 1 2 3 4 5 4 chunks +12 lines, -10 lines 0 comments Download
M ppapi/proxy/ppp_instance_private_proxy.h View 1 2 2 chunks +8 lines, -6 lines 0 comments Download
M ppapi/proxy/ppp_instance_private_proxy.cc View 1 2 2 chunks +10 lines, -7 lines 0 comments Download
M ppapi/proxy/ppp_instance_proxy.h View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M ppapi/proxy/ppp_instance_proxy.cc View 1 2 5 chunks +15 lines, -10 lines 0 comments Download
M ppapi/proxy/ppp_messaging_proxy.h View 1 2 2 chunks +8 lines, -5 lines 0 comments Download
M ppapi/proxy/ppp_messaging_proxy.cc View 1 2 2 chunks +10 lines, -7 lines 0 comments Download
M ppapi/proxy/ppp_mouse_lock_proxy.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -5 lines 0 comments Download
M ppapi/proxy/ppp_mouse_lock_proxy.cc View 1 2 3 4 5 6 7 2 chunks +10 lines, -8 lines 0 comments Download
M ppapi/proxy/ppp_video_decoder_proxy.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M ppapi/proxy/ppp_video_decoder_proxy.cc View 1 2 6 chunks +14 lines, -11 lines 0 comments Download
M ppapi/proxy/resource_creation_proxy.h View 1 2 3 chunks +7 lines, -7 lines 0 comments Download
M ppapi/proxy/resource_creation_proxy.cc View 1 2 3 chunks +9 lines, -4 lines 0 comments Download
M ppapi/thunk/enter.h View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A ppapi/thunk/enter.cc View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
A ppapi/thunk/interfaces_postamble.h View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
A ppapi/thunk/interfaces_ppb_private.h View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A ppapi/thunk/interfaces_ppb_public_dev.h View 1 2 3 4 5 6 7 1 chunk +42 lines, -0 lines 0 comments Download
A ppapi/thunk/interfaces_ppb_public_stable.h View 1 2 3 4 5 6 7 1 chunk +78 lines, -0 lines 0 comments Download
A ppapi/thunk/interfaces_preamble.h View 1 2 3 4 1 chunk +31 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_buffer_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_char_set_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
A ppapi/thunk/ppb_console_thunk.cc View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_context_3d_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_cursor_control_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_directory_reader_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_file_chooser_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_font_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_input_event_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_instance_api.h View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_instance_thunk.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M ppapi/thunk/ppb_mouse_lock_thunk.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_surface_3d_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_transport_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_video_capture_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_video_decoder_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_video_layer_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/ppb_widget_thunk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ppapi/thunk/thunk.h View 1 2 3 4 5 6 2 chunks +25 lines, -55 lines 0 comments Download
M webkit/glue/webkit_glue.gypi View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M webkit/plugins/ppapi/plugin_module.cc View 1 2 3 4 5 6 7 5 chunks +26 lines, -76 lines 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 4 5 6 4 chunks +46 lines, -0 lines 0 comments Download
D webkit/plugins/ppapi/ppb_console_impl.h View 1 2 1 chunk +0 lines, -23 lines 0 comments Download
D webkit/plugins/ppapi/ppb_console_impl.cc View 1 2 1 chunk +0 lines, -87 lines 0 comments Download
M webkit/plugins/ppapi/ppb_url_request_info_impl.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
brettw
This is what I had in mind for the autogenerated interface lists. The first section ...
9 years, 3 months ago (2011-08-25 21:24:52 UTC) #1
brettw
9 years, 3 months ago (2011-09-07 18:22:00 UTC) #2
noelallen_use_chromium
First round of feedback, up to but not including ppb_file_chooser.* http://codereview.chromium.org/7740038/diff/5001/ppapi/ppapi_proxy.gypi File ppapi/ppapi_proxy.gypi (left): http://codereview.chromium.org/7740038/diff/5001/ppapi/ppapi_proxy.gypi#oldcode118 ...
9 years, 3 months ago (2011-09-07 21:16:57 UTC) #3
noelallen_use_chromium
A few questions to make sure didn't miss anything, but what's there LGTM. BTW, if ...
9 years, 3 months ago (2011-09-08 00:47:41 UTC) #4
brettw
New snap up. http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/dispatcher.cc File ppapi/proxy/dispatcher.cc (right): http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/dispatcher.cc#newcode69 ppapi/proxy/dispatcher.cc:69: if (msg.routing_id() <= 0 || msg.routing_id() ...
9 years, 3 months ago (2011-09-08 05:34:29 UTC) #5
noelallen_use_chromium
9 years, 3 months ago (2011-09-08 19:49:16 UTC) #6
LGTM.

http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/dispatcher.cc
File ppapi/proxy/dispatcher.cc (right):

http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/dispatcher.cc#ne...
ppapi/proxy/dispatcher.cc:69: if (msg.routing_id() <= 0 || msg.routing_id() >=
INTERFACE_ID_COUNT) {
Sure for our current uses.  I just wasn't sure if there was a non chrome.dll
case we need to support.

http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/interface_list.h
File ppapi/proxy/interface_list.h (right):

http://codereview.chromium.org/7740038/diff/5001/ppapi/proxy/interface_list.h...
ppapi/proxy/interface_list.h:49: InterfaceID id;
On 2011/09/08 05:34:29, brettw wrote:
> I'm not sure what you mean here.
nvm.  I was wondering if you should explicitly include interface_id.h

Powered by Google App Engine
This is Rietveld 408576698