| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ = FileSystemURL(request_->url()); |
| 160 FileSystemOperationInterface* operation = | 160 FileSystemOperation* operation = |
| 161 file_system_context_->CreateFileSystemOperation(url_); | 161 file_system_context_->CreateFileSystemOperation(url_); |
| 162 if (!operation) { | 162 if (!operation) { |
| 163 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, | 163 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, |
| 164 net::ERR_INVALID_URL)); | 164 net::ERR_INVALID_URL)); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 operation->GetMetadata( | 167 operation->GetMetadata( |
| 168 url_, | 168 url_, |
| 169 base::Bind(&FileSystemURLRequestJob::DidGetMetadata, | 169 base::Bind(&FileSystemURLRequestJob::DidGetMetadata, |
| 170 weak_factory_.GetWeakPtr())); | 170 weak_factory_.GetWeakPtr())); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 return false; | 243 return false; |
| 244 } | 244 } |
| 245 | 245 |
| 246 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 246 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
| 247 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 247 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace fileapi | 250 } // namespace fileapi |
| OLD | NEW |