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

Side by Side Diff: webkit/plugins/ppapi/plugin_module.cc

Issue 7149026: Implement flash menu and net connector resources using the API/thunk model. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/thunk.h ('k') | webkit/plugins/ppapi/ppb_flash_menu_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/plugin_module.h" 5 #include "webkit/plugins/ppapi/plugin_module.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/message_loop_proxy.h" 11 #include "base/message_loop_proxy.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "ppapi/c/dev/ppb_buffer_dev.h" 15 #include "ppapi/c/dev/ppb_buffer_dev.h"
16 #include "ppapi/c/dev/ppb_char_set_dev.h" 16 #include "ppapi/c/dev/ppb_char_set_dev.h"
17 #include "ppapi/c/dev/ppb_context_3d_dev.h" 17 #include "ppapi/c/dev/ppb_context_3d_dev.h"
18 #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h" 18 #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h"
19 #include "ppapi/c/dev/ppb_console_dev.h" 19 #include "ppapi/c/dev/ppb_console_dev.h"
20 #include "ppapi/c/dev/ppb_crypto_dev.h" 20 #include "ppapi/c/dev/ppb_crypto_dev.h"
21 #include "ppapi/c/dev/ppb_cursor_control_dev.h" 21 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
22 #include "ppapi/c/dev/ppb_directory_reader_dev.h" 22 #include "ppapi/c/dev/ppb_directory_reader_dev.h"
23 #include "ppapi/c/dev/ppb_file_chooser_dev.h"
23 #include "ppapi/c/dev/ppb_file_io_dev.h" 24 #include "ppapi/c/dev/ppb_file_io_dev.h"
24 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" 25 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h"
26 #include "ppapi/c/dev/ppb_file_ref_dev.h"
25 #include "ppapi/c/dev/ppb_file_system_dev.h" 27 #include "ppapi/c/dev/ppb_file_system_dev.h"
26 #include "ppapi/c/dev/ppb_find_dev.h" 28 #include "ppapi/c/dev/ppb_find_dev.h"
27 #include "ppapi/c/dev/ppb_font_dev.h" 29 #include "ppapi/c/dev/ppb_font_dev.h"
28 #include "ppapi/c/dev/ppb_fullscreen_dev.h" 30 #include "ppapi/c/dev/ppb_fullscreen_dev.h"
29 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" 31 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
30 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" 32 #include "ppapi/c/dev/ppb_graphics_3d_dev.h"
31 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" 33 #include "ppapi/c/dev/ppb_layer_compositor_dev.h"
32 #include "ppapi/c/dev/ppb_opengles_dev.h" 34 #include "ppapi/c/dev/ppb_opengles_dev.h"
33 #include "ppapi/c/dev/ppb_scrollbar_dev.h" 35 #include "ppapi/c/dev/ppb_scrollbar_dev.h"
34 #include "ppapi/c/dev/ppb_testing_dev.h" 36 #include "ppapi/c/dev/ppb_testing_dev.h"
(...skipping 16 matching lines...) Expand all
51 #include "ppapi/c/ppb_messaging.h" 53 #include "ppapi/c/ppb_messaging.h"
52 #include "ppapi/c/ppb_url_loader.h" 54 #include "ppapi/c/ppb_url_loader.h"
53 #include "ppapi/c/ppb_url_request_info.h" 55 #include "ppapi/c/ppb_url_request_info.h"
54 #include "ppapi/c/ppb_url_response_info.h" 56 #include "ppapi/c/ppb_url_response_info.h"
55 #include "ppapi/c/ppb_var.h" 57 #include "ppapi/c/ppb_var.h"
56 #include "ppapi/c/ppp.h" 58 #include "ppapi/c/ppp.h"
57 #include "ppapi/c/ppp_instance.h" 59 #include "ppapi/c/ppp_instance.h"
58 #include "ppapi/c/private/ppb_flash.h" 60 #include "ppapi/c/private/ppb_flash.h"
59 #include "ppapi/c/private/ppb_flash_clipboard.h" 61 #include "ppapi/c/private/ppb_flash_clipboard.h"
60 #include "ppapi/c/private/ppb_flash_file.h" 62 #include "ppapi/c/private/ppb_flash_file.h"
61 #include "ppapi/c/private/ppb_flash_menu.h"
62 #include "ppapi/c/private/ppb_flash_net_connector.h"
63 #include "ppapi/c/private/ppb_instance_private.h" 63 #include "ppapi/c/private/ppb_instance_private.h"
64 #include "ppapi/c/private/ppb_pdf.h" 64 #include "ppapi/c/private/ppb_pdf.h"
65 #include "ppapi/c/private/ppb_proxy_private.h" 65 #include "ppapi/c/private/ppb_proxy_private.h"
66 #include "ppapi/c/private/ppb_uma_private.h" 66 #include "ppapi/c/private/ppb_uma_private.h"
67 #include "ppapi/c/trusted/ppb_audio_trusted.h" 67 #include "ppapi/c/trusted/ppb_audio_trusted.h"
68 #include "ppapi/c/trusted/ppb_broker_trusted.h" 68 #include "ppapi/c/trusted/ppb_broker_trusted.h"
69 #include "ppapi/c/trusted/ppb_buffer_trusted.h" 69 #include "ppapi/c/trusted/ppb_buffer_trusted.h"
70 #include "ppapi/c/trusted/ppb_image_data_trusted.h" 70 #include "ppapi/c/trusted/ppb_image_data_trusted.h"
71 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" 71 #include "ppapi/c/trusted/ppb_url_loader_trusted.h"
72 #include "ppapi/thunk/thunk.h" 72 #include "ppapi/thunk/thunk.h"
73 #include "webkit/plugins/ppapi/callbacks.h" 73 #include "webkit/plugins/ppapi/callbacks.h"
74 #include "webkit/plugins/ppapi/common.h" 74 #include "webkit/plugins/ppapi/common.h"
75 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" 75 #include "webkit/plugins/ppapi/ppapi_interface_factory.h"
76 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 76 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
77 #include "webkit/plugins/ppapi/ppb_console_impl.h" 77 #include "webkit/plugins/ppapi/ppb_console_impl.h"
78 #include "webkit/plugins/ppapi/ppb_crypto_impl.h" 78 #include "webkit/plugins/ppapi/ppb_crypto_impl.h"
79 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" 79 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h"
80 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h"
81 #include "webkit/plugins/ppapi/ppb_file_io_impl.h"
82 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
83 #include "webkit/plugins/ppapi/ppb_file_system_impl.h"
84 #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h" 80 #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h"
85 #include "webkit/plugins/ppapi/ppb_flash_file_impl.h" 81 #include "webkit/plugins/ppapi/ppb_flash_file_impl.h"
86 #include "webkit/plugins/ppapi/ppb_flash_impl.h" 82 #include "webkit/plugins/ppapi/ppb_flash_impl.h"
87 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" 83 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h"
88 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" 84 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h"
89 #include "webkit/plugins/ppapi/ppb_font_impl.h" 85 #include "webkit/plugins/ppapi/ppb_font_impl.h"
90 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" 86 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h"
91 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" 87 #include "webkit/plugins/ppapi/ppb_image_data_impl.h"
92 #include "webkit/plugins/ppapi/ppb_layer_compositor_impl.h" 88 #include "webkit/plugins/ppapi/ppb_layer_compositor_impl.h"
93 #include "webkit/plugins/ppapi/ppb_proxy_impl.h" 89 #include "webkit/plugins/ppapi/ppb_proxy_impl.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 return ::ppapi::thunk::GetPPB_Find_Thunk(); 281 return ::ppapi::thunk::GetPPB_Find_Thunk();
286 if (strcmp(name, PPB_FLASH_INTERFACE) == 0) 282 if (strcmp(name, PPB_FLASH_INTERFACE) == 0)
287 return PPB_Flash_Impl::GetInterface(); 283 return PPB_Flash_Impl::GetInterface();
288 if (strcmp(name, PPB_FLASH_CLIPBOARD_INTERFACE) == 0) 284 if (strcmp(name, PPB_FLASH_CLIPBOARD_INTERFACE) == 0)
289 return PPB_Flash_Clipboard_Impl::GetInterface(); 285 return PPB_Flash_Clipboard_Impl::GetInterface();
290 if (strcmp(name, PPB_FLASH_FILE_FILEREF_INTERFACE) == 0) 286 if (strcmp(name, PPB_FLASH_FILE_FILEREF_INTERFACE) == 0)
291 return PPB_Flash_File_FileRef_Impl::GetInterface(); 287 return PPB_Flash_File_FileRef_Impl::GetInterface();
292 if (strcmp(name, PPB_FLASH_FILE_MODULELOCAL_INTERFACE) == 0) 288 if (strcmp(name, PPB_FLASH_FILE_MODULELOCAL_INTERFACE) == 0)
293 return PPB_Flash_File_ModuleLocal_Impl::GetInterface(); 289 return PPB_Flash_File_ModuleLocal_Impl::GetInterface();
294 if (strcmp(name, PPB_FLASH_MENU_INTERFACE) == 0) 290 if (strcmp(name, PPB_FLASH_MENU_INTERFACE) == 0)
295 return PPB_Flash_Menu_Impl::GetInterface(); 291 return ::ppapi::thunk::GetPPB_Flash_Menu_Thunk();
296 if (strcmp(name, PPB_FONT_DEV_INTERFACE) == 0) 292 if (strcmp(name, PPB_FONT_DEV_INTERFACE) == 0)
297 return ::ppapi::thunk::GetPPB_Font_Thunk(); 293 return ::ppapi::thunk::GetPPB_Font_Thunk();
298 if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE) == 0) 294 if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE) == 0)
299 return PluginInstance::GetFullscreenInterface(); 295 return PluginInstance::GetFullscreenInterface();
300 if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0) 296 if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0)
301 return PPB_Graphics2D_Impl::GetInterface(); 297 return PPB_Graphics2D_Impl::GetInterface();
302 if (strcmp(name, PPB_IMAGEDATA_INTERFACE) == 0) 298 if (strcmp(name, PPB_IMAGEDATA_INTERFACE) == 0)
303 return PPB_ImageData_Impl::GetInterface(); 299 return ::ppapi::thunk::GetPPB_ImageData_Thunk();
304 if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0) 300 if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0)
305 return PPB_ImageData_Impl::GetTrustedInterface(); 301 return ::ppapi::thunk::GetPPB_ImageDataTrusted_Thunk();
306 if (name_prefix == GetInterfacePrefix(PPB_INSTANCE_INTERFACE)) 302 if (name_prefix == GetInterfacePrefix(PPB_INSTANCE_INTERFACE))
307 return PluginInstance::GetInterface(name); 303 return PluginInstance::GetInterface(name);
308 if (strcmp(name, PPB_INSTANCE_PRIVATE_INTERFACE) == 0) 304 if (strcmp(name, PPB_INSTANCE_PRIVATE_INTERFACE) == 0)
309 return PluginInstance::GetPrivateInterface(); 305 return PluginInstance::GetPrivateInterface();
310 if (strcmp(name, PPB_MESSAGING_INTERFACE) == 0) 306 if (strcmp(name, PPB_MESSAGING_INTERFACE) == 0)
311 return PluginInstance::GetMessagingInterface(); 307 return PluginInstance::GetMessagingInterface();
312 if (strcmp(name, PPB_PROXY_PRIVATE_INTERFACE) == 0) 308 if (strcmp(name, PPB_PROXY_PRIVATE_INTERFACE) == 0)
313 return PPB_Proxy_Impl::GetInterface(); 309 return PPB_Proxy_Impl::GetInterface();
314 if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE) == 0) 310 if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE) == 0)
315 return PPB_Scrollbar_Impl::GetInterface(); 311 return PPB_Scrollbar_Impl::GetInterface();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 return PPB_OpenGLES_Impl::GetInterface(); 349 return PPB_OpenGLES_Impl::GetInterface();
354 if (strcmp(name, PPB_SURFACE_3D_DEV_INTERFACE) == 0) 350 if (strcmp(name, PPB_SURFACE_3D_DEV_INTERFACE) == 0)
355 return PPB_Surface3D_Impl::GetInterface(); 351 return PPB_Surface3D_Impl::GetInterface();
356 if (strcmp(name, PPB_LAYER_COMPOSITOR_DEV_INTERFACE) == 0) 352 if (strcmp(name, PPB_LAYER_COMPOSITOR_DEV_INTERFACE) == 0)
357 return PPB_LayerCompositor_Impl::GetInterface(); 353 return PPB_LayerCompositor_Impl::GetInterface();
358 } 354 }
359 #endif // ENABLE_GPU 355 #endif // ENABLE_GPU
360 356
361 #ifdef ENABLE_FLAPPER_HACKS 357 #ifdef ENABLE_FLAPPER_HACKS
362 if (strcmp(name, PPB_FLASH_NETCONNECTOR_INTERFACE) == 0) 358 if (strcmp(name, PPB_FLASH_NETCONNECTOR_INTERFACE) == 0)
363 return PPB_Flash_NetConnector_Impl::GetInterface(); 359 return ::ppapi::thunk::GetPPB_Flash_NetConnector_Thunk();
364 #endif // ENABLE_FLAPPER_HACKS 360 #endif // ENABLE_FLAPPER_HACKS
365 361
366 #if defined(ENABLE_P2P_APIS) 362 #if defined(ENABLE_P2P_APIS)
367 if (strcmp(name, PPB_TRANSPORT_DEV_INTERFACE) == 0) 363 if (strcmp(name, PPB_TRANSPORT_DEV_INTERFACE) == 0)
368 return PPB_Transport_Impl::GetInterface(); 364 return PPB_Transport_Impl::GetInterface();
369 #endif 365 #endif
370 366
371 // Only support the testing interface when the command line switch is 367 // Only support the testing interface when the command line switch is
372 // specified. This allows us to prevent people from (ab)using this interface 368 // specified. This allows us to prevent people from (ab)using this interface
373 // in production code. 369 // in production code.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 int retval = entry_points_.initialize_module(pp_module(), &GetInterface); 592 int retval = entry_points_.initialize_module(pp_module(), &GetInterface);
597 if (retval != 0) { 593 if (retval != 0) {
598 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; 594 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval;
599 return false; 595 return false;
600 } 596 }
601 return true; 597 return true;
602 } 598 }
603 599
604 } // namespace ppapi 600 } // namespace ppapi
605 } // namespace webkit 601 } // namespace webkit
OLDNEW
« no previous file with comments | « ppapi/thunk/thunk.h ('k') | webkit/plugins/ppapi/ppb_flash_menu_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698