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

Unified Diff: webkit/glue/webplugin_impl.cc

Issue 3180: This fixes the following bugs:-... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webplugin_impl.cc
===================================================================
--- webkit/glue/webplugin_impl.cc (revision 2527)
+++ webkit/glue/webplugin_impl.cc (working copy)
@@ -237,7 +237,7 @@
WebFrameImpl *frame,
WebPluginDelegate* delegate,
bool load_manually) {
- WebPluginImpl* webplugin = new WebPluginImpl(element, frame, delegate);
+ WebPluginImpl* webplugin = new WebPluginImpl(element, frame, delegate, url);
if (!delegate->Initialize(url, argn, argv, argc, webplugin, load_manually)) {
delegate->PluginDestroyed();
@@ -253,7 +253,8 @@
WebPluginImpl::WebPluginImpl(WebCore::Element* element,
WebFrameImpl* webframe,
- WebPluginDelegate* delegate)
+ WebPluginDelegate* delegate,
+ const GURL& plugin_url)
: element_(element),
webframe_(webframe),
delegate_(delegate),
@@ -262,7 +263,8 @@
force_geometry_update_(false),
visible_(false),
widget_(NULL),
- received_first_paint_notification_(false) {
+ received_first_paint_notification_(false),
+ plugin_url_(plugin_url) {
}
WebPluginImpl::~WebPluginImpl() {
@@ -1094,7 +1096,15 @@
if (range_info)
info.request.addHTTPHeaderField("Range", range_info);
- const WebCore::String& referrer = frame()->loader()->outgoingReferrer();
+ WebCore::String referrer;
+ // If the plugin is instantiated without a SRC URL, then use the
+ // containing frame URL as the referrer.
+ if (plugin_url_.spec().empty()) {
+ referrer = frame()->loader()->outgoingReferrer();
+ } else {
+ referrer = webkit_glue::StdStringToString(plugin_url_.spec());
+ }
+
if (!WebCore::FrameLoader::shouldHideReferrer(
complete_url_string.spec().c_str(), referrer)) {
info.request.setHTTPReferrer(referrer);
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698