| 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 "storage/browser/fileapi/file_system_url_request_job.h" | 5 #include "storage/browser/fileapi/file_system_url_request_job.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 void FileSystemURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { | 141 void FileSystemURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { |
| 142 if (response_info_) | 142 if (response_info_) |
| 143 *info = *response_info_; | 143 *info = *response_info_; |
| 144 } | 144 } |
| 145 | 145 |
| 146 int FileSystemURLRequestJob::GetResponseCode() const { | |
| 147 if (response_info_) | |
| 148 return 200; | |
| 149 return URLRequestJob::GetResponseCode(); | |
| 150 } | |
| 151 | |
| 152 void FileSystemURLRequestJob::StartAsync() { | 146 void FileSystemURLRequestJob::StartAsync() { |
| 153 if (!request_) | 147 if (!request_) |
| 154 return; | 148 return; |
| 155 DCHECK(!reader_.get()); | 149 DCHECK(!reader_.get()); |
| 156 url_ = file_system_context_->CrackURL(request_->url()); | 150 url_ = file_system_context_->CrackURL(request_->url()); |
| 157 if (!url_.is_valid()) { | 151 if (!url_.is_valid()) { |
| 158 file_system_context_->AttemptAutoMountForURLRequest( | 152 file_system_context_->AttemptAutoMountForURLRequest( |
| 159 request_, | 153 request_, |
| 160 storage_domain_, | 154 storage_domain_, |
| 161 base::Bind(&FileSystemURLRequestJob::DidAttemptAutoMount, | 155 base::Bind(&FileSystemURLRequestJob::DidAttemptAutoMount, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 replacements.SetPathStr(new_path); | 244 replacements.SetPathStr(new_path); |
| 251 *location = request_->url().ReplaceComponents(replacements); | 245 *location = request_->url().ReplaceComponents(replacements); |
| 252 *http_status_code = 301; // simulate a permanent redirect | 246 *http_status_code = 301; // simulate a permanent redirect |
| 253 return true; | 247 return true; |
| 254 } | 248 } |
| 255 | 249 |
| 256 return false; | 250 return false; |
| 257 } | 251 } |
| 258 | 252 |
| 259 } // namespace storage | 253 } // namespace storage |
| OLD | NEW |