| 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_dir_url_request_job.h" | 5 #include "webkit/fileapi/file_system_dir_url_request_job.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util_proxy.h" | 10 #include "base/file_util_proxy.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void FileSystemDirURLRequestJob::StartAsync() { | 77 void FileSystemDirURLRequestJob::StartAsync() { |
| 78 GURL origin_url; | 78 GURL origin_url; |
| 79 FileSystemType type; | 79 FileSystemType type; |
| 80 if (!CrackFileSystemURL(request_->url(), &origin_url, &type, | 80 if (!CrackFileSystemURL(request_->url(), &origin_url, &type, |
| 81 &relative_dir_path_)) { | 81 &relative_dir_path_)) { |
| 82 NotifyFailed(net::ERR_INVALID_URL); | 82 NotifyFailed(net::ERR_INVALID_URL); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 path_manager_->GetFileSystemRootPath( | 86 path_manager_->GetFileSystemRootPath( |
| 87 origin_url, type, false, // create | 87 origin_url, type, |
| 88 false, // create |
| 89 false, // is_file_system |
| 90 relative_dir_path_, |
| 88 callback_factory_.NewCallback( | 91 callback_factory_.NewCallback( |
| 89 &FileSystemDirURLRequestJob::DidGetRootPath)); | 92 &FileSystemDirURLRequestJob::DidGetRootPath)); |
| 90 } | 93 } |
| 91 | 94 |
| 92 void FileSystemDirURLRequestJob::DidGetRootPath(bool success, | 95 void FileSystemDirURLRequestJob::DidGetRootPath(bool success, |
| 93 const FilePath& root_path, | 96 const FilePath& root_path, |
| 94 const std::string& name) { | 97 const std::string& name) { |
| 95 if (!success) { | 98 if (!success) { |
| 96 NotifyFailed(net::ERR_FILE_NOT_FOUND); | 99 NotifyFailed(net::ERR_FILE_NOT_FOUND); |
| 97 return; | 100 return; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 141 |
| 139 set_expected_content_size(data_.size()); | 142 set_expected_content_size(data_.size()); |
| 140 NotifyHeadersComplete(); | 143 NotifyHeadersComplete(); |
| 141 } | 144 } |
| 142 | 145 |
| 143 void FileSystemDirURLRequestJob::NotifyFailed(int rv) { | 146 void FileSystemDirURLRequestJob::NotifyFailed(int rv) { |
| 144 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 147 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 145 } | 148 } |
| 146 | 149 |
| 147 } // namespace fileapi | 150 } // namespace fileapi |
| OLD | NEW |