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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.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
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/api/dev/ppb_url_util_dev.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
===================================================================
--- content/renderer/pepper/pepper_plugin_instance_impl.cc (revision 219784)
+++ content/renderer/pepper/pepper_plugin_instance_impl.cc (working copy)
@@ -93,6 +93,7 @@
#include "third_party/WebKit/public/web/WebBindings.h"
#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
#include "third_party/WebKit/public/web/WebCursorInfo.h"
+#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
@@ -2498,6 +2499,24 @@
components);
}
+PP_Var PepperPluginInstanceImpl::GetPluginReferrerURL(
+ PP_Instance instance,
+ PP_URLComponents_Dev* components) {
+ WebKit::WebDocument document = container()->element().document();
+ if (!full_frame_)
+ return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(),
Tom Sepez 2013/08/29 20:07:56 Does this leak info that would have otherwise been
bbudge 2013/09/06 20:35:45 It's a Dev interface, so can't be used by apps fro
+ components);
+ WebFrame* frame = document.frame();
+ if (!frame)
+ return PP_MakeUndefined();
+ const WebURLRequest& request = frame->dataSource()->originalRequest();
+ WebString referer = request.httpHeaderField("Referer");
+ if (referer.isEmpty())
+ return PP_MakeUndefined();
+ return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(GURL(referer),
+ components);
+}
+
PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied(
scoped_refptr<PluginModule> module) {
// Save the original module and switch over to the new one now that this
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/api/dev/ppb_url_util_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698