OLD | NEW |
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 STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ |
6 #define STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ | 6 #define STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "storage/browser/fileapi/file_system_backend.h" | 13 #include "storage/browser/fileapi/file_system_backend.h" |
14 #include "storage/browser/fileapi/file_system_options.h" | 14 #include "storage/browser/fileapi/file_system_options.h" |
15 #include "storage/browser/fileapi/file_system_quota_util.h" | 15 #include "storage/browser/fileapi/file_system_quota_util.h" |
| 16 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class SequencedTaskRunner; | 19 class SequencedTaskRunner; |
19 } | 20 } |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 class PluginPrivateFileSystemBackendTest; | 23 class PluginPrivateFileSystemBackendTest; |
23 } | 24 } |
24 | 25 |
25 namespace storage { | 26 namespace storage { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 81 virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
81 const FileSystemURL& url, | 82 const FileSystemURL& url, |
82 int64 offset, | 83 int64 offset, |
83 const base::Time& expected_modification_time, | 84 const base::Time& expected_modification_time, |
84 FileSystemContext* context) const OVERRIDE; | 85 FileSystemContext* context) const OVERRIDE; |
85 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 86 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
86 const FileSystemURL& url, | 87 const FileSystemURL& url, |
87 int64 offset, | 88 int64 offset, |
88 FileSystemContext* context) const OVERRIDE; | 89 FileSystemContext* context) const OVERRIDE; |
89 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 90 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| 91 virtual const UpdateObserverList* GetUpdateObservers( |
| 92 FileSystemType type) const OVERRIDE; |
| 93 virtual const ChangeObserverList* GetChangeObservers( |
| 94 FileSystemType type) const OVERRIDE; |
| 95 virtual const AccessObserverList* GetAccessObservers( |
| 96 FileSystemType type) const OVERRIDE; |
90 | 97 |
91 // FileSystemQuotaUtil overrides. | 98 // FileSystemQuotaUtil overrides. |
92 virtual base::File::Error DeleteOriginDataOnFileTaskRunner( | 99 virtual base::File::Error DeleteOriginDataOnFileTaskRunner( |
93 FileSystemContext* context, | 100 FileSystemContext* context, |
94 storage::QuotaManagerProxy* proxy, | 101 storage::QuotaManagerProxy* proxy, |
95 const GURL& origin_url, | 102 const GURL& origin_url, |
96 FileSystemType type) OVERRIDE; | 103 FileSystemType type) OVERRIDE; |
97 virtual void GetOriginsForTypeOnFileTaskRunner( | 104 virtual void GetOriginsForTypeOnFileTaskRunner( |
98 FileSystemType type, | 105 FileSystemType type, |
99 std::set<GURL>* origins) OVERRIDE; | 106 std::set<GURL>* origins) OVERRIDE; |
100 virtual void GetOriginsForHostOnFileTaskRunner( | 107 virtual void GetOriginsForHostOnFileTaskRunner( |
101 FileSystemType type, | 108 FileSystemType type, |
102 const std::string& host, | 109 const std::string& host, |
103 std::set<GURL>* origins) OVERRIDE; | 110 std::set<GURL>* origins) OVERRIDE; |
104 virtual int64 GetOriginUsageOnFileTaskRunner( | 111 virtual int64 GetOriginUsageOnFileTaskRunner( |
105 FileSystemContext* context, | 112 FileSystemContext* context, |
106 const GURL& origin_url, | 113 const GURL& origin_url, |
107 FileSystemType type) OVERRIDE; | 114 FileSystemType type) OVERRIDE; |
108 virtual scoped_refptr<QuotaReservation> | 115 virtual scoped_refptr<QuotaReservation> |
109 CreateQuotaReservationOnFileTaskRunner( | 116 CreateQuotaReservationOnFileTaskRunner( |
110 const GURL& origin_url, | 117 const GURL& origin_url, |
111 FileSystemType type) OVERRIDE; | 118 FileSystemType type) OVERRIDE; |
112 virtual void AddFileUpdateObserver( | |
113 FileSystemType type, | |
114 FileUpdateObserver* observer, | |
115 base::SequencedTaskRunner* task_runner) OVERRIDE; | |
116 virtual void AddFileChangeObserver( | |
117 FileSystemType type, | |
118 FileChangeObserver* observer, | |
119 base::SequencedTaskRunner* task_runner) OVERRIDE; | |
120 virtual void AddFileAccessObserver( | |
121 FileSystemType type, | |
122 FileAccessObserver* observer, | |
123 base::SequencedTaskRunner* task_runner) OVERRIDE; | |
124 virtual const UpdateObserverList* GetUpdateObservers( | |
125 FileSystemType type) const OVERRIDE; | |
126 virtual const ChangeObserverList* GetChangeObservers( | |
127 FileSystemType type) const OVERRIDE; | |
128 virtual const AccessObserverList* GetAccessObservers( | |
129 FileSystemType type) const OVERRIDE; | |
130 | 119 |
131 private: | 120 private: |
132 friend class content::PluginPrivateFileSystemBackendTest; | 121 friend class content::PluginPrivateFileSystemBackendTest; |
133 | 122 |
134 ObfuscatedFileUtil* obfuscated_file_util(); | 123 ObfuscatedFileUtil* obfuscated_file_util(); |
135 const base::FilePath& base_path() const { return base_path_; } | 124 const base::FilePath& base_path() const { return base_path_; } |
136 | 125 |
137 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 126 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
138 const FileSystemOptions file_system_options_; | 127 const FileSystemOptions file_system_options_; |
139 const base::FilePath base_path_; | 128 const base::FilePath base_path_; |
140 scoped_ptr<AsyncFileUtil> file_util_; | 129 scoped_ptr<AsyncFileUtil> file_util_; |
141 FileSystemIDToPluginMap* plugin_map_; // Owned by file_util_. | 130 FileSystemIDToPluginMap* plugin_map_; // Owned by file_util_. |
142 base::WeakPtrFactory<PluginPrivateFileSystemBackend> weak_factory_; | 131 base::WeakPtrFactory<PluginPrivateFileSystemBackend> weak_factory_; |
143 | 132 |
144 DISALLOW_COPY_AND_ASSIGN(PluginPrivateFileSystemBackend); | 133 DISALLOW_COPY_AND_ASSIGN(PluginPrivateFileSystemBackend); |
145 }; | 134 }; |
146 | 135 |
147 } // namespace storage | 136 } // namespace storage |
148 | 137 |
149 #endif // STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ | 138 #endif // STORAGE_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |