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

Unified Diff: webkit/fileapi/file_system_url_request_job.cc

Issue 6864040: Fixed file/directory url resolution for external mount point provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/file_system_url_request_job.cc
===================================================================
--- webkit/fileapi/file_system_url_request_job.cc (revision 82028)
+++ webkit/fileapi/file_system_url_request_job.cc (working copy)
@@ -32,18 +32,17 @@
base::PLATFORM_FILE_ASYNC;
FileSystemURLRequestJob::FileSystemURLRequestJob(
- URLRequest* request, FileSystemPathManager* path_manager,
+ URLRequest* request, FileSystemContext* file_system_context,
scoped_refptr<base::MessageLoopProxy> file_thread_proxy)
- : URLRequestJob(request),
- path_manager_(path_manager),
+ : FileSystemURLRequestJobBase(request, file_system_context,
+ file_thread_proxy),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(
io_callback_(this, &FileSystemURLRequestJob::DidRead)),
stream_(NULL),
is_directory_(false),
- remaining_bytes_(0),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
- ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
- file_thread_proxy_(file_thread_proxy) {
+ remaining_bytes_(0) {
}
FileSystemURLRequestJob::~FileSystemURLRequestJob() {
@@ -64,7 +63,6 @@
stream_->Close();
stream_.reset(NULL);
}
-
URLRequestJob::Kill();
callback_factory_.RevokeAll();
}
@@ -130,30 +128,8 @@
}
}
-void FileSystemURLRequestJob::StartAsync() {
- GURL origin_url;
- FileSystemType type;
- if (!CrackFileSystemURL(request_->url(), &origin_url, &type,
- &relative_file_path_)) {
- NotifyFailed(net::ERR_INVALID_URL);
- return;
- }
-
- path_manager_->GetFileSystemRootPath(
- origin_url, type, false, // create
- callback_factory_.NewCallback(&FileSystemURLRequestJob::DidGetRootPath));
-}
-
-void FileSystemURLRequestJob::DidGetRootPath(bool success,
- const FilePath& root_path,
- const std::string& name) {
- if (!success) {
- NotifyFailed(net::ERR_FILE_NOT_FOUND);
- return;
- }
-
- absolute_file_path_ = root_path.Append(relative_file_path_);
-
+void FileSystemURLRequestJob::DidGetLocalPath(const FilePath& local_path) {
+ absolute_file_path_ = local_path;
base::FileUtilProxy::GetFileInfo(file_thread_proxy_, absolute_file_path_,
callback_factory_.NewCallback(&FileSystemURLRequestJob::DidResolve));
}
@@ -246,8 +222,4 @@
return false;
}
-void FileSystemURLRequestJob::NotifyFailed(int rv) {
- NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
-}
-
} // namespace fileapi

Powered by Google App Engine
This is Rietveld 408576698