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

Unified Diff: webkit/fileapi/file_system_dir_url_request_job.cc

Issue 8999017: Add CreateFileSystemOperation() method to FileSystemContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang build fix Created 8 years, 11 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
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job.h ('k') | webkit/fileapi/file_system_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_dir_url_request_job.cc
diff --git a/webkit/fileapi/file_system_dir_url_request_job.cc b/webkit/fileapi/file_system_dir_url_request_job.cc
index 83a5455cd4ad0ae07b7e57b06a419f976cbc8a71..b96d7e462db7cf4a9922b1661b9db5177428cbff 100644
--- a/webkit/fileapi/file_system_dir_url_request_job.cc
+++ b/webkit/fileapi/file_system_dir_url_request_job.cc
@@ -21,6 +21,7 @@
#include "net/base/net_util.h"
#include "net/url_request/url_request.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
+#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_util.h"
@@ -139,8 +140,15 @@ bool FileSystemDirURLRequestJob::GetCharset(std::string* charset) {
}
void FileSystemDirURLRequestJob::StartAsync() {
- if (request_)
- GetNewOperation()->ReadDirectory(request_->url());
+ if (!request_)
+ return;
+ FileSystemOperationInterface* operation = GetNewOperation(request_->url());
+ if (!operation) {
+ NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
+ net::ERR_INVALID_URL));
+ return;
+ }
+ operation->ReadDirectory(request_->url());
}
void FileSystemDirURLRequestJob::DidReadDirectory(
@@ -174,17 +182,19 @@ void FileSystemDirURLRequestJob::DidReadDirectory(
}
if (has_more) {
- GetNewOperation()->ReadDirectory(request_->url());
+ GetNewOperation(request_->url())->ReadDirectory(request_->url());
} else {
set_expected_content_size(data_.size());
NotifyHeadersComplete();
}
}
-FileSystemOperation* FileSystemDirURLRequestJob::GetNewOperation() {
- return new FileSystemOperation(CallbackDispatcher::Create(this),
- file_thread_proxy_,
- file_system_context_);
+FileSystemOperationInterface*
+FileSystemDirURLRequestJob::GetNewOperation(const GURL& url) {
+ return file_system_context_->CreateFileSystemOperation(
+ url,
+ CallbackDispatcher::Create(this),
+ file_thread_proxy_);
}
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job.h ('k') | webkit/fileapi/file_system_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698