Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: webkit/fileapi/file_system_url_request_job.cc

Issue 10920087: Update callers of CreateFileSystemOperation so more detailed error codes can be returned. Where app… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 base::PlatformFileError error_code;
160 FileSystemOperation* operation = 161 FileSystemOperation* operation =
161 file_system_context_->CreateFileSystemOperation(url_); 162 file_system_context_->CreateFileSystemOperation(url_, &error_code);
162 if (!operation) { 163 if (error_code != base::PLATFORM_FILE_OK) {
163 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, 164 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
164 net::ERR_INVALID_URL)); 165 net::PlatformFileErrorToNetError(error_code)));
165 return; 166 return;
166 } 167 }
167 operation->GetMetadata( 168 operation->GetMetadata(
168 url_, 169 url_,
169 base::Bind(&FileSystemURLRequestJob::DidGetMetadata, 170 base::Bind(&FileSystemURLRequestJob::DidGetMetadata,
170 weak_factory_.GetWeakPtr())); 171 weak_factory_.GetWeakPtr()));
171 } 172 }
172 173
173 void FileSystemURLRequestJob::DidGetMetadata( 174 void FileSystemURLRequestJob::DidGetMetadata(
174 base::PlatformFileError error_code, 175 base::PlatformFileError error_code,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 242 }
242 243
243 return false; 244 return false;
244 } 245 }
245 246
246 void FileSystemURLRequestJob::NotifyFailed(int rv) { 247 void FileSystemURLRequestJob::NotifyFailed(int rv) {
247 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); 248 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
248 } 249 }
249 250
250 } // namespace fileapi 251 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_file_stream_reader.cc ('k') | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698