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

Unified Diff: webkit/fileapi/file_system_context.cc

Issue 9016020: Cleanup FileSystemOperation for preparing for adding FSO-factory method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more cleanup around ValidateFileSystemRoot Created 9 years 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_context.cc
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 7d51eeab671dc74b7bded944f523749c0f998530..b3d7d7e0658b3577809574b14d8ed6d7d0910c9c 100644
--- a/webkit/fileapi/file_system_context.cc
+++ b/webkit/fileapi/file_system_context.cc
@@ -4,10 +4,12 @@
#include "webkit/fileapi/file_system_context.h"
+#include "base/bind.h"
#include "base/file_util.h"
#include "base/message_loop_proxy.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h"
+#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_options.h"
#include "webkit/fileapi/file_system_quota_client.h"
@@ -33,6 +35,17 @@ QuotaClient* CreateQuotaClient(
return new FileSystemQuotaClient(file_message_loop, context, is_incognito);
}
+void DidOpenFileSystem(FileSystemCallbackDispatcher* dispatcher,
+ const GURL& filesystem_root,
+ const std::string& filesystem_name,
+ base::PlatformFileError error) {
+ if (error == base::PLATFORM_FILE_OK) {
+ dispatcher->DidOpenFileSystem(filesystem_name, filesystem_root);
+ } else {
+ dispatcher->DidFail(error);
+ }
+}
+
} // anonymous namespace
FileSystemContext::FileSystemContext(
@@ -140,6 +153,25 @@ void FileSystemContext::DeleteOnCorrectThread() const {
delete this;
}
+void FileSystemContext::OpenFileSystem(
+ const GURL& origin_url,
+ FileSystemType type,
+ bool create,
+ FileSystemCallbackDispatcher* dispatcher) {
+ DCHECK(dispatcher);
+
+ GURL root_url = GetFileSystemRootURI(origin_url, type);
+ std::string name = GetFileSystemName(origin_url, type);
+
+ FileSystemMountPointProvider* mount_point_provider =
+ GetMountPointProvider(type);
+ DCHECK(mount_point_provider);
+ mount_point_provider->ValidateFileSystemRoot(
+ origin_url, type, create,
+ base::Bind(&DidOpenFileSystem,
+ base::Owned(dispatcher), root_url, name));
+}
+
} // namespace fileapi
COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeTemporary) == \

Powered by Google App Engine
This is Rietveld 408576698