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

Side by Side Diff: webkit/browser/fileapi/sandbox_file_system_backend_delegate.h

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_
6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ 6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 24
25 namespace base { 25 namespace base {
26 class SequencedTaskRunner; 26 class SequencedTaskRunner;
27 } 27 }
28 28
29 namespace content { 29 namespace content {
30 class SandboxFileSystemBackendDelegateTest; 30 class SandboxFileSystemBackendDelegateTest;
31 class SandboxFileSystemTestHelper; 31 class SandboxFileSystemTestHelper;
32 } 32 }
33 33
34 namespace quota { 34 namespace storage {
35 class QuotaManagerProxy; 35 class QuotaManagerProxy;
36 class SpecialStoragePolicy; 36 class SpecialStoragePolicy;
37 } 37 }
38 38
39 namespace webkit_blob { 39 namespace storage {
40 class FileStreamReader; 40 class FileStreamReader;
41 } 41 }
42 42
43 namespace fileapi { 43 namespace storage {
44 44
45 class AsyncFileUtil; 45 class AsyncFileUtil;
46 class FileStreamWriter; 46 class FileStreamWriter;
47 class FileSystemFileUtil; 47 class FileSystemFileUtil;
48 class FileSystemOperationContext; 48 class FileSystemOperationContext;
49 class FileSystemURL; 49 class FileSystemURL;
50 class FileSystemUsageCache; 50 class FileSystemUsageCache;
51 class ObfuscatedFileUtil; 51 class ObfuscatedFileUtil;
52 class QuotaReservationManager; 52 class QuotaReservationManager;
53 class SandboxFileSystemBackend; 53 class SandboxFileSystemBackend;
(...skipping 19 matching lines...) Expand all
73 virtual GURL Next() = 0; 73 virtual GURL Next() = 0;
74 74
75 // Returns the current origin's information. 75 // Returns the current origin's information.
76 virtual bool HasFileSystemType(FileSystemType type) const = 0; 76 virtual bool HasFileSystemType(FileSystemType type) const = 0;
77 }; 77 };
78 78
79 // Returns the type directory name in sandbox directory for given |type|. 79 // Returns the type directory name in sandbox directory for given |type|.
80 static std::string GetTypeString(FileSystemType type); 80 static std::string GetTypeString(FileSystemType type);
81 81
82 SandboxFileSystemBackendDelegate( 82 SandboxFileSystemBackendDelegate(
83 quota::QuotaManagerProxy* quota_manager_proxy, 83 storage::QuotaManagerProxy* quota_manager_proxy,
84 base::SequencedTaskRunner* file_task_runner, 84 base::SequencedTaskRunner* file_task_runner,
85 const base::FilePath& profile_path, 85 const base::FilePath& profile_path,
86 quota::SpecialStoragePolicy* special_storage_policy, 86 storage::SpecialStoragePolicy* special_storage_policy,
87 const FileSystemOptions& file_system_options); 87 const FileSystemOptions& file_system_options);
88 88
89 virtual ~SandboxFileSystemBackendDelegate(); 89 virtual ~SandboxFileSystemBackendDelegate();
90 90
91 // Returns an origin enumerator of sandbox filesystem. 91 // Returns an origin enumerator of sandbox filesystem.
92 // This method can only be called on the file thread. 92 // This method can only be called on the file thread.
93 OriginEnumerator* CreateOriginEnumerator(); 93 OriginEnumerator* CreateOriginEnumerator();
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| and |type|. 96 // specified by |origin_url| and |type|.
(...skipping 10 matching lines...) Expand all
107 void OpenFileSystem( 107 void OpenFileSystem(
108 const GURL& origin_url, 108 const GURL& origin_url,
109 FileSystemType type, 109 FileSystemType type,
110 OpenFileSystemMode mode, 110 OpenFileSystemMode mode,
111 const OpenFileSystemCallback& callback, 111 const OpenFileSystemCallback& callback,
112 const GURL& root_url); 112 const GURL& root_url);
113 scoped_ptr<FileSystemOperationContext> CreateFileSystemOperationContext( 113 scoped_ptr<FileSystemOperationContext> CreateFileSystemOperationContext(
114 const FileSystemURL& url, 114 const FileSystemURL& url,
115 FileSystemContext* context, 115 FileSystemContext* context,
116 base::File::Error* error_code) const; 116 base::File::Error* error_code) const;
117 scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( 117 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader(
118 const FileSystemURL& url, 118 const FileSystemURL& url,
119 int64 offset, 119 int64 offset,
120 const base::Time& expected_modification_time, 120 const base::Time& expected_modification_time,
121 FileSystemContext* context) const; 121 FileSystemContext* context) const;
122 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( 122 scoped_ptr<FileStreamWriter> CreateFileStreamWriter(
123 const FileSystemURL& url, 123 const FileSystemURL& url,
124 int64 offset, 124 int64 offset,
125 FileSystemContext* context, 125 FileSystemContext* context,
126 FileSystemType type) const; 126 FileSystemType type) const;
127 127
128 // FileSystemQuotaUtil overrides. 128 // FileSystemQuotaUtil overrides.
129 virtual base::File::Error DeleteOriginDataOnFileTaskRunner( 129 virtual base::File::Error DeleteOriginDataOnFileTaskRunner(
130 FileSystemContext* context, 130 FileSystemContext* context,
131 quota::QuotaManagerProxy* proxy, 131 storage::QuotaManagerProxy* proxy,
132 const GURL& origin_url, 132 const GURL& origin_url,
133 FileSystemType type) OVERRIDE; 133 FileSystemType type) OVERRIDE;
134 virtual void GetOriginsForTypeOnFileTaskRunner( 134 virtual void GetOriginsForTypeOnFileTaskRunner(
135 FileSystemType type, 135 FileSystemType type,
136 std::set<GURL>* origins) OVERRIDE; 136 std::set<GURL>* origins) OVERRIDE;
137 virtual void GetOriginsForHostOnFileTaskRunner( 137 virtual void GetOriginsForHostOnFileTaskRunner(
138 FileSystemType type, 138 FileSystemType type,
139 const std::string& host, 139 const std::string& host,
140 std::set<GURL>* origins) OVERRIDE; 140 std::set<GURL>* origins) OVERRIDE;
141 virtual int64 GetOriginUsageOnFileTaskRunner( 141 virtual int64 GetOriginUsageOnFileTaskRunner(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void CollectOpenFileSystemMetrics(base::File::Error error_code); 176 void CollectOpenFileSystemMetrics(base::File::Error error_code);
177 177
178 base::SequencedTaskRunner* file_task_runner() { 178 base::SequencedTaskRunner* file_task_runner() {
179 return file_task_runner_.get(); 179 return file_task_runner_.get();
180 } 180 }
181 181
182 AsyncFileUtil* file_util() { return sandbox_file_util_.get(); } 182 AsyncFileUtil* file_util() { return sandbox_file_util_.get(); }
183 FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); } 183 FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); }
184 SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); } 184 SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); }
185 185
186 quota::SpecialStoragePolicy* special_storage_policy() { 186 storage::SpecialStoragePolicy* special_storage_policy() {
187 return special_storage_policy_.get(); 187 return special_storage_policy_.get();
188 } 188 }
189 189
190 const FileSystemOptions& file_system_options() const { 190 const FileSystemOptions& file_system_options() const {
191 return file_system_options_; 191 return file_system_options_;
192 } 192 }
193 193
194 FileSystemFileUtil* sync_file_util(); 194 FileSystemFileUtil* sync_file_util();
195 195
196 private: 196 private:
(...skipping 28 matching lines...) Expand all
225 225
226 ObfuscatedFileUtil* obfuscated_file_util(); 226 ObfuscatedFileUtil* obfuscated_file_util();
227 227
228 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; 228 scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
229 229
230 scoped_ptr<AsyncFileUtil> sandbox_file_util_; 230 scoped_ptr<AsyncFileUtil> sandbox_file_util_;
231 scoped_ptr<FileSystemUsageCache> file_system_usage_cache_; 231 scoped_ptr<FileSystemUsageCache> file_system_usage_cache_;
232 scoped_ptr<SandboxQuotaObserver> quota_observer_; 232 scoped_ptr<SandboxQuotaObserver> quota_observer_;
233 scoped_ptr<QuotaReservationManager> quota_reservation_manager_; 233 scoped_ptr<QuotaReservationManager> quota_reservation_manager_;
234 234
235 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; 235 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_;
236 236
237 FileSystemOptions file_system_options_; 237 FileSystemOptions file_system_options_;
238 238
239 bool is_filesystem_opened_; 239 bool is_filesystem_opened_;
240 base::ThreadChecker io_thread_checker_; 240 base::ThreadChecker io_thread_checker_;
241 241
242 // Accessed only on the file thread. 242 // Accessed only on the file thread.
243 std::set<GURL> visited_origins_; 243 std::set<GURL> visited_origins_;
244 244
245 std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_; 245 std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_;
246 246
247 std::map<FileSystemType, UpdateObserverList> update_observers_; 247 std::map<FileSystemType, UpdateObserverList> update_observers_;
248 std::map<FileSystemType, ChangeObserverList> change_observers_; 248 std::map<FileSystemType, ChangeObserverList> change_observers_;
249 std::map<FileSystemType, AccessObserverList> access_observers_; 249 std::map<FileSystemType, AccessObserverList> access_observers_;
250 250
251 base::Time next_release_time_for_open_filesystem_stat_; 251 base::Time next_release_time_for_open_filesystem_stat_;
252 252
253 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; 253 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_;
254 254
255 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); 255 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate);
256 }; 256 };
257 257
258 } // namespace fileapi 258 } // namespace storage
259 259
260 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ 260 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/sandbox_file_system_backend.cc ('k') | webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698