| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/plugins/ppapi/url_request_info_util.h" | 5 #include "webkit/plugins/ppapi/url_request_info_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "net/http/http_util.h" | 9 #include "net/http/http_util.h" |
| 10 #include "ppapi/shared_impl/url_request_info_data.h" | 10 #include "ppapi/shared_impl/url_request_info_data.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 frame->setReferrerForRequest(*dest, GURL(data->custom_referrer_url)); | 177 frame->setReferrerForRequest(*dest, GURL(data->custom_referrer_url)); |
| 178 | 178 |
| 179 if (data->has_custom_content_transfer_encoding && | 179 if (data->has_custom_content_transfer_encoding && |
| 180 !data->custom_content_transfer_encoding.empty()) { | 180 !data->custom_content_transfer_encoding.empty()) { |
| 181 dest->addHTTPHeaderField( | 181 dest->addHTTPHeaderField( |
| 182 WebString::fromUTF8("Content-Transfer-Encoding"), | 182 WebString::fromUTF8("Content-Transfer-Encoding"), |
| 183 WebString::fromUTF8(data->custom_content_transfer_encoding)); | 183 WebString::fromUTF8(data->custom_content_transfer_encoding)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 if (data->has_custom_user_agent) { | 186 if (data->has_custom_user_agent) { |
| 187 bool was_after_preconnect_request = false; |
| 187 dest->setExtraData(new webkit_glue::WebURLRequestExtraDataImpl( | 188 dest->setExtraData(new webkit_glue::WebURLRequestExtraDataImpl( |
| 188 WebKit::WebReferrerPolicyDefault, // Ignored. | 189 WebKit::WebReferrerPolicyDefault, // Ignored. |
| 189 WebString::fromUTF8(data->custom_user_agent))); | 190 WebString::fromUTF8(data->custom_user_agent), |
| 191 was_after_preconnect_request)); |
| 190 } | 192 } |
| 191 | 193 |
| 192 return true; | 194 return true; |
| 193 } | 195 } |
| 194 | 196 |
| 195 bool URLRequestRequiresUniversalAccess( | 197 bool URLRequestRequiresUniversalAccess( |
| 196 const ::ppapi::URLRequestInfoData& data) { | 198 const ::ppapi::URLRequestInfoData& data) { |
| 197 return | 199 return |
| 198 data.has_custom_referrer_url || | 200 data.has_custom_referrer_url || |
| 199 data.has_custom_content_transfer_encoding || | 201 data.has_custom_content_transfer_encoding || |
| 200 data.has_custom_user_agent || | 202 data.has_custom_user_agent || |
| 201 url_util::FindAndCompareScheme(data.url, "javascript", NULL); | 203 url_util::FindAndCompareScheme(data.url, "javascript", NULL); |
| 202 } | 204 } |
| 203 | 205 |
| 204 } // namespace ppapi | 206 } // namespace ppapi |
| 205 } // namespace webkit | 207 } // namespace webkit |
| OLD | NEW |