OLD | NEW |
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_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 6 #define WEBKIT_BROWSER_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/browser/fileapi/mount_points.h" | 14 #include "webkit/browser/fileapi/mount_points.h" |
| 15 #include "webkit/browser/webkit_storage_browser_export.h" |
15 #include "webkit/common/fileapi/file_system_types.h" | 16 #include "webkit/common/fileapi/file_system_types.h" |
16 #include "webkit/storage/webkit_storage_export.h" | |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class FilePath; | 19 class FilePath; |
20 } | 20 } |
21 | 21 |
22 namespace fileapi { | 22 namespace fileapi { |
23 class FileSystemURL; | 23 class FileSystemURL; |
24 class RemoteFileSystemProxyInterface; | 24 class RemoteFileSystemProxyInterface; |
25 } | 25 } |
26 | 26 |
27 namespace fileapi { | 27 namespace fileapi { |
28 | 28 |
29 // Manages external filesystem namespaces that are identified by 'mount name' | 29 // Manages external filesystem namespaces that are identified by 'mount name' |
30 // and are persisted until RevokeFileSystem is called. | 30 // and are persisted until RevokeFileSystem is called. |
31 // Files in an external filesystem are identified by a filesystem URL like: | 31 // Files in an external filesystem are identified by a filesystem URL like: |
32 // | 32 // |
33 // filesystem:<origin>/external/<mount_name>/relative/path | 33 // filesystem:<origin>/external/<mount_name>/relative/path |
34 // | 34 // |
35 class WEBKIT_STORAGE_EXPORT ExternalMountPoints | 35 class WEBKIT_STORAGE_BROWSER_EXPORT ExternalMountPoints |
36 : public base::RefCountedThreadSafe<ExternalMountPoints>, | 36 : public base::RefCountedThreadSafe<ExternalMountPoints>, |
37 public MountPoints { | 37 public MountPoints { |
38 public: | 38 public: |
39 static ExternalMountPoints* GetSystemInstance(); | 39 static ExternalMountPoints* GetSystemInstance(); |
40 static scoped_refptr<ExternalMountPoints> CreateRefCounted(); | 40 static scoped_refptr<ExternalMountPoints> CreateRefCounted(); |
41 | 41 |
42 // Registers a new named external filesystem. | 42 // Registers a new named external filesystem. |
43 // The |path| is registered as the root path of the mount point which | 43 // The |path| is registered as the root path of the mount point which |
44 // is identified by a URL "filesystem:.../external/mount_name". | 44 // is identified by a URL "filesystem:.../external/mount_name". |
45 // | 45 // |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // This lock needs to be obtained when accessing the instance_map_. | 148 // This lock needs to be obtained when accessing the instance_map_. |
149 mutable base::Lock lock_; | 149 mutable base::Lock lock_; |
150 | 150 |
151 NameToInstance instance_map_; | 151 NameToInstance instance_map_; |
152 PathToName path_to_name_map_; | 152 PathToName path_to_name_map_; |
153 | 153 |
154 DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints); | 154 DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints); |
155 }; | 155 }; |
156 | 156 |
157 // Registers a scoped external filesystem which gets revoked when it scopes out. | 157 // Registers a scoped external filesystem which gets revoked when it scopes out. |
158 class WEBKIT_STORAGE_EXPORT ScopedExternalFileSystem { | 158 class WEBKIT_STORAGE_BROWSER_EXPORT ScopedExternalFileSystem { |
159 public: | 159 public: |
160 ScopedExternalFileSystem(const std::string& mount_name, | 160 ScopedExternalFileSystem(const std::string& mount_name, |
161 FileSystemType type, | 161 FileSystemType type, |
162 const base::FilePath& path); | 162 const base::FilePath& path); |
163 ~ScopedExternalFileSystem(); | 163 ~ScopedExternalFileSystem(); |
164 | 164 |
165 base::FilePath GetVirtualRootPath() const; | 165 base::FilePath GetVirtualRootPath() const; |
166 | 166 |
167 private: | 167 private: |
168 const std::string mount_name_; | 168 const std::string mount_name_; |
169 }; | 169 }; |
170 | 170 |
171 } // namespace fileapi | 171 } // namespace fileapi |
172 | 172 |
173 #endif // WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 173 #endif // WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ |
OLD | NEW |