| 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/fileapi/file_system_url_request_job.h" | 5 #include "webkit/fileapi/file_system_url_request_job.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 int FileSystemURLRequestJob::GetResponseCode() const { | 149 int FileSystemURLRequestJob::GetResponseCode() const { |
| 150 if (response_info_.get()) | 150 if (response_info_.get()) |
| 151 return 200; | 151 return 200; |
| 152 return URLRequestJob::GetResponseCode(); | 152 return URLRequestJob::GetResponseCode(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void FileSystemURLRequestJob::StartAsync() { | 155 void FileSystemURLRequestJob::StartAsync() { |
| 156 if (!request_) | 156 if (!request_) |
| 157 return; | 157 return; |
| 158 DCHECK(!reader_.get()); | 158 DCHECK(!reader_.get()); |
| 159 url_ = FileSystemURL(request_->url()); | 159 url_ = file_system_context_->CrackURL(request_->url()); |
| 160 base::PlatformFileError error_code; | 160 base::PlatformFileError error_code; |
| 161 FileSystemOperation* operation = | 161 FileSystemOperation* operation = |
| 162 file_system_context_->CreateFileSystemOperation(url_, &error_code); | 162 file_system_context_->CreateFileSystemOperation(url_, &error_code); |
| 163 if (error_code != base::PLATFORM_FILE_OK) { | 163 if (error_code != base::PLATFORM_FILE_OK) { |
| 164 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, | 164 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, |
| 165 net::PlatformFileErrorToNetError(error_code))); | 165 net::PlatformFileErrorToNetError(error_code))); |
| 166 return; | 166 return; |
| 167 } | 167 } |
| 168 operation->GetMetadata( | 168 operation->GetMetadata( |
| 169 url_, | 169 url_, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 return false; | 245 return false; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 248 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
| 249 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 249 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace fileapi | 252 } // namespace fileapi |
| OLD | NEW |