| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ppb_url_request_info_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "googleurl/src/url_util.h" | 10 #include "googleurl/src/url_util.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const { | 126 bool PPB_URLRequestInfo_Impl::RequiresUniversalAccess() const { |
| 127 return | 127 return |
| 128 data().has_custom_referrer_url || | 128 data().has_custom_referrer_url || |
| 129 data().has_custom_content_transfer_encoding || | 129 data().has_custom_content_transfer_encoding || |
| 130 url_util::FindAndCompareScheme(data().url, "javascript", NULL); | 130 url_util::FindAndCompareScheme(data().url, "javascript", NULL); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool PPB_URLRequestInfo_Impl::ValidateData() { | 133 bool PPB_URLRequestInfo_Impl::ValidateData() { |
| 134 if (data().prefetch_buffer_lower_threshold < 0 || |
| 135 data().prefetch_buffer_upper_threshold < 0 || |
| 136 data().prefetch_buffer_upper_threshold <= |
| 137 data().prefetch_buffer_lower_threshold) { |
| 138 return false; |
| 139 } |
| 140 |
| 134 // Get the Resource objects for any file refs with only host resource (this | 141 // Get the Resource objects for any file refs with only host resource (this |
| 135 // is the state of the request as it comes off IPC). | 142 // is the state of the request as it comes off IPC). |
| 136 for (size_t i = 0; i < data().body.size(); ++i) { | 143 for (size_t i = 0; i < data().body.size(); ++i) { |
| 137 PPB_URLRequestInfo_Data::BodyItem& item = data().body[i]; | 144 PPB_URLRequestInfo_Data::BodyItem& item = data().body[i]; |
| 138 if (item.is_file && !item.file_ref) { | 145 if (item.is_file && !item.file_ref) { |
| 139 EnterResourceNoLock<PPB_FileRef_API> enter( | 146 EnterResourceNoLock<PPB_FileRef_API> enter( |
| 140 item.file_ref_host_resource.host_resource(), false); | 147 item.file_ref_host_resource.host_resource(), false); |
| 141 if (!enter.succeeded()) | 148 if (!enter.succeeded()) |
| 142 return false; | 149 return false; |
| 143 item.file_ref = enter.resource(); | 150 item.file_ref = enter.resource(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 webkit_glue::FilePathToWebString(platform_path), | 191 webkit_glue::FilePathToWebString(platform_path), |
| 185 start_offset, | 192 start_offset, |
| 186 number_of_bytes, | 193 number_of_bytes, |
| 187 expected_last_modified_time); | 194 expected_last_modified_time); |
| 188 return true; | 195 return true; |
| 189 } | 196 } |
| 190 | 197 |
| 191 | 198 |
| 192 } // namespace ppapi | 199 } // namespace ppapi |
| 193 } // namespace webkit | 200 } // namespace webkit |
| OLD | NEW |