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

Unified Diff: webkit/fileapi/isolated_context.cc

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Couple of nits I noticed Created 7 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
Index: webkit/fileapi/isolated_context.cc
diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc
index 1433e7240b2dcdcc6010b760f2586dbe46a70cd4..7300a39ed353c828e85a571fd5a2549ddfc38910 100644
--- a/webkit/fileapi/isolated_context.cc
+++ b/webkit/fileapi/isolated_context.cc
@@ -12,6 +12,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "webkit/fileapi/file_system_url.h"
namespace fileapi {
@@ -230,6 +231,35 @@ bool IsolatedContext::RevokeFileSystem(const std::string& filesystem_id) {
return UnregisterFileSystem(filesystem_id);
}
+bool IsolatedContext::CanHandleURL(const FileSystemURL& url) const {
+ return url.is_valid() && url.type() == kFileSystemTypeIsolated;
+}
+
+FileSystemURL IsolatedContext::CrackFileSystemURL(
+ const FileSystemURL& url) const {
+ if (!CanHandleURL(url))
+ return FileSystemURL();
+
+ std::string mount_name;
+ FileSystemType type;
+ FilePath path;
+ if (!CrackVirtualPath(url.path(), &mount_name, &type, &path))
+ return FileSystemURL();
+
+ return FileSystemURL::CreateForCrackedURL(url, mount_name, type, path);
+}
+
+FileSystemURL IsolatedContext::CrackURL(const GURL& url) const {
+ return CrackFileSystemURL(FileSystemURL(url));
+}
+
+FileSystemURL IsolatedContext::CreateCrackedFileSystemURL(
+ const GURL& origin,
+ FileSystemType type,
+ const FilePath& path) const {
+ return CrackFileSystemURL(FileSystemURL(origin, type, path));
+}
+
bool IsolatedContext::GetRegisteredPath(
const std::string& filesystem_id, FilePath* path) const {
DCHECK(path);

Powered by Google App Engine
This is Rietveld 408576698