| 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 // For loading files, we make use of overlapped i/o to ensure that reading from | 5 // For loading files, we make use of overlapped i/o to ensure that reading from |
| 6 // the filesystem (e.g., a network filesystem) does not block the calling | 6 // the filesystem (e.g., a network filesystem) does not block the calling |
| 7 // thread. An alternative approach would be to use a background thread or pool | 7 // thread. An alternative approach would be to use a background thread or pool |
| 8 // of threads, but it seems better to leverage the operating system's ability | 8 // of threads, but it seems better to leverage the operating system's ability |
| 9 // to do background file reads for us. | 9 // to do background file reads for us. |
| 10 // | 10 // |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return false; | 138 return false; |
| 139 | 139 |
| 140 *location = FilePathToFileURL(new_path); | 140 *location = FilePathToFileURL(new_path); |
| 141 *http_status_code = 301; | 141 *http_status_code = 301; |
| 142 return true; | 142 return true; |
| 143 #else | 143 #else |
| 144 return false; | 144 return false; |
| 145 #endif | 145 #endif |
| 146 } | 146 } |
| 147 | 147 |
| 148 #if 0 |
| 148 Filter* URLRequestFileJob::SetupFilter() const { | 149 Filter* URLRequestFileJob::SetupFilter() const { |
| 149 // Bug 9936 - .svgz files needs to be decompressed. | 150 // Bug 9936 - .svgz files needs to be decompressed. |
| 150 return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz") | 151 return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz") |
| 151 ? Filter::GZipFactory() | 152 ? Filter::GZipFactory() |
| 152 : NULL; | 153 : NULL; |
| 153 } | 154 } |
| 155 #endif |
| 154 | 156 |
| 155 bool URLRequestFileJob::GetMimeType(std::string* mime_type) const { | 157 bool URLRequestFileJob::GetMimeType(std::string* mime_type) const { |
| 156 DCHECK(request_); | 158 DCHECK(request_); |
| 157 if (meta_info_.mime_type_result) { | 159 if (meta_info_.mime_type_result) { |
| 158 *mime_type = meta_info_.mime_type; | 160 *mime_type = meta_info_.mime_type; |
| 159 return true; | 161 return true; |
| 160 } | 162 } |
| 161 return false; | 163 return false; |
| 162 } | 164 } |
| 163 | 165 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 DCHECK_GE(remaining_bytes_, 0); | 295 DCHECK_GE(remaining_bytes_, 0); |
| 294 } | 296 } |
| 295 | 297 |
| 296 OnReadComplete(buf.get(), result); | 298 OnReadComplete(buf.get(), result); |
| 297 buf = NULL; | 299 buf = NULL; |
| 298 | 300 |
| 299 ReadRawDataComplete(result); | 301 ReadRawDataComplete(result); |
| 300 } | 302 } |
| 301 | 303 |
| 302 } // namespace net | 304 } // namespace net |
| OLD | NEW |