| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_util_proxy.h" | 8 #include "base/file_util_proxy.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void FileSystemURLRequestJob::StartAsync() { | 133 void FileSystemURLRequestJob::StartAsync() { |
| 134 GURL origin_url; | 134 GURL origin_url; |
| 135 FileSystemType type; | 135 FileSystemType type; |
| 136 if (!CrackFileSystemURL(request_->url(), &origin_url, &type, | 136 if (!CrackFileSystemURL(request_->url(), &origin_url, &type, |
| 137 &relative_file_path_)) { | 137 &relative_file_path_)) { |
| 138 NotifyFailed(net::ERR_INVALID_URL); | 138 NotifyFailed(net::ERR_INVALID_URL); |
| 139 return; | 139 return; |
| 140 } | 140 } |
| 141 | 141 |
| 142 path_manager_->GetFileSystemRootPath( | 142 path_manager_->GetFileSystemRootPath( |
| 143 origin_url, type, false, // create | 143 origin_url, type, |
| 144 false, // create |
| 145 false, // is_file_system |
| 146 relative_file_path_, |
| 144 callback_factory_.NewCallback(&FileSystemURLRequestJob::DidGetRootPath)); | 147 callback_factory_.NewCallback(&FileSystemURLRequestJob::DidGetRootPath)); |
| 145 } | 148 } |
| 146 | 149 |
| 147 void FileSystemURLRequestJob::DidGetRootPath(bool success, | 150 void FileSystemURLRequestJob::DidGetRootPath(bool success, |
| 148 const FilePath& root_path, | 151 const FilePath& root_path, |
| 149 const std::string& name) { | 152 const std::string& name) { |
| 150 if (!success) { | 153 if (!success) { |
| 151 NotifyFailed(net::ERR_FILE_NOT_FOUND); | 154 NotifyFailed(net::ERR_FILE_NOT_FOUND); |
| 152 return; | 155 return; |
| 153 } | 156 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 247 } |
| 245 | 248 |
| 246 return false; | 249 return false; |
| 247 } | 250 } |
| 248 | 251 |
| 249 void FileSystemURLRequestJob::NotifyFailed(int rv) { | 252 void FileSystemURLRequestJob::NotifyFailed(int rv) { |
| 250 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 253 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 251 } | 254 } |
| 252 | 255 |
| 253 } // namespace fileapi | 256 } // namespace fileapi |
| OLD | NEW |