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 |