Chromium Code Reviews| Index: webkit/fileapi/external_mount_points.cc |
| diff --git a/webkit/fileapi/external_mount_points.cc b/webkit/fileapi/external_mount_points.cc |
| index 9abba4218cfe17fb4bcf2609a2ea7e4ca6690cba..3cf50a3dacccdd5d0292c3c501461d2d8b9211e3 100644 |
| --- a/webkit/fileapi/external_mount_points.cc |
| +++ b/webkit/fileapi/external_mount_points.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/lazy_instance.h" |
| #include "base/path_service.h" |
| #include "base/stl_util.h" |
| +#include "webkit/fileapi/file_system_url.h" |
| #include "webkit/fileapi/remote_file_system_proxy.h" |
| namespace { |
| @@ -240,6 +241,36 @@ void ExternalMountPoints::AddMountPointInfosTo( |
| } |
| } |
| + |
|
kinuko
2013/01/21 06:57:33
nit: extra empty line
|
| +bool ExternalMountPoints::CanHandleURL(const FileSystemURL& url) const { |
| + return url.is_valid() && url.type() == kFileSystemTypeExternal; |
| +} |
| + |
| +FileSystemURL ExternalMountPoints::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 ExternalMountPoints::CrackURL(const GURL& url) const { |
| + return CrackFileSystemURL(FileSystemURL(url)); |
| +} |
| + |
| +FileSystemURL ExternalMountPoints::CreateCrackedFileSystemURL( |
| + const GURL& origin, |
| + FileSystemType type, |
| + const FilePath& path) const { |
| + return CrackFileSystemURL(FileSystemURL(origin, type, path)); |
| +} |
| + |
| bool ExternalMountPoints::GetVirtualPath(const FilePath& path_in, |
| FilePath* virtual_path) { |
| DCHECK(virtual_path); |