diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 17:54:49 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 17:54:49 +0000 |
commit | 6761d6332edf7050a7686c0d98709e8ce6f6d2c7 (patch) | |
tree | 373979606204b7e86d71b291140284c297b82b99 /ppapi/proxy | |
parent | 8d91065d5a45e42f9a9597c064469a9c907976f2 (diff) | |
download | chromium_src-6761d6332edf7050a7686c0d98709e8ce6f6d2c7.zip chromium_src-6761d6332edf7050a7686c0d98709e8ce6f6d2c7.tar.gz chromium_src-6761d6332edf7050a7686c0d98709e8ce6f6d2c7.tar.bz2 |
Add #ifdefs to separate NaCl and non-NaCl PPAPI Proxy code.
This CL moves non-NaCl interface proxies like Flash, and also
temporarily moves unported interfaces such as Graphics3D.
BUG=116317
TEST=builds without PPAPI link errors
Review URL: https://chromiumcodereview.appspot.com/10116003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/interface_list.cc | 16 | ||||
-rw-r--r-- | ppapi/proxy/interface_list.h | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 387 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_param_traits.cc | 240 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_param_traits.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_loader_proxy.cc | 5 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.cc | 232 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.h | 73 |
8 files changed, 490 insertions, 469 deletions
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 4b526a0f..8d3fbcb 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -171,8 +171,10 @@ InterfaceList::InterfaceList() { INTERFACE_THUNK_NAME(iface_struct)()); #include "ppapi/thunk/interfaces_ppb_public_stable.h" +#if !defined(OS_NACL) #include "ppapi/thunk/interfaces_ppb_public_dev.h" #include "ppapi/thunk/interfaces_ppb_private.h" +#endif #undef PROXIED_API #undef PROXIED_IFACE @@ -187,6 +189,7 @@ InterfaceList::InterfaceList() { PPB_Core_Proxy::GetPPB_Core_Interface()); AddPPB(PPB_MESSAGELOOP_DEV_INTERFACE_0_1, API_ID_NONE, PPB_MessageLoop_Proxy::GetInterface()); +#if !defined(OS_NACL) AddPPB(PPB_OPENGLES2_INTERFACE_1_0, API_ID_NONE, PPB_OpenGLES2_Shared::GetInterface()); AddPPB(PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE_1_0, API_ID_NONE, @@ -201,6 +204,7 @@ InterfaceList::InterfaceList() { PPB_OpenGLES2_Shared::GetChromiumMapSubInterface()); AddPPB(PPB_OPENGLES2_QUERY_DEV_INTERFACE_1_0, API_ID_NONE, PPB_OpenGLES2_Shared::GetQueryInterface()); +#endif AddPPB(PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0, API_ID_NONE, PPB_Var_Shared::GetVarArrayBufferInterface1_0()); AddPPB(PPB_VAR_INTERFACE_1_1, API_ID_NONE, @@ -208,6 +212,7 @@ InterfaceList::InterfaceList() { AddPPB(PPB_VAR_INTERFACE_1_0, API_ID_NONE, PPB_Var_Shared::GetVarInterface1_0()); +#if !defined(OS_NACL) AddFlashInterfaces(); // PPB (browser) interfaces. @@ -218,6 +223,7 @@ InterfaceList::InterfaceList() { AddPPB(PPB_Testing_Proxy::GetInfo()); AddPPB(PPB_URLLoader_Proxy::GetTrustedInfo()); AddPPB(PPB_Var_Deprecated_Proxy::GetInfo()); +#endif // PPP (plugin) interfaces. // TODO(brettw) move these to interface_list*.h @@ -234,13 +240,15 @@ InterfaceList::InterfaceList() { // Old-style GetInfo PPP interfaces. // Do not add more stuff here, they should be added to interface_list*.h // TODO(brettw) remove these. - AddPPP(PPP_Graphics3D_Proxy::GetInfo()); AddPPP(PPP_InputEvent_Proxy::GetInfo()); - AddPPP(PPP_Instance_Private_Proxy::GetInfo()); AddPPP(PPP_Messaging_Proxy::GetInfo()); AddPPP(PPP_MouseLock_Proxy::GetInfo()); +#if !defined(OS_NACL) + AddPPP(PPP_Graphics3D_Proxy::GetInfo()); + AddPPP(PPP_Instance_Private_Proxy::GetInfo()); AddPPP(PPP_VideoCapture_Proxy::GetInfo()); AddPPP(PPP_VideoDecoder_Proxy::GetInfo()); +#endif } InterfaceList::~InterfaceList() { @@ -291,8 +299,8 @@ const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { return found->second.iface; } -void InterfaceList::AddFlashInterfaces() { #if !defined(OS_NACL) +void InterfaceList::AddFlashInterfaces() { AddProxy(API_ID_PPB_FLASH, &ProxyFactory<PPB_Flash_Proxy>); AddPPB(PPB_FLASH_INTERFACE_11_0, API_ID_PPB_FLASH, PPB_Flash_Proxy::GetInterface11()); @@ -335,8 +343,8 @@ void InterfaceList::AddFlashInterfaces() { // Only add the interface; PPB_TCPSocket_Private provides the API ID's proxy. AddPPB(PPB_FLASH_TCPSOCKET_INTERFACE_0_2, API_ID_PPB_TCPSOCKET_PRIVATE, thunk::GetPPB_TCPSocket_Private_0_3_Thunk()); -#endif // !defined(OS_NACL) } +#endif // !defined(OS_NACL) void InterfaceList::AddProxy(ApiID id, InterfaceProxy::Factory factory) { diff --git a/ppapi/proxy/interface_list.h b/ppapi/proxy/interface_list.h index 8df8903..82f70da 100644 --- a/ppapi/proxy/interface_list.h +++ b/ppapi/proxy/interface_list.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -52,11 +52,13 @@ class InterfaceList { typedef std::map<std::string, InterfaceInfo> NameToInterfaceInfoMap; +#if !defined(OS_NACL) // Registers the Flash-specific interfaces. // // TODO(brettw) these should be moved somewhere separately so we can compile // the proxy for NaCl without Flash interface support. void AddFlashInterfaces(); +#endif // !defined(OS_NACL) void AddProxy(ApiID id, InterfaceProxy::Factory factory); diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 40e9451..f83078e 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -115,12 +115,6 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::DeviceRefData) IPC_STRUCT_TRAITS_MEMBER(id) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(ppapi::proxy::PPPVideoCapture_Buffer) - IPC_STRUCT_TRAITS_MEMBER(resource) - IPC_STRUCT_TRAITS_MEMBER(handle) - IPC_STRUCT_TRAITS_MEMBER(size) -IPC_STRUCT_TRAITS_END() - IPC_STRUCT_TRAITS_BEGIN(ppapi::ViewData) IPC_STRUCT_TRAITS_MEMBER(rect) IPC_STRUCT_TRAITS_MEMBER(is_fullscreen) @@ -192,6 +186,13 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::PPB_URLRequestInfo_Data::BodyItem) IPC_STRUCT_TRAITS_MEMBER(expected_last_modified_time) IPC_STRUCT_TRAITS_END() +#if !defined(OS_NACL) +IPC_STRUCT_TRAITS_BEGIN(ppapi::proxy::PPPVideoCapture_Buffer) + IPC_STRUCT_TRAITS_MEMBER(resource) + IPC_STRUCT_TRAITS_MEMBER(handle) + IPC_STRUCT_TRAITS_MEMBER(size) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(ppapi::NetworkInfo) IPC_STRUCT_TRAITS_MEMBER(name) IPC_STRUCT_TRAITS_MEMBER(type) @@ -200,6 +201,7 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::NetworkInfo) IPC_STRUCT_TRAITS_MEMBER(display_name) IPC_STRUCT_TRAITS_MEMBER(mtu) IPC_STRUCT_TRAITS_END() +#endif // !defined(OS_NACL) // These are from the browser to the plugin. // Loads the given plugin. @@ -233,17 +235,18 @@ IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_ReserveInstanceId, IPC_MESSAGE_CONTROL1(PpapiMsg_SetPreferences, ppapi::Preferences) -// Network state notification from the browser for implementing -// PPP_NetworkState_Dev. -IPC_MESSAGE_CONTROL1(PpapiMsg_SetNetworkState, - bool /* online */) - // Sent in both directions to see if the other side supports the given // interface. IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, std::string /* interface_name */, bool /* result */) +#if !defined(OS_NACL) +// Network state notification from the browser for implementing +// PPP_NetworkState_Dev. +IPC_MESSAGE_CONTROL1(PpapiMsg_SetNetworkState, + bool /* online */) + // Instructs the plugin to clear data for the given site & time. The plugin // process will respond with PpapiHostMsg_ClearSiteDataResult. This is used // for Flash. @@ -260,6 +263,7 @@ IPC_SYNC_MESSAGE_CONTROL2_1(PpapiMsg_ConnectToPlugin, PP_Instance /* instance */, IPC::PlatformFileForTransit /* handle */, int32_t /* result */) +#endif // !defined(OS_NACL) // PPB_Audio. @@ -289,20 +293,6 @@ IPC_MESSAGE_ROUTED5(PpapiMsg_PPBAudioInput_OpenACK, base::SharedMemoryHandle /* handle */, int32_t /* length */) -// PPB_Broker. -IPC_MESSAGE_ROUTED3( - PpapiMsg_PPBBroker_ConnectComplete, - ppapi::HostResource /* broker */, - IPC::PlatformFileForTransit /* handle */, - int32_t /* result */) - -// PPB_FileChooser. -IPC_MESSAGE_ROUTED3( - PpapiMsg_PPBFileChooser_ChooseComplete, - ppapi::HostResource /* chooser */, - int32_t /* result_code (will be != PP_OK on failure */, - std::vector<ppapi::PPB_FileRef_CreateInfo> /* chosen_files */) - // PPB_FileIO. IPC_MESSAGE_ROUTED2(PpapiMsg_PPBFileIO_GeneralComplete, ppapi::HostResource /* file_io */, @@ -332,89 +322,6 @@ IPC_MESSAGE_ROUTED2( ppapi::HostResource /* filesystem */, int32_t /* result */) -// PPB_NetworkMonitor_Private. -IPC_MESSAGE_ROUTED2(PpapiMsg_PPBNetworkMonitor_NetworkList, - uint32 /* plugin_dispatcher_id */, - ppapi::NetworkList /* network_list */) - -// PPB_Talk -IPC_MESSAGE_ROUTED3( - PpapiMsg_PPBTalk_GetPermissionACK, - uint32 /* plugin_dispatcher_id */, - PP_Resource /* resource */, - int32_t /* result */) - -// PPB_TCPSocket_Private. -IPC_MESSAGE_ROUTED5(PpapiMsg_PPBTCPSocket_ConnectACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - PP_NetAddress_Private /* local_addr */, - PP_NetAddress_Private /* remote_addr */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - ppapi::PPB_X509Certificate_Fields /* certificate_fields */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_ReadACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - std::string /* data */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_WriteACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - int32_t /* bytes_written */) - -// PPB_UDPSocket_Private. -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBUDPSocket_BindACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - PP_NetAddress_Private /* bound_addr */) -IPC_MESSAGE_ROUTED5(PpapiMsg_PPBUDPSocket_RecvFromACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - std::string /* data */, - PP_NetAddress_Private /* remote_addr */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBUDPSocket_SendToACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* socket_id */, - bool /* succeeded */, - int32_t /* bytes_written */) - -// PPB_TCPServerSocket_Private. - -// |socket_resource| should not be used as Resource in browser. The -// only purpose of this argument is to be echoed back. -// |status| == PP_ERROR_NOSPACE means that the socket table is full -// and new socket can't be initialized. -// |status| == PP_ERROR_FAILED means that socket is correctly -// initialized (if needed) but Listen call is failed. -// |status| == PP_OK means that socket is correctly initialized (if -// needed) and Listen call succeeds. -IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPServerSocket_ListenACK, - uint32 /* plugin_dispatcher_id */, - PP_Resource /* socket_resource */, - uint32 /* socket_id */, - int32_t /* status */) -IPC_MESSAGE_ROUTED5(PpapiMsg_PPBTCPServerSocket_AcceptACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* server_socket_id */, - uint32 /* accepted_socket_id */, - PP_NetAddress_Private /* local_addr */, - PP_NetAddress_Private /* remote_addr */) - -// PPB_HostResolver_Private. -IPC_MESSAGE_ROUTED5(PpapiMsg_PPBHostResolver_ResolveACK, - uint32 /* plugin_dispatcher_id */, - uint32 /* host_resolver_id */, - bool /* succeeded */, - std::string /* canonical_name */, - ppapi::NetAddressList /* net_address_list */) - // PPB_Graphics2D. IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics2D_FlushACK, ppapi::HostResource /* graphics_2d */, @@ -519,11 +426,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleDocumentLoad, ppapi::HostResource /* url_loader */, PP_Bool /* result */) -// PPP_Instance_Private. -IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPInstancePrivate_GetInstanceObject, - PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* result */) - // PPP_Messaging. IPC_MESSAGE_ROUTED2(PpapiMsg_PPPMessaging_HandleMessage, PP_Instance /* instance */, @@ -558,9 +460,6 @@ IPC_MESSAGE_ROUTED2(PpapiMsg_PPPTextInput_RequestSurroundingText, // PPB_URLLoader // (Messages from browser to plugin to notify it of changes in state.) -IPC_MESSAGE_ROUTED1( - PpapiMsg_PPBURLLoader_UpdateProgress, - ppapi::proxy::PPBURLLoader_UpdateProgress_Params /* params */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, ppapi::HostResource /* loader */, int32 /* result */, @@ -568,6 +467,113 @@ IPC_MESSAGE_ROUTED3(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, IPC_MESSAGE_ROUTED2(PpapiMsg_PPBURLLoader_CallbackComplete, ppapi::HostResource /* loader */, int32_t /* result */) +#if !defined(OS_NACL) +// PPB_Broker. +IPC_MESSAGE_ROUTED3( + PpapiMsg_PPBBroker_ConnectComplete, + ppapi::HostResource /* broker */, + IPC::PlatformFileForTransit /* handle */, + int32_t /* result */) + +// PPB_FileChooser. +IPC_MESSAGE_ROUTED3( + PpapiMsg_PPBFileChooser_ChooseComplete, + ppapi::HostResource /* chooser */, + int32_t /* result_code (will be != PP_OK on failure */, + std::vector<ppapi::PPB_FileRef_CreateInfo> /* chosen_files */) + +// PPB_NetworkMonitor_Private. +IPC_MESSAGE_ROUTED2(PpapiMsg_PPBNetworkMonitor_NetworkList, + uint32 /* plugin_dispatcher_id */, + ppapi::NetworkList /* network_list */) + +// PPB_Talk +IPC_MESSAGE_ROUTED3( + PpapiMsg_PPBTalk_GetPermissionACK, + uint32 /* plugin_dispatcher_id */, + PP_Resource /* resource */, + int32_t /* result */) + +// PPB_TCPSocket_Private. +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBTCPSocket_ConnectACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + PP_NetAddress_Private /* local_addr */, + PP_NetAddress_Private /* remote_addr */) +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + ppapi::PPB_X509Certificate_Fields /* certificate_fields */) +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_ReadACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + std::string /* data */) +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPSocket_WriteACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + int32_t /* bytes_written */) + +// PPB_UDPSocket_Private. +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBUDPSocket_BindACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + PP_NetAddress_Private /* bound_addr */) +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBUDPSocket_RecvFromACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + std::string /* data */, + PP_NetAddress_Private /* remote_addr */) +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBUDPSocket_SendToACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* socket_id */, + bool /* succeeded */, + int32_t /* bytes_written */) + +// PPB_URLLoader_Trusted +IPC_MESSAGE_ROUTED1( + PpapiMsg_PPBURLLoader_UpdateProgress, + ppapi::proxy::PPBURLLoader_UpdateProgress_Params /* params */) + +// PPB_TCPServerSocket_Private. + +// |socket_resource| should not be used as Resource in browser. The +// only purpose of this argument is to be echoed back. +// |status| == PP_ERROR_NOSPACE means that the socket table is full +// and new socket can't be initialized. +// |status| == PP_ERROR_FAILED means that socket is correctly +// initialized (if needed) but Listen call is failed. +// |status| == PP_OK means that socket is correctly initialized (if +// needed) and Listen call succeeds. +IPC_MESSAGE_ROUTED4(PpapiMsg_PPBTCPServerSocket_ListenACK, + uint32 /* plugin_dispatcher_id */, + PP_Resource /* socket_resource */, + uint32 /* socket_id */, + int32_t /* status */) +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBTCPServerSocket_AcceptACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* server_socket_id */, + uint32 /* accepted_socket_id */, + PP_NetAddress_Private /* local_addr */, + PP_NetAddress_Private /* remote_addr */) + +// PPB_HostResolver_Private. +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBHostResolver_ResolveACK, + uint32 /* plugin_dispatcher_id */, + uint32 /* host_resolver_id */, + bool /* succeeded */, + std::string /* canonical_name */, + ppapi::NetAddressList /* net_address_list */) + +// PPP_Instance_Private. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPInstancePrivate_GetInstanceObject, + PP_Instance /* instance */, + ppapi::proxy::SerializedVar /* result */) // PPB_VideoCapture_Dev IPC_MESSAGE_ROUTED3(PpapiMsg_PPBVideoCapture_EnumerateDevicesACK, @@ -621,6 +627,7 @@ IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_PictureReady, IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_NotifyError, ppapi::HostResource /* video_decoder */, PP_VideoDecodeError_Dev /* error */) +#endif // !defined(OS_NACL) // ----------------------------------------------------------------------------- // These are from the plugin to the renderer. @@ -666,38 +673,12 @@ IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBAudioInput_StartOrStop, IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBAudioInput_Close, ppapi::HostResource /* audio_input */) -// PPB_Broker. -IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBBroker_Create, - PP_Instance /* instance */, - ppapi::HostResource /* result_resource */) -IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBBroker_Connect, - ppapi::HostResource /* broker */) - -// PPB_Buffer. -IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBBuffer_Create, - PP_Instance /* instance */, - uint32_t /* size */, - ppapi::HostResource /* result_resource */, - base::SharedMemoryHandle /* result_shm_handle */) - // PPB_Core. IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_AddRefResource, ppapi::HostResource) IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_ReleaseResource, ppapi::HostResource) -// PPB_FileChooser. -IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFileChooser_Create, - PP_Instance /* instance */, - int /* mode */, - std::string /* accept_mime_types */, - ppapi::HostResource /* result */) -IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBFileChooser_Show, - ppapi::HostResource /* file_chooser */, - PP_Bool /* save_as */, - ppapi::proxy::SerializedVar /* suggested_file_name */, - bool /* require_user_gesture */) - // PPB_FileIO. IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFileIO_Create, PP_Instance /* instance */, @@ -772,12 +753,6 @@ IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFileSystem_Open, ppapi::HostResource /* result */, int64_t /* expected_size */) -// PPB_NetworkMonitor_Private. -IPC_MESSAGE_CONTROL1(PpapiHostMsg_PPBNetworkMonitor_Start, - uint32 /* plugin_dispatcher_id */) -IPC_MESSAGE_CONTROL1(PpapiHostMsg_PPBNetworkMonitor_Stop, - uint32 /* plugin_dispatcher_id */) - // PPB_Graphics2D. IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics2D_Create, PP_Instance /* instance */, @@ -837,14 +812,6 @@ IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer, IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics3D_SwapBuffers, ppapi::HostResource /* graphics_3d */) -// PPB_HostResolver_Private. -IPC_MESSAGE_CONTROL5(PpapiHostMsg_PPBHostResolver_Resolve, - int32 /* routing_id */, - uint32 /* plugin_dispatcher_id */, - uint32 /* host_resolver_id */, - ppapi::HostPortPair /* host_port */, - PP_HostResolver_Private_Hint /* hint */) - // PPB_ImageData. IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_Create, PP_Instance /* instance */, @@ -941,38 +908,6 @@ IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_SetCursor, ppapi::HostResource /* custom_image */, PP_Point /* hot_spot */) -IPC_SYNC_MESSAGE_ROUTED3_1( - PpapiHostMsg_PPBPDF_GetFontFileWithFallback, - PP_Instance /* instance */, - ppapi::proxy::SerializedFontDescription /* description */, - int32_t /* charset */, - ppapi::HostResource /* result */) -IPC_SYNC_MESSAGE_ROUTED2_1( - PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile, - ppapi::HostResource /* font_file */, - uint32_t /* table */, - std::string /* result */) - -// PPB_Talk. -IPC_MESSAGE_ROUTED2( - PpapiHostMsg_PPBTalk_GetPermission, - uint32 /* plugin_dispatcher_id */, - PP_Resource /* resource */) - -// PPB_Testing. -IPC_SYNC_MESSAGE_ROUTED3_1( - PpapiHostMsg_PPBTesting_ReadImageData, - ppapi::HostResource /* device_context_2d */, - ppapi::HostResource /* image */, - PP_Point /* top_left */, - PP_Bool /* result */) -IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, - PP_Instance /* instance */, - uint32 /* result */) -IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBTesting_SimulateInputEvent, - PP_Instance /* instance */, - ppapi::InputEventData /* input_event */) - // PPB_TextInput. IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBTextInput_SetTextInputType, PP_Instance /* instance */, @@ -1084,6 +1019,81 @@ IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated, int64 /* object_data */, ppapi::proxy::SerializedVar /* result */) +#if !defined(OS_NACL) +// PPB_Broker. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBBroker_Create, + PP_Instance /* instance */, + ppapi::HostResource /* result_resource */) +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBBroker_Connect, + ppapi::HostResource /* broker */) + +// PPB_Buffer. +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBBuffer_Create, + PP_Instance /* instance */, + uint32_t /* size */, + ppapi::HostResource /* result_resource */, + base::SharedMemoryHandle /* result_shm_handle */) + +// PPB_FileChooser. +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFileChooser_Create, + PP_Instance /* instance */, + int /* mode */, + std::string /* accept_mime_types */, + ppapi::HostResource /* result */) +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBFileChooser_Show, + ppapi::HostResource /* file_chooser */, + PP_Bool /* save_as */, + ppapi::proxy::SerializedVar /* suggested_file_name */, + bool /* require_user_gesture */) + +// PPB_NetworkMonitor_Private. +IPC_MESSAGE_CONTROL1(PpapiHostMsg_PPBNetworkMonitor_Start, + uint32 /* plugin_dispatcher_id */) +IPC_MESSAGE_CONTROL1(PpapiHostMsg_PPBNetworkMonitor_Stop, + uint32 /* plugin_dispatcher_id */) + +// PPB_HostResolver_Private. +IPC_MESSAGE_CONTROL5(PpapiHostMsg_PPBHostResolver_Resolve, + int32 /* routing_id */, + uint32 /* plugin_dispatcher_id */, + uint32 /* host_resolver_id */, + ppapi::HostPortPair /* host_port */, + PP_HostResolver_Private_Hint /* hint */) + +// PPB_PDF +IPC_SYNC_MESSAGE_ROUTED3_1( + PpapiHostMsg_PPBPDF_GetFontFileWithFallback, + PP_Instance /* instance */, + ppapi::proxy::SerializedFontDescription /* description */, + int32_t /* charset */, + ppapi::HostResource /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1( + PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile, + ppapi::HostResource /* font_file */, + uint32_t /* table */, + std::string /* result */) + + +// PPB_Talk. +IPC_MESSAGE_ROUTED2( + PpapiHostMsg_PPBTalk_GetPermission, + uint32 /* plugin_dispatcher_id */, + PP_Resource /* resource */) + +// PPB_Testing. +IPC_SYNC_MESSAGE_ROUTED3_1( + PpapiHostMsg_PPBTesting_ReadImageData, + ppapi::HostResource /* device_context_2d */, + ppapi::HostResource /* image */, + PP_Point /* top_left */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, + PP_Instance /* instance */, + uint32 /* result */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBTesting_SimulateInputEvent, + PP_Instance /* instance */, + ppapi::InputEventData /* input_event */) + // PPB_VideoCapture_Dev. IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBVideoCapture_Create, PP_Instance /* instance */, @@ -1133,7 +1143,6 @@ IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoDecoder_Reset, IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBVideoDecoder_Destroy, ppapi::HostResource /* video_decoder */) -#if !defined(OS_NACL) // PPB_Flash. IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, PP_Instance /* instance */, diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc index f29dc36..87ce4fc 100644 --- a/ppapi/proxy/ppapi_param_traits.cc +++ b/ppapi/proxy/ppapi_param_traits.cc @@ -194,8 +194,126 @@ bool ParamTraits<PP_ObjectProperty>::Read(const Message* m, void ParamTraits<PP_ObjectProperty>::Log(const param_type& p, std::string* l) { } -// PPBFlash_DrawGlyphs_Params -------------------------------------------------- +// PPB_FileRef_CreateInfo ------------------------------------------------------ + +// static +void ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Write(Message* m, + const param_type& p) { + ParamTraits<ppapi::HostResource>::Write(m, p.resource); + ParamTraits<int>::Write(m, p.file_system_type); + ParamTraits<std::string>::Write(m, p.path); + ParamTraits<std::string>::Write(m, p.name); +} + +// static +bool ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Read(const Message* m, + PickleIterator* iter, + param_type* r) { + return + ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) && + ParamTraits<int>::Read(m, iter, &r->file_system_type) && + ParamTraits<std::string>::Read(m, iter, &r->path) && + ParamTraits<std::string>::Read(m, iter, &r->name); +} + +// static +void ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Log(const param_type& p, + std::string* l) { +} + +// HostResource ---------------------------------------------------------------- + +// static +void ParamTraits<ppapi::HostResource>::Write(Message* m, + const param_type& p) { + ParamTraits<PP_Instance>::Write(m, p.instance()); + ParamTraits<PP_Resource>::Write(m, p.host_resource()); +} + +// static +bool ParamTraits<ppapi::HostResource>::Read(const Message* m, + PickleIterator* iter, + param_type* r) { + PP_Instance instance; + PP_Resource resource; + if (!ParamTraits<PP_Instance>::Read(m, iter, &instance) || + !ParamTraits<PP_Resource>::Read(m, iter, &resource)) + return false; + r->SetHostResource(instance, resource); + return true; +} + +// static +void ParamTraits<ppapi::HostResource>::Log(const param_type& p, + std::string* l) { +} + +// SerializedVar --------------------------------------------------------------- + +// static +void ParamTraits<ppapi::proxy::SerializedVar>::Write(Message* m, + const param_type& p) { + p.WriteToMessage(m); +} + +// static +bool ParamTraits<ppapi::proxy::SerializedVar>::Read(const Message* m, + PickleIterator* iter, + param_type* r) { + return r->ReadFromMessage(m, iter); +} + +// static +void ParamTraits<ppapi::proxy::SerializedVar>::Log(const param_type& p, + std::string* l) { +} + +// std::vector<SerializedVar> -------------------------------------------------- + +void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Write( + Message* m, + const param_type& p) { + WriteVectorWithoutCopy(m, p); +} + +// static +bool ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Read( + const Message* m, + PickleIterator* iter, + param_type* r) { + return ReadVectorWithoutCopy(m, iter, r); +} + +// static +void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Log( + const param_type& p, + std::string* l) { +} + +// std::vector<PPB_FileRef_CreateInfo> ----------------------------------------- + +void ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Write( + Message* m, + const param_type& p) { + WriteVectorWithoutCopy(m, p); +} + +// static +bool ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Read( + const Message* m, + PickleIterator* iter, + param_type* r) { + return ReadVectorWithoutCopy(m, iter, r); +} + +// static +void ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Log( + const param_type& p, + std::string* l) { +} + #if !defined(OS_NACL) +// PPBFlash_DrawGlyphs_Params -------------------------------------------------- // static void ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Write( Message* m, @@ -247,7 +365,6 @@ bool ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Read( ParamTraits<std::vector<PP_Point> >::Read(m, iter, &r->glyph_advances) && r->glyph_indices.size() == r->glyph_advances.size(); } -#endif // !defined(OS_NACL) // static void ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Log( @@ -255,33 +372,6 @@ void ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Log( std::string* l) { } -// PPB_FileRef_CreateInfo ------------------------------------------------------ - -// static -void ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Write(Message* m, - const param_type& p) { - ParamTraits<ppapi::HostResource>::Write(m, p.resource); - ParamTraits<int>::Write(m, p.file_system_type); - ParamTraits<std::string>::Write(m, p.path); - ParamTraits<std::string>::Write(m, p.name); -} - -// static -bool ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { - return - ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) && - ParamTraits<int>::Read(m, iter, &r->file_system_type) && - ParamTraits<std::string>::Read(m, iter, &r->path) && - ParamTraits<std::string>::Read(m, iter, &r->name); -} - -// static -void ParamTraits<ppapi::PPB_FileRef_CreateInfo>::Log(const param_type& p, - std::string* l) { -} - // PPBURLLoader_UpdateProgress_Params ------------------------------------------ // static @@ -376,97 +466,6 @@ void ParamTraits<ppapi::proxy::SerializedFontDescription>::Log( std::string* l) { } -// HostResource ---------------------------------------------------------------- - -// static -void ParamTraits<ppapi::HostResource>::Write(Message* m, - const param_type& p) { - ParamTraits<PP_Instance>::Write(m, p.instance()); - ParamTraits<PP_Resource>::Write(m, p.host_resource()); -} - -// static -bool ParamTraits<ppapi::HostResource>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { - PP_Instance instance; - PP_Resource resource; - if (!ParamTraits<PP_Instance>::Read(m, iter, &instance) || - !ParamTraits<PP_Resource>::Read(m, iter, &resource)) - return false; - r->SetHostResource(instance, resource); - return true; -} - -// static -void ParamTraits<ppapi::HostResource>::Log(const param_type& p, - std::string* l) { -} - -// SerializedVar --------------------------------------------------------------- - -// static -void ParamTraits<ppapi::proxy::SerializedVar>::Write(Message* m, - const param_type& p) { - p.WriteToMessage(m); -} - -// static -bool ParamTraits<ppapi::proxy::SerializedVar>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { - return r->ReadFromMessage(m, iter); -} - -// static -void ParamTraits<ppapi::proxy::SerializedVar>::Log(const param_type& p, - std::string* l) { -} - -// std::vector<SerializedVar> -------------------------------------------------- - -void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Write( - Message* m, - const param_type& p) { - WriteVectorWithoutCopy(m, p); -} - -// static -bool ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Read( - const Message* m, - PickleIterator* iter, - param_type* r) { - return ReadVectorWithoutCopy(m, iter, r); -} - -// static -void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Log( - const param_type& p, - std::string* l) { -} - -// std::vector<PPB_FileRef_CreateInfo> ----------------------------------------- - -void ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Write( - Message* m, - const param_type& p) { - WriteVectorWithoutCopy(m, p); -} - -// static -bool ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Read( - const Message* m, - PickleIterator* iter, - param_type* r) { - return ReadVectorWithoutCopy(m, iter, r); -} - -// static -void ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> >::Log( - const param_type& p, - std::string* l) { -} - // SerializedFlashMenu --------------------------------------------------------- // static @@ -508,5 +507,6 @@ bool ParamTraits<ppapi::PPB_X509Certificate_Fields>::Read(const Message* m, void ParamTraits<ppapi::PPB_X509Certificate_Fields>::Log(const param_type& p, std::string* l) { } +#endif // !defined(OS_NACL) } // namespace IPC diff --git a/ppapi/proxy/ppapi_param_traits.h b/ppapi/proxy/ppapi_param_traits.h index 0cbe7f4..5b12f60 100644 --- a/ppapi/proxy/ppapi_param_traits.h +++ b/ppapi/proxy/ppapi_param_traits.h @@ -147,6 +147,7 @@ struct PPAPI_PROXY_EXPORT ParamTraits< std::vector< static void Log(const param_type& p, std::string* l); }; +#if !defined(OS_NACL) template<> struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { typedef ppapi::proxy::SerializedFlashMenu param_type; @@ -162,6 +163,7 @@ struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> { static bool Read(const Message* m, PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); }; +#endif // !defined(OS_NACL) } // namespace IPC diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc index 5303e42..c300bb9 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.cc +++ b/ppapi/proxy/ppb_url_loader_proxy.cc @@ -57,6 +57,7 @@ void UpdateResourceLoadStatus(PP_Instance pp_instance, int64 total_bytes_to_be_sent, int64 bytes_received, int64 total_bytes_to_be_received) { +#if !defined(OS_NACL) Dispatcher* dispatcher = HostDispatcher::GetForInstance(pp_instance); if (!dispatcher) return; @@ -70,6 +71,7 @@ void UpdateResourceLoadStatus(PP_Instance pp_instance, params.total_bytes_to_be_received = total_bytes_to_be_received; dispatcher->Send(new PpapiMsg_PPBURLLoader_UpdateProgress( API_ID_PPB_URL_LOADER, params)); +#endif } InterfaceProxy* CreateURLLoaderProxy(Dispatcher* dispatcher) { @@ -424,9 +426,10 @@ bool PPB_URLLoader_Proxy::OnMessageReceived(const IPC::Message& msg) { OnMsgClose) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoader_GrantUniversalAccess, OnMsgGrantUniversalAccess) - +#if !defined(OS_NACL) IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_UpdateProgress, OnMsgUpdateProgress) +#endif IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, OnMsgReadResponseBodyAck) IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_CallbackComplete, diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 3cad900..d904813 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -66,6 +66,118 @@ ResourceCreationAPI* ResourceCreationProxy::AsResourceCreationAPI() { return this; } +PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { + return PPB_FileIO_Proxy::CreateProxyResource(instance); +} + +PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, + const char* path) { + return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); +} + +PP_Resource ResourceCreationProxy::CreateFileSystem( + PP_Instance instance, + PP_FileSystemType type) { + return PPB_FileSystem_Proxy::CreateProxyResource(instance, type); +} + +PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( + PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + uint32_t key_code, + struct PP_Var character_text) { + if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && + type != PP_INPUTEVENT_TYPE_KEYDOWN && + type != PP_INPUTEVENT_TYPE_KEYUP && + type != PP_INPUTEVENT_TYPE_CHAR) + return 0; + InputEventData data; + data.event_type = type; + data.event_time_stamp = time_stamp; + data.event_modifiers = modifiers; + data.key_code = key_code; + if (character_text.type == PP_VARTYPE_STRING) { + StringVar* text_str = StringVar::FromPPVar(character_text); + if (!text_str) + return 0; + data.character_text = text_str->value(); + } + + return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, + instance, data))->GetReference(); +} + +PP_Resource ResourceCreationProxy::CreateMouseInputEvent( + PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + PP_InputEvent_MouseButton mouse_button, + const PP_Point* mouse_position, + int32_t click_count, + const PP_Point* mouse_movement) { + if (type != PP_INPUTEVENT_TYPE_MOUSEDOWN && + type != PP_INPUTEVENT_TYPE_MOUSEUP && + type != PP_INPUTEVENT_TYPE_MOUSEMOVE && + type != PP_INPUTEVENT_TYPE_MOUSEENTER && + type != PP_INPUTEVENT_TYPE_MOUSELEAVE) + return 0; + + InputEventData data; + data.event_type = type; + data.event_time_stamp = time_stamp; + data.event_modifiers = modifiers; + data.mouse_button = mouse_button; + data.mouse_position = *mouse_position; + data.mouse_click_count = click_count; + data.mouse_movement = *mouse_movement; + + return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, + instance, data))->GetReference(); +} + +PP_Resource ResourceCreationProxy::CreateResourceArray( + PP_Instance instance, + const PP_Resource elements[], + uint32_t size) { + PPB_ResourceArray_Shared* object = new PPB_ResourceArray_Shared( + OBJECT_IS_PROXY, instance, elements, size); + return object->GetReference(); +} + +PP_Resource ResourceCreationProxy::CreateURLLoader(PP_Instance instance) { + return PPB_URLLoader_Proxy::CreateProxyResource(instance); +} + +PP_Resource ResourceCreationProxy::CreateURLRequestInfo( + PP_Instance instance, + const PPB_URLRequestInfo_Data& data) { + return (new PPB_URLRequestInfo_Shared(OBJECT_IS_PROXY, + instance, data))->GetReference(); +} + +PP_Resource ResourceCreationProxy::CreateWheelInputEvent( + PP_Instance instance, + PP_TimeTicks time_stamp, + uint32_t modifiers, + const PP_FloatPoint* wheel_delta, + const PP_FloatPoint* wheel_ticks, + PP_Bool scroll_by_page) { + InputEventData data; + data.event_type = PP_INPUTEVENT_TYPE_WHEEL; + data.event_time_stamp = time_stamp; + data.event_modifiers = modifiers; + data.wheel_delta = *wheel_delta; + data.wheel_ticks = *wheel_ticks; + data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); + + return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, + instance, data))->GetReference(); +} + +#if !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateAudio( PP_Instance instance, PP_Resource config_id, @@ -136,22 +248,6 @@ PP_Resource ResourceCreationProxy::CreateFileChooser( accept_mime_types); } -PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { - return PPB_FileIO_Proxy::CreateProxyResource(instance); -} - -PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, - const char* path) { - return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); -} - -PP_Resource ResourceCreationProxy::CreateFileSystem( - PP_Instance instance, - PP_FileSystemType type) { - return PPB_FileSystem_Proxy::CreateProxyResource(instance, type); -} - -#if !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateFlashMenu( PP_Instance instance, const PP_Flash_Menu* menu_data) { @@ -162,7 +258,6 @@ PP_Resource ResourceCreationProxy::CreateFlashMessageLoop( PP_Instance instance) { return PPB_Flash_MessageLoop_Proxy::CreateProxyResource(instance); } -#endif // !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance, const PP_Size& size, @@ -184,63 +279,6 @@ PP_Resource ResourceCreationProxy::CreateImageData(PP_Instance instance, init_to_zero); } -PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( - PP_Instance instance, - PP_InputEvent_Type type, - PP_TimeTicks time_stamp, - uint32_t modifiers, - uint32_t key_code, - struct PP_Var character_text) { - if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && - type != PP_INPUTEVENT_TYPE_KEYDOWN && - type != PP_INPUTEVENT_TYPE_KEYUP && - type != PP_INPUTEVENT_TYPE_CHAR) - return 0; - InputEventData data; - data.event_type = type; - data.event_time_stamp = time_stamp; - data.event_modifiers = modifiers; - data.key_code = key_code; - if (character_text.type == PP_VARTYPE_STRING) { - StringVar* text_str = StringVar::FromPPVar(character_text); - if (!text_str) - return 0; - data.character_text = text_str->value(); - } - - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, - instance, data))->GetReference(); -} - -PP_Resource ResourceCreationProxy::CreateMouseInputEvent( - PP_Instance instance, - PP_InputEvent_Type type, - PP_TimeTicks time_stamp, - uint32_t modifiers, - PP_InputEvent_MouseButton mouse_button, - const PP_Point* mouse_position, - int32_t click_count, - const PP_Point* mouse_movement) { - if (type != PP_INPUTEVENT_TYPE_MOUSEDOWN && - type != PP_INPUTEVENT_TYPE_MOUSEUP && - type != PP_INPUTEVENT_TYPE_MOUSEMOVE && - type != PP_INPUTEVENT_TYPE_MOUSEENTER && - type != PP_INPUTEVENT_TYPE_MOUSELEAVE) - return 0; - - InputEventData data; - data.event_type = type; - data.event_time_stamp = time_stamp; - data.event_modifiers = modifiers; - data.mouse_button = mouse_button; - data.mouse_position = *mouse_position; - data.mouse_click_count = click_count; - data.mouse_movement = *mouse_movement; - - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, - instance, data))->GetReference(); -} - PP_Resource ResourceCreationProxy::CreateNetworkMonitor( PP_Instance instance, PPB_NetworkMonitor_Callback callback, @@ -266,15 +304,6 @@ PP_Resource ResourceCreationProxy::CreateGraphics3DRaw( return 0; } -PP_Resource ResourceCreationProxy::CreateResourceArray( - PP_Instance instance, - const PP_Resource elements[], - uint32_t size) { - PPB_ResourceArray_Shared* object = new PPB_ResourceArray_Shared( - OBJECT_IS_PROXY, instance, elements, size); - return object->GetReference(); -} - PP_Resource ResourceCreationProxy::CreateScrollbar(PP_Instance instance, PP_Bool vertical) { NOTIMPLEMENTED(); // Not proxied yet. @@ -285,7 +314,6 @@ PP_Resource ResourceCreationProxy::CreateTalk(PP_Instance instance) { return PPB_Talk_Private_Proxy::CreateProxyResource(instance); } -#if !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateTCPServerSocketPrivate( PP_Instance instance) { return PPB_TCPServerSocket_Private_Proxy::CreateProxyResource(instance); @@ -295,7 +323,6 @@ PP_Resource ResourceCreationProxy::CreateTCPSocketPrivate( PP_Instance instance) { return PPB_TCPSocket_Private_Proxy::CreateProxyResource(instance); } -#endif // !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateTransport(PP_Instance instance, const char* name, @@ -304,23 +331,10 @@ PP_Resource ResourceCreationProxy::CreateTransport(PP_Instance instance, return 0; } -#if !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateUDPSocketPrivate( PP_Instance instance) { return PPB_UDPSocket_Private_Proxy::CreateProxyResource(instance); } -#endif // !defined(OS_NACL) - -PP_Resource ResourceCreationProxy::CreateURLLoader(PP_Instance instance) { - return PPB_URLLoader_Proxy::CreateProxyResource(instance); -} - -PP_Resource ResourceCreationProxy::CreateURLRequestInfo( - PP_Instance instance, - const PPB_URLRequestInfo_Data& data) { - return (new PPB_URLRequestInfo_Shared(OBJECT_IS_PROXY, - instance, data))->GetReference(); -} PP_Resource ResourceCreationProxy::CreateVideoCapture(PP_Instance instance) { return PPB_VideoCapture_Proxy::CreateProxyResource(instance); @@ -346,31 +360,11 @@ PP_Resource ResourceCreationProxy::CreateWebSocket(PP_Instance instance) { return 0; } -PP_Resource ResourceCreationProxy::CreateWheelInputEvent( - PP_Instance instance, - PP_TimeTicks time_stamp, - uint32_t modifiers, - const PP_FloatPoint* wheel_delta, - const PP_FloatPoint* wheel_ticks, - PP_Bool scroll_by_page) { - InputEventData data; - data.event_type = PP_INPUTEVENT_TYPE_WHEEL; - data.event_time_stamp = time_stamp; - data.event_modifiers = modifiers; - data.wheel_delta = *wheel_delta; - data.wheel_ticks = *wheel_ticks; - data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); - - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, - instance, data))->GetReference(); -} - -#if !defined(OS_NACL) PP_Resource ResourceCreationProxy::CreateX509CertificatePrivate( PP_Instance instance) { return PPB_X509Certificate_Private_Proxy::CreateProxyResource(instance); } -#endif +#endif // !defined(OS_NACL) bool ResourceCreationProxy::Send(IPC::Message* msg) { diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index bd8f83c..0bc9e72 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -38,6 +38,43 @@ class ResourceCreationProxy : public InterfaceProxy, virtual thunk::ResourceCreationAPI* AsResourceCreationAPI() OVERRIDE; // ResourceCreationAPI (called in plugin). + virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE; + virtual PP_Resource CreateFileRef(PP_Resource file_system, + const char* path) OVERRIDE; + virtual PP_Resource CreateFileSystem(PP_Instance instance, + PP_FileSystemType type) OVERRIDE; + virtual PP_Resource CreateKeyboardInputEvent( + PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + uint32_t key_code, + PP_Var character_text) OVERRIDE; + virtual PP_Resource CreateMouseInputEvent( + PP_Instance instance, + PP_InputEvent_Type type, + PP_TimeTicks time_stamp, + uint32_t modifiers, + PP_InputEvent_MouseButton mouse_button, + const PP_Point* mouse_position, + int32_t click_count, + const PP_Point* mouse_movement) OVERRIDE; + virtual PP_Resource CreateResourceArray(PP_Instance instance, + const PP_Resource elements[], + uint32_t size) OVERRIDE; + virtual PP_Resource CreateURLLoader(PP_Instance instance) OVERRIDE; + virtual PP_Resource CreateURLRequestInfo( + PP_Instance instance, + const PPB_URLRequestInfo_Data& data) OVERRIDE; + virtual PP_Resource CreateWheelInputEvent( + PP_Instance instance, + PP_TimeTicks time_stamp, + uint32_t modifiers, + const PP_FloatPoint* wheel_delta, + const PP_FloatPoint* wheel_ticks, + PP_Bool scroll_by_page) OVERRIDE; + +#if !defined(OS_NACL) virtual PP_Resource CreateAudio(PP_Instance instance, PP_Resource config_id, PPB_Audio_Callback audio_callback, @@ -63,11 +100,6 @@ class ResourceCreationProxy : public InterfaceProxy, PP_Instance instance, PP_FileChooserMode_Dev mode, const char* accept_mime_types) OVERRIDE; - virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE; - virtual PP_Resource CreateFileRef(PP_Resource file_system, - const char* path) OVERRIDE; - virtual PP_Resource CreateFileSystem(PP_Instance instance, - PP_FileSystemType type) OVERRIDE; virtual PP_Resource CreateFlashMenu(PP_Instance instance, const PP_Flash_Menu* menu_data) OVERRIDE; virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) OVERRIDE; @@ -85,29 +117,10 @@ class ResourceCreationProxy : public InterfaceProxy, PP_ImageDataFormat format, const PP_Size& size, PP_Bool init_to_zero) OVERRIDE; - virtual PP_Resource CreateKeyboardInputEvent( - PP_Instance instance, - PP_InputEvent_Type type, - PP_TimeTicks time_stamp, - uint32_t modifiers, - uint32_t key_code, - PP_Var character_text) OVERRIDE; - virtual PP_Resource CreateMouseInputEvent( - PP_Instance instance, - PP_InputEvent_Type type, - PP_TimeTicks time_stamp, - uint32_t modifiers, - PP_InputEvent_MouseButton mouse_button, - const PP_Point* mouse_position, - int32_t click_count, - const PP_Point* mouse_movement) OVERRIDE; virtual PP_Resource CreateNetworkMonitor( PP_Instance instance, PPB_NetworkMonitor_Callback callback, void* user_data) OVERRIDE; - virtual PP_Resource CreateResourceArray(PP_Instance instance, - const PP_Resource elements[], - uint32_t size) OVERRIDE; virtual PP_Resource CreateScrollbar(PP_Instance instance, PP_Bool vertical) OVERRIDE; virtual PP_Resource CreateTalk(PP_Instance instance) OVERRIDE; @@ -118,10 +131,6 @@ class ResourceCreationProxy : public InterfaceProxy, const char* name, PP_TransportType type) OVERRIDE; virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instance) OVERRIDE; - virtual PP_Resource CreateURLLoader(PP_Instance instance) OVERRIDE; - virtual PP_Resource CreateURLRequestInfo( - PP_Instance instance, - const PPB_URLRequestInfo_Data& data) OVERRIDE; virtual PP_Resource CreateVideoCapture(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateVideoDecoder( PP_Instance instance, @@ -130,15 +139,9 @@ class ResourceCreationProxy : public InterfaceProxy, virtual PP_Resource CreateVideoLayer(PP_Instance instance, PP_VideoLayerMode_Dev mode) OVERRIDE; virtual PP_Resource CreateWebSocket(PP_Instance instance) OVERRIDE; - virtual PP_Resource CreateWheelInputEvent( - PP_Instance instance, - PP_TimeTicks time_stamp, - uint32_t modifiers, - const PP_FloatPoint* wheel_delta, - const PP_FloatPoint* wheel_ticks, - PP_Bool scroll_by_page) OVERRIDE; virtual PP_Resource CreateX509CertificatePrivate( PP_Instance instance) OVERRIDE; +#endif // !defined(OS_NACL) virtual bool Send(IPC::Message* msg) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |