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 STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ |
6 #define STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 6 #define STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
15 #include "storage/browser/fileapi/mount_points.h" | 16 #include "storage/browser/fileapi/mount_points.h" |
16 #include "storage/browser/storage_browser_export.h" | 17 #include "storage/browser/storage_browser_export.h" |
17 #include "storage/common/fileapi/file_system_mount_option.h" | 18 #include "storage/common/fileapi/file_system_mount_option.h" |
18 #include "storage/common/fileapi/file_system_types.h" | 19 #include "storage/common/fileapi/file_system_types.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 113 |
113 // Revoke all registered filesystems. Used only by testing (for clean-ups). | 114 // Revoke all registered filesystems. Used only by testing (for clean-ups). |
114 void RevokeAllFileSystems(); | 115 void RevokeAllFileSystems(); |
115 | 116 |
116 private: | 117 private: |
117 friend class base::RefCountedThreadSafe<ExternalMountPoints>; | 118 friend class base::RefCountedThreadSafe<ExternalMountPoints>; |
118 | 119 |
119 // Represents each file system instance (defined in the .cc). | 120 // Represents each file system instance (defined in the .cc). |
120 class Instance; | 121 class Instance; |
121 | 122 |
122 typedef std::map<std::string, Instance*> NameToInstance; | 123 typedef std::map<std::string, std::unique_ptr<Instance>> NameToInstance; |
123 | 124 |
124 // Reverse map from registered path to its corresponding mount name. | 125 // Reverse map from registered path to its corresponding mount name. |
125 typedef std::map<base::FilePath, std::string> PathToName; | 126 typedef std::map<base::FilePath, std::string> PathToName; |
126 | 127 |
127 // Use |GetSystemInstance| of |CreateRefCounted| to get an instance. | 128 // Use |GetSystemInstance| of |CreateRefCounted| to get an instance. |
128 ExternalMountPoints(); | 129 ExternalMountPoints(); |
129 ~ExternalMountPoints() override; | 130 ~ExternalMountPoints() override; |
130 | 131 |
131 // MountPoint overrides. | 132 // MountPoint overrides. |
132 FileSystemURL CrackFileSystemURL(const FileSystemURL& url) const override; | 133 FileSystemURL CrackFileSystemURL(const FileSystemURL& url) const override; |
(...skipping 16 matching lines...) Expand all Loading... |
149 | 150 |
150 NameToInstance instance_map_; | 151 NameToInstance instance_map_; |
151 PathToName path_to_name_map_; | 152 PathToName path_to_name_map_; |
152 | 153 |
153 DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints); | 154 DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints); |
154 }; | 155 }; |
155 | 156 |
156 } // namespace storage | 157 } // namespace storage |
157 | 158 |
158 #endif // STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ | 159 #endif // STORAGE_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ |
OLD | NEW |