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/resource_creation_proxy.cc | |
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/resource_creation_proxy.cc')
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.cc | 232 |
1 files changed, 113 insertions, 119 deletions
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) { |