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

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

Issue 6882125: Pepper: Enable custom content-transfer-encoding header to be set in URL requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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 89cf3c115c482a11213e3b25e7374fa5dcd0503a..7bae8ba49db229df47d148923521b971657738bd 100644
--- a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
@@ -202,7 +202,8 @@ PPB_URLRequestInfo_Impl::PPB_URLRequestInfo_Impl(PluginInstance* instance)
record_upload_progress_(false),
has_custom_referrer_url_(false),
allow_cross_origin_requests_(false),
- allow_credentials_(false) {
+ allow_credentials_(false),
+ has_custom_content_transfer_encoding_(false) {
}
PPB_URLRequestInfo_Impl::~PPB_URLRequestInfo_Impl() {
@@ -224,6 +225,10 @@ bool PPB_URLRequestInfo_Impl::SetUndefinedProperty(
has_custom_referrer_url_ = false;
custom_referrer_url_ = std::string();
return true;
+ case PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING:
+ has_custom_content_transfer_encoding_ = false;
+ custom_content_transfer_encoding_ = std::string();
+ return true;
default:
return false;
}
@@ -274,6 +279,10 @@ bool PPB_URLRequestInfo_Impl::SetStringProperty(PP_URLRequestProperty property,
has_custom_referrer_url_ = true;
custom_referrer_url_ = value;
return true;
+ case PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING:
+ has_custom_content_transfer_encoding_ = true;
+ custom_content_transfer_encoding_ = value;
+ return true;
default:
return false;
}
@@ -350,11 +359,19 @@ WebURLRequest PPB_URLRequestInfo_Impl::ToWebURLRequest(WebFrame* frame) const {
frame->setReferrerForRequest(web_request, WebURL()); // Use default.
}
+ if (has_custom_content_transfer_encoding_) {
+ if (!custom_content_transfer_encoding_.empty()) {
+ web_request.addHTTPHeaderField(
+ WebString::fromUTF8("Content-Transfer-Encoding"),
+ WebString::fromUTF8(custom_content_transfer_encoding_));
+ }
+ }
+
return web_request;
}
bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const {
- return has_custom_referrer_url_;
+ return has_custom_referrer_url_ || has_custom_content_transfer_encoding_;
}
} // namespace ppapi
« 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