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

Unified Diff: webkit/plugins/ppapi/ppb_url_request_info_impl.cc

Issue 6652014: Pepper: Add a property to URLRequestInfo to skip header validation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: redesign Created 9 years, 9 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: webkit/plugins/ppapi/ppb_url_request_info_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
index f7b472eea244251b655ee2c4654686110f10b709..491846ad6f1b6cc7c178af66cbb171d9c81d8c13 100644
--- a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -192,7 +192,8 @@ PPB_URLRequestInfo_Impl::PPB_URLRequestInfo_Impl(PluginInstance* instance)
stream_to_file_(false),
follow_redirects_(true),
record_download_progress_(false),
- record_upload_progress_(false) {
+ record_upload_progress_(false),
+ use_custom_referrer_(false) {
}
PPB_URLRequestInfo_Impl::~PPB_URLRequestInfo_Impl() {
@@ -222,6 +223,9 @@ bool PPB_URLRequestInfo_Impl::SetBooleanProperty(PP_URLRequestProperty property,
case PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS:
record_upload_progress_ = value;
return true;
+ case PP_URLREQUESTPROPERTY_USECUSTOMREFERRER:
+ use_custom_referrer_ = value;
+ return true;
default:
return false;
}
@@ -242,6 +246,9 @@ bool PPB_URLRequestInfo_Impl::SetStringProperty(PP_URLRequestProperty property,
return false;
headers_ = value;
return true;
+ case PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL:
+ custom_referrer_url_ = value;
+ return true;
default:
return false;
}
@@ -311,10 +318,19 @@ WebURLRequest PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame) const {
web_request.setHTTPBody(http_body);
}
- frame->setReferrerForRequest(web_request, WebURL()); // Use default.
+ if (use_custom_referrer()) {
+ if (!custom_referrer_url_.empty())
+ frame->setReferrerForRequest(web_request, GURL(custom_referrer_url_));
+ } else {
+ frame->setReferrerForRequest(web_request, WebURL()); // Use default.
+ }
+
return web_request;
}
+bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const {
+ return use_custom_referrer();
+}
+
} // namespace ppapi
} // namespace webkit
-
« ppapi/c/ppb_url_request_info.h ('K') | « webkit/plugins/ppapi/ppb_url_request_info_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698