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

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

Issue 7057032: Integrated obfuscation with quota; all unit tests now pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminated a vector copy Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_SANDBOX_MOUNT_POINT_PROVIDER_H_ 5 #ifndef WEBKIT_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_
6 #define WEBKIT_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_ 6 #define WEBKIT_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual std::vector<FilePath> GetRootDirectories() const; 89 virtual std::vector<FilePath> GetRootDirectories() const;
90 90
91 // Returns an origin enumerator of this provider. 91 // Returns an origin enumerator of this provider.
92 // This method is supposed to be called on the file thread. 92 // This method is supposed to be called on the file thread.
93 OriginEnumerator* CreateOriginEnumerator() const; 93 OriginEnumerator* CreateOriginEnumerator() const;
94 94
95 // Gets a base directory path of the sandboxed filesystem that is 95 // Gets a base directory path of the sandboxed filesystem that is
96 // specified by |origin_url|. 96 // specified by |origin_url|.
97 // (The path is similar to the origin's root path but doesn't contain 97 // (The path is similar to the origin's root path but doesn't contain
98 // the 'unique' and 'type' part.) 98 // the 'unique' and 'type' part.)
99 // This method is portable and can be called on any thread. 99 // This method can only be called on the file thread.
100 // TODO(ericu) obfuscated version for quota integration. 100 FilePath GetBaseDirectoryForOrigin(const GURL& origin_url, bool create) const;
101 FilePath GetBaseDirectoryForOrigin(const GURL& origin_url) const;
102 101
103 // Gets a base directory path of the sandboxed filesystem that is 102 // Gets a base directory path of the sandboxed filesystem that is
104 // specified by |origin_url| and |type|. 103 // specified by |origin_url| and |type|.
105 // (The path is similar to the origin's root path but doesn't contain 104 // (The path is similar to the origin's root path but doesn't contain
106 // the 'unique' part.) 105 // the 'unique' part.)
107 // Returns an empty path if the given type is invalid. 106 // Returns an empty path if the given type is invalid.
108 // This method is portable and can be called on any thread. 107 // This method can only be called on the file thread.
109 // TODO(ericu) obfuscated version for quota integration.
110 FilePath GetBaseDirectoryForOriginAndType( 108 FilePath GetBaseDirectoryForOriginAndType(
111 const GURL& origin_url, 109 const GURL& origin_url,
112 fileapi::FileSystemType type) const; 110 fileapi::FileSystemType type,
111 bool create) const;
113 112
114 FileSystemFileUtil* GetFileSystemFileUtil(); 113 FileSystemFileUtil* GetFileSystemFileUtil();
115 114
116 // Deletes the data on the origin and reports the amount of deleted data 115 // Deletes the data on the origin and reports the amount of deleted data
117 // to the quota manager via |proxy|. 116 // to the quota manager via |proxy|.
118 bool DeleteOriginDataOnFileThread( 117 bool DeleteOriginDataOnFileThread(
119 quota::QuotaManagerProxy* proxy, 118 quota::QuotaManagerProxy* proxy,
120 const GURL& origin_url, 119 const GURL& origin_url,
121 fileapi::FileSystemType type); 120 fileapi::FileSystemType type);
122 121
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const GURL& origin_url, 153 const GURL& origin_url,
155 FilePath* base_path, 154 FilePath* base_path,
156 FileSystemType type, 155 FileSystemType type,
157 std::string* name); 156 std::string* name);
158 157
159 // Returns a path to the usage cache file. 158 // Returns a path to the usage cache file.
160 FilePath GetUsageCachePathForOriginAndType( 159 FilePath GetUsageCachePathForOriginAndType(
161 const GURL& origin_url, 160 const GURL& origin_url,
162 fileapi::FileSystemType type) const; 161 fileapi::FileSystemType type) const;
163 162
164 FilePath GetFileSystemRootPathOnFileThread(
165 const GURL& origin_url, FileSystemType type, bool create);
166
167 class GetFileSystemRootPathTask; 163 class GetFileSystemRootPathTask;
168 164
169 friend class FileSystemTestOriginHelper; 165 friend class FileSystemTestOriginHelper;
170 166
171 // The path_manager_ isn't owned by this instance; this instance is owned by 167 // The path_manager_ isn't owned by this instance; this instance is owned by
172 // the path_manager_, and they have the same lifetime. 168 // the path_manager_, and they have the same lifetime.
173 FileSystemPathManager* path_manager_; 169 FileSystemPathManager* path_manager_;
174 170
175 scoped_refptr<base::MessageLoopProxy> file_message_loop_; 171 scoped_refptr<base::MessageLoopProxy> file_message_loop_;
176 172
177 const FilePath base_path_; 173 const FilePath base_path_;
178 174
179 scoped_refptr<ObfuscatedFileSystemFileUtil> sandbox_file_util_; 175 scoped_refptr<ObfuscatedFileSystemFileUtil> sandbox_file_util_;
180 176
181 // Acccessed only on the file thread. 177 // Acccessed only on the file thread.
182 std::set<GURL> visited_origins_; 178 std::set<GURL> visited_origins_;
183 179
184 DISALLOW_COPY_AND_ASSIGN(SandboxMountPointProvider); 180 DISALLOW_COPY_AND_ASSIGN(SandboxMountPointProvider);
185 }; 181 };
186 182
187 } // namespace fileapi 183 } // namespace fileapi
188 184
189 #endif // WEBKIT_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_ 185 #endif // WEBKIT_FILEAPI_SANDBOX_MOUNT_POINT_PROVIDER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/obfuscated_file_system_file_util_unittest.cc ('k') | webkit/fileapi/sandbox_mount_point_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698