| 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_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 6 #define STORAGE_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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "storage/browser/fileapi/file_system_backend.h" | 20 #include "storage/browser/fileapi/file_system_backend.h" |
| 21 #include "storage/browser/fileapi/file_system_options.h" | 21 #include "storage/browser/fileapi/file_system_options.h" |
| 22 #include "storage/browser/fileapi/file_system_quota_util.h" | 22 #include "storage/browser/fileapi/file_system_quota_util.h" |
| 23 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
| 23 #include "storage/browser/storage_browser_export.h" | 24 #include "storage/browser/storage_browser_export.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class SequencedTaskRunner; | 27 class SequencedTaskRunner; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 class SandboxFileSystemBackendDelegateTest; | 31 class SandboxFileSystemBackendDelegateTest; |
| 31 class SandboxFileSystemTestHelper; | 32 class SandboxFileSystemTestHelper; |
| 32 } | 33 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const std::string& host, | 140 const std::string& host, |
| 140 std::set<GURL>* origins) OVERRIDE; | 141 std::set<GURL>* origins) OVERRIDE; |
| 141 virtual int64 GetOriginUsageOnFileTaskRunner( | 142 virtual int64 GetOriginUsageOnFileTaskRunner( |
| 142 FileSystemContext* context, | 143 FileSystemContext* context, |
| 143 const GURL& origin_url, | 144 const GURL& origin_url, |
| 144 FileSystemType type) OVERRIDE; | 145 FileSystemType type) OVERRIDE; |
| 145 virtual scoped_refptr<QuotaReservation> | 146 virtual scoped_refptr<QuotaReservation> |
| 146 CreateQuotaReservationOnFileTaskRunner( | 147 CreateQuotaReservationOnFileTaskRunner( |
| 147 const GURL& origin_url, | 148 const GURL& origin_url, |
| 148 FileSystemType type) OVERRIDE; | 149 FileSystemType type) OVERRIDE; |
| 149 virtual void AddFileUpdateObserver( | 150 |
| 150 FileSystemType type, | 151 // Adds an observer for the secified |type| of a file system, bound to |
| 151 FileUpdateObserver* observer, | 152 // |task_runner|. |
| 152 base::SequencedTaskRunner* task_runner) OVERRIDE; | 153 virtual void AddFileUpdateObserver(FileSystemType type, |
| 153 virtual void AddFileChangeObserver( | 154 FileUpdateObserver* observer, |
| 154 FileSystemType type, | 155 base::SequencedTaskRunner* task_runner); |
| 155 FileChangeObserver* observer, | 156 virtual void AddFileChangeObserver(FileSystemType type, |
| 156 base::SequencedTaskRunner* task_runner) OVERRIDE; | 157 FileChangeObserver* observer, |
| 157 virtual void AddFileAccessObserver( | 158 base::SequencedTaskRunner* task_runner); |
| 158 FileSystemType type, | 159 virtual void AddFileAccessObserver(FileSystemType type, |
| 159 FileAccessObserver* observer, | 160 FileAccessObserver* observer, |
| 160 base::SequencedTaskRunner* task_runner) OVERRIDE; | 161 base::SequencedTaskRunner* task_runner); |
| 162 |
| 163 // Returns observer lists for the specified |type| of a file system. |
| 161 virtual const UpdateObserverList* GetUpdateObservers( | 164 virtual const UpdateObserverList* GetUpdateObservers( |
| 162 FileSystemType type) const OVERRIDE; | 165 FileSystemType type) const; |
| 163 virtual const ChangeObserverList* GetChangeObservers( | 166 virtual const ChangeObserverList* GetChangeObservers( |
| 164 FileSystemType type) const OVERRIDE; | 167 FileSystemType type) const; |
| 165 virtual const AccessObserverList* GetAccessObservers( | 168 virtual const AccessObserverList* GetAccessObservers( |
| 166 FileSystemType type) const OVERRIDE; | 169 FileSystemType type) const; |
| 167 | 170 |
| 168 // Registers quota observer for file updates on filesystem of |type|. | 171 // Registers quota observer for file updates on filesystem of |type|. |
| 169 void RegisterQuotaUpdateObserver(FileSystemType type); | 172 void RegisterQuotaUpdateObserver(FileSystemType type); |
| 170 | 173 |
| 171 void InvalidateUsageCache(const GURL& origin_url, | 174 void InvalidateUsageCache(const GURL& origin_url, |
| 172 FileSystemType type); | 175 FileSystemType type); |
| 173 void StickyInvalidateUsageCache(const GURL& origin_url, | 176 void StickyInvalidateUsageCache(const GURL& origin_url, |
| 174 FileSystemType type); | 177 FileSystemType type); |
| 175 | 178 |
| 176 void CollectOpenFileSystemMetrics(base::File::Error error_code); | 179 void CollectOpenFileSystemMetrics(base::File::Error error_code); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 base::Time next_release_time_for_open_filesystem_stat_; | 254 base::Time next_release_time_for_open_filesystem_stat_; |
| 252 | 255 |
| 253 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; | 256 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; |
| 254 | 257 |
| 255 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); | 258 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); |
| 256 }; | 259 }; |
| 257 | 260 |
| 258 } // namespace storage | 261 } // namespace storage |
| 259 | 262 |
| 260 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 263 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
| OLD | NEW |