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

Side by Side Diff: webkit/fileapi/external_mount_points.h

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_tests compile 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ 5 #ifndef WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_
6 #define WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ 6 #define WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 #include "webkit/fileapi/file_system_types.h" 14 #include "webkit/fileapi/file_system_types.h"
15 #include "webkit/fileapi/mount_points.h" 15 #include "webkit/fileapi/mount_points.h"
16 #include "webkit/storage/webkit_storage_export.h" 16 #include "webkit/storage/webkit_storage_export.h"
17 17
18 class FilePath; 18 class FilePath;
19 19
20 namespace fileapi { 20 namespace fileapi {
21 class FileSystemURL;
21 class RemoteFileSystemProxyInterface; 22 class RemoteFileSystemProxyInterface;
22 } 23 }
23 24
24 namespace fileapi { 25 namespace fileapi {
25 26
26 // Manages external filesystem namespaces that are identified by 'mount name' 27 // Manages external filesystem namespaces that are identified by 'mount name'
27 // and are persisted until RevokeFileSystem is called. 28 // and are persisted until RevokeFileSystem is called.
28 // Files in an external filesystem are identified by a filesystem URL like: 29 // Files in an external filesystem are identified by a filesystem URL like:
29 // 30 //
30 // filesystem:<origin>/external/<mount_name>/relative/path 31 // filesystem:<origin>/external/<mount_name>/relative/path
(...skipping 16 matching lines...) Expand all
47 // 48 //
48 // The |mount_name| should NOT contain a path separator '/'. 49 // The |mount_name| should NOT contain a path separator '/'.
49 // Returns false if the given name is already registered. 50 // Returns false if the given name is already registered.
50 // 51 //
51 // Overlapping mount points in a single MountPoints instance are not allowed. 52 // Overlapping mount points in a single MountPoints instance are not allowed.
52 // Adding mount point whose path overlaps with an existing mount point will 53 // Adding mount point whose path overlaps with an existing mount point will
53 // fail. 54 // fail.
54 // 55 //
55 // If not empty, |path| must be absolute. It is allowed for the path to be 56 // If not empty, |path| must be absolute. It is allowed for the path to be
56 // empty, but |GetVirtualPath| will not work for those mount points. 57 // empty, but |GetVirtualPath| will not work for those mount points.
58 // Path separators will be normalized.
57 // 59 //
58 // An external file system registered by this method can be revoked 60 // An external file system registered by this method can be revoked
59 // by calling RevokeFileSystem with |mount_name|. 61 // by calling RevokeFileSystem with |mount_name|.
60 bool RegisterFileSystem(const std::string& mount_name, 62 bool RegisterFileSystem(const std::string& mount_name,
61 FileSystemType type, 63 FileSystemType type,
62 const FilePath& path); 64 const FilePath& path);
63 65
64 // Same as |RegisterExternalFileSystem|, but also registers a remote file 66 // Same as |RegisterExternalFileSystem|, but also registers a remote file
65 // system proxy for the file system. 67 // system proxy for the file system.
66 bool RegisterRemoteFileSystem(const std::string& mount_name, 68 bool RegisterRemoteFileSystem(const std::string& mount_name,
67 FileSystemType type, 69 FileSystemType type,
68 RemoteFileSystemProxyInterface* remote_proxy, 70 RemoteFileSystemProxyInterface* remote_proxy,
69 const FilePath& path); 71 const FilePath& path);
70 72
71 // MountPoints overrides. 73 // MountPoints overrides.
72 virtual bool RevokeFileSystem(const std::string& mount_name) OVERRIDE; 74 virtual bool RevokeFileSystem(const std::string& mount_name) OVERRIDE;
75 virtual bool CanHandleURL(const FileSystemURL& url) const OVERRIDE;
76 virtual FileSystemURL CrackFileSystemURL(
77 const FileSystemURL& url) const OVERRIDE;
78 virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE;
79 virtual FileSystemURL CreateCrackedFileSystemURL(
80 const GURL& origin,
81 FileSystemType type,
82 const FilePath& path) const OVERRIDE;
73 virtual bool GetRegisteredPath(const std::string& mount_name, 83 virtual bool GetRegisteredPath(const std::string& mount_name,
74 FilePath* path) const OVERRIDE; 84 FilePath* path) const OVERRIDE;
75 virtual bool CrackVirtualPath(const FilePath& virtual_path, 85 virtual bool CrackVirtualPath(const FilePath& virtual_path,
76 std::string* mount_name, 86 std::string* mount_name,
77 FileSystemType* type, 87 FileSystemType* type,
78 FilePath* path) const OVERRIDE; 88 FilePath* path) const OVERRIDE;
79 89
80 // Retrieves the remote file system proxy for the registered file system. 90 // Retrieves the remote file system proxy for the registered file system.
81 // Returns NULL if there is no file system with the given name, or if the file 91 // Returns NULL if there is no file system with the given name, or if the file
82 // system does not have a remote file system proxy. 92 // system does not have a remote file system proxy.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 FilePath GetVirtualRootPath() const; 156 FilePath GetVirtualRootPath() const;
147 157
148 private: 158 private:
149 const std::string mount_name_; 159 const std::string mount_name_;
150 }; 160 };
151 161
152 } // namespace fileapi 162 } // namespace fileapi
153 163
154 #endif // WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ 164 #endif // WEBKIT_FILEAPI_EXTERNAL_MOUNT_POINTS_H_
155 165
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698