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

Unified Diff: content/renderer/npapi/webplugin_impl.cc

Issue 736743003: Use content::Referrer to pass around referrers in the plugin code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 1 month 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/npapi/webplugin_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/npapi/webplugin_impl.cc
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index 4370dec79222cc9477692a4dc2ee52dbdbe742cf..2c75d42b189b72c89da2e625a6c34f1faddcddf8 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -650,7 +650,7 @@ bool WebPluginImpl::SetPostData(WebURLRequest* request,
return rv;
}
-bool WebPluginImpl::IsValidUrl(const GURL& url, Referrer referrer_flag) {
+bool WebPluginImpl::IsValidUrl(const GURL& url, ReferrerValue referrer_flag) {
if (referrer_flag == PLUGIN_SRC &&
mime_type_ == kFlashPluginSwfMimeType &&
url.GetOrigin() != plugin_url_.GetOrigin()) {
@@ -682,7 +682,7 @@ WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(
const char* buf,
unsigned int len,
int notify_id,
- Referrer referrer_flag) {
+ ReferrerValue referrer_flag) {
// If there is no target, there is nothing to do
if (!target)
return NOT_ROUTED;
@@ -1161,7 +1161,7 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
unsigned int len,
int notify_id,
bool popups_allowed,
- Referrer referrer_flag,
+ ReferrerValue referrer_flag,
bool notify_redirects,
bool is_plugin_src_load) {
// For this request, we either route the output to a frame
@@ -1233,8 +1233,9 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
// WebFrameImpl::setReferrerForRequest does.
WebURLRequest request(complete_url);
SetReferrer(&request, referrer_flag);
- GURL referrer(
- request.httpHeaderField(WebString::fromUTF8("Referer")).utf8());
+ Referrer referrer(
+ GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
+ request.referrerPolicy());
GURL first_party_for_cookies = webframe_->document().firstPartyForCookies();
delegate_->FetchURL(resource_id, notify_id, complete_url,
@@ -1269,7 +1270,7 @@ bool WebPluginImpl::InitiateHTTPRequest(unsigned long resource_id,
const char* buf,
int buf_len,
const char* range_info,
- Referrer referrer_flag,
+ ReferrerValue referrer_flag,
bool notify_redirects,
bool is_plugin_src_load) {
if (!client) {
@@ -1520,7 +1521,7 @@ void WebPluginImpl::TearDownPluginInstance(
}
void WebPluginImpl::SetReferrer(blink::WebURLRequest* request,
- Referrer referrer_flag) {
+ ReferrerValue referrer_flag) {
switch (referrer_flag) {
case DOCUMENT_URL:
webframe_->setReferrerForRequest(*request, GURL());
« no previous file with comments | « content/renderer/npapi/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698