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

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
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,20 @@
components);
}
+PP_Var PepperPluginInstanceImpl::GetPluginRefererURL(
+ PP_Instance instance,
+ PP_URLComponents_Dev* components) {
+ WebFrame* frame = container_->element().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

Powered by Google App Engine
This is Rietveld 408576698