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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 23444004: Add GetPluginRefererURL to PPB_URLUtil_Dev interface to get the 'Referer' HTTP header value that wa… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/ppb_instance_proxy.cc
===================================================================
--- ppapi/proxy/ppb_instance_proxy.cc (revision 219784)
+++ ppapi/proxy/ppb_instance_proxy.cc (working copy)
@@ -173,6 +173,8 @@
OnHostMsgDocumentCanAccessDocument)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL,
OnHostMsgGetPluginInstanceURL)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginRefererURL,
+ OnHostMsgGetPluginRefererURL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey,
OnHostMsgNeedKey)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded,
@@ -526,6 +528,17 @@
components);
}
+PP_Var PPB_Instance_Proxy::GetPluginRefererURL(
+ PP_Instance instance,
+ PP_URLComponents_Dev* components) {
+ ReceiveSerializedVarReturnValue result;
+ dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetPluginRefererURL(
+ API_ID_PPB_INSTANCE, instance, &result));
+ return PPB_URLUtil_Shared::ConvertComponentsAndReturnURL(
+ result.Return(dispatcher()),
+ components);
+}
+
void PPB_Instance_Proxy::NeedKey(PP_Instance instance,
PP_Var key_system,
PP_Var session_id,
@@ -1032,6 +1045,18 @@
}
}
+void PPB_Instance_Proxy::OnHostMsgGetPluginRefererURL(
+ PP_Instance instance,
+ SerializedVarReturnValue result) {
+ if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV))
+ return;
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded()) {
+ result.Return(dispatcher(),
+ enter.functions()->GetPluginRefererURL(instance, NULL));
+ }
+}
+
void PPB_Instance_Proxy::OnHostMsgNeedKey(PP_Instance instance,
SerializedVarReceiveInput key_system,
SerializedVarReceiveInput session_id,

Powered by Google App Engine
This is Rietveld 408576698