| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (response_info_.get()) | 148 if (response_info_.get()) |
| 149 return 200; | 149 return 200; |
| 150 return URLRequestJob::GetResponseCode(); | 150 return URLRequestJob::GetResponseCode(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void FileSystemURLRequestJob::StartAsync() { | 153 void FileSystemURLRequestJob::StartAsync() { |
| 154 if (!request_) | 154 if (!request_) |
| 155 return; | 155 return; |
| 156 DCHECK(!reader_.get()); | 156 DCHECK(!reader_.get()); |
| 157 url_ = FileSystemURL(request_->url()); | 157 url_ = FileSystemURL(request_->url()); |
| 158 FileSystemOperationInterface* operation = | 158 FileSystemOperation* operation = |
| 159 file_system_context_->CreateFileSystemOperation(url_); | 159 file_system_context_->CreateFileSystemOperation(url_); |
| 160 if (!operation) { | 160 if (!operation) { |
| 161 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, | 161 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, |
| 162 net::ERR_INVALID_URL)); | 162 net::ERR_INVALID_URL)); |
| 163 return; | 163 return; |
| 164 } | 164 } |
| 165 operation->GetMetadata( | 165 operation->GetMetadata( |
| 166 url_, | 166 url_, |
| 167 base::Bind(&FileSystemURLRequestJob::DidGetMetadata, | 167 base::Bind(&FileSystemURLRequestJob::DidGetMetadata, |
| 168 weak_factory_.GetWeakPtr())); | 168 weak_factory_.GetWeakPtr())); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 return false; | 241 return false; |
| 242 } | 242 } |
| 243 | 243 |
| 244 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 244 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
| 245 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 245 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace fileapi | 248 } // namespace fileapi |
| OLD | NEW |