summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/ppb_url_request_info_impl.cc21
-rw-r--r--webkit/plugins/ppapi/ppb_url_request_info_impl.h5
2 files changed, 24 insertions, 2 deletions
diff --git a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
index 89cf3c1..7bae8ba 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
diff --git a/webkit/plugins/ppapi/ppb_url_request_info_impl.h b/webkit/plugins/ppapi/ppb_url_request_info_impl.h
index 1b06aa7..9d6c766 100644
--- a/webkit/plugins/ppapi/ppb_url_request_info_impl.h
+++ b/webkit/plugins/ppapi/ppb_url_request_info_impl.h
@@ -84,6 +84,11 @@ class PPB_URLRequestInfo_Impl : public Resource {
bool allow_cross_origin_requests_;
bool allow_credentials_;
+ // Similar to the custom referrer (above), but for custom content transfer
+ // encoding.
+ bool has_custom_content_transfer_encoding_;
+ std::string custom_content_transfer_encoding_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_URLRequestInfo_Impl);
};