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

Unified Diff: webkit/fileapi/isolated_mount_point_provider.cc

Issue 10082002: Add FileSystemMountPointProvider::CreateFileReader() which returns appropriate Reader instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_mount_point_provider.cc
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index 4e92df2fdff48a21e2543613f7c59c62a4ad3279..02bf8ae8cbdb1d799e240893eb8540233f1ea5a6 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -11,9 +11,12 @@
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "googleurl/src/gurl.h"
+#include "webkit/blob/local_file_reader.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
+#include "webkit/fileapi/file_system_file_reader.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_types.h"
+#include "webkit/fileapi/file_system_util.h"
#include "webkit/fileapi/isolated_context.h"
#include "webkit/fileapi/isolated_file_util.h"
#include "webkit/fileapi/native_file_util.h"
@@ -97,6 +100,26 @@ IsolatedMountPointProvider::CreateFileSystemOperation(
return new FileSystemOperation(file_proxy, context);
}
+webkit_blob::FileReader* IsolatedMountPointProvider::CreateFileReader(
+ const GURL& url,
+ int64 offset,
+ base::MessageLoopProxy* file_proxy,
+ FileSystemContext* context) const {
+ GURL origin_url;
+ FileSystemType file_system_type = kFileSystemTypeUnknown;
+ FilePath virtual_path;
+ if (!CrackFileSystemURL(url, &origin_url, &file_system_type, &virtual_path))
+ return NULL;
+ std::string fsid;
+ FilePath path;
+ if (!isolated_context()->CrackIsolatedPath(virtual_path, &fsid, NULL, &path))
+ return NULL;
+ if (path.empty())
+ return NULL;
+ return new webkit_blob::LocalFileReader(
+ file_proxy, path, offset, base::Time());
+}
+
IsolatedContext* IsolatedMountPointProvider::isolated_context() const {
return IsolatedContext::GetInstance();
}
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698