From 087ce7477bfbc656e7ce8931d6036b7b179f85b8 Mon Sep 17 00:00:00 2001 From: "piman@google.com" Date: Thu, 31 Mar 2011 21:46:45 +0000 Subject: Add GetPluginURL to PPB_URLUtil_Dev BUG=chromium-os:13693 TEST=http://www.ford.com/cars/taurus/ with pepper flash Review URL: http://codereview.chromium.org/6740013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80085 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/proxy/ppapi_messages.h | 3 +++ ppapi/proxy/ppb_url_util_proxy.cc | 23 ++++++++++++++++++++++- ppapi/proxy/ppb_url_util_proxy.h | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) (limited to 'ppapi/proxy') diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index d40c5a46..fad4e8b 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -689,6 +689,9 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBURLUtil_DocumentCanAccessDocument, IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLUtil_GetDocumentURL, PP_Instance /* active */, pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLUtil_GetPluginInstanceURL, + PP_Instance /* active */, + pp::proxy::SerializedVar /* result */) // PPB_Var. IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_AddRefObject, diff --git a/ppapi/proxy/ppb_url_util_proxy.cc b/ppapi/proxy/ppb_url_util_proxy.cc index bcff053..17b36ea 100644 --- a/ppapi/proxy/ppb_url_util_proxy.cc +++ b/ppapi/proxy/ppb_url_util_proxy.cc @@ -120,6 +120,18 @@ PP_Var GetDocumentURL(PP_Instance instance, return ConvertComponentsAndReturnURL(result.Return(dispatcher), components); } +PP_Var GetPluginInstanceURL(PP_Instance instance, + struct PP_URLComponents_Dev* components) { + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_MakeNull(); + + ReceiveSerializedVarReturnValue result; + dispatcher->Send(new PpapiHostMsg_PPBURLUtil_GetPluginInstanceURL( + INTERFACE_ID_PPB_URL_UTIL, instance, &result)); + return ConvertComponentsAndReturnURL(result.Return(dispatcher), components); +} + const PPB_URLUtil_Dev url_util_interface = { &Canonicalize, &ResolveRelativeToURL, @@ -127,7 +139,8 @@ const PPB_URLUtil_Dev url_util_interface = { &IsSameSecurityOrigin, &DocumentCanRequest, &DocumentCanAccessDocument, - &GetDocumentURL + &GetDocumentURL, + &GetPluginInstanceURL }; InterfaceProxy* CreateURLUtilProxy(Dispatcher* dispatcher, @@ -168,6 +181,8 @@ bool PPB_URLUtil_Proxy::OnMessageReceived(const IPC::Message& msg) { OnMsgDocumentCanAccessDocument) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLUtil_GetDocumentURL, OnMsgGetDocumentURL) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLUtil_GetPluginInstanceURL, + OnMsgGetPluginInstanceURL) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -202,6 +217,12 @@ void PPB_URLUtil_Proxy::OnMsgGetDocumentURL(PP_Instance instance, ppb_url_util_target()->GetDocumentURL(instance, NULL)); } +void PPB_URLUtil_Proxy::OnMsgGetPluginInstanceURL( + PP_Instance instance, SerializedVarReturnValue result) { + result.Return(dispatcher(), + ppb_url_util_target()->GetPluginInstanceURL(instance, NULL)); +} + } // namespace proxy } // namespace pp diff --git a/ppapi/proxy/ppb_url_util_proxy.h b/ppapi/proxy/ppb_url_util_proxy.h index 2d4e001..548d2ef 100644 --- a/ppapi/proxy/ppb_url_util_proxy.h +++ b/ppapi/proxy/ppb_url_util_proxy.h @@ -41,6 +41,8 @@ class PPB_URLUtil_Proxy : public InterfaceProxy { PP_Bool* result); void OnMsgGetDocumentURL(PP_Instance instance, SerializedVarReturnValue result); + void OnMsgGetPluginInstanceURL(PP_Instance instance, + SerializedVarReturnValue result); DISALLOW_COPY_AND_ASSIGN(PPB_URLUtil_Proxy); }; -- cgit v1.1