| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ | 6 #define CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| 11 #include "webkit/fileapi/sandboxed_file_system_context.h" |
| 11 | 12 |
| 12 class FilePath; | 13 class FilePath; |
| 13 class GURL; | 14 class GURL; |
| 14 | 15 |
| 15 namespace fileapi { | |
| 16 class FileSystemPathManager; | |
| 17 class FileSystemQuotaManager; | |
| 18 } | |
| 19 | |
| 20 // This is owned by profile and shared by all the FileSystemDispatcherHost | 16 // This is owned by profile and shared by all the FileSystemDispatcherHost |
| 21 // that shared by the same profile. | 17 // that shared by the same profile. This class is just a thin wrapper around |
| 18 // fileapi::SandboxedFileSystemContext. |
| 22 class BrowserFileSystemContext | 19 class BrowserFileSystemContext |
| 23 : public base::RefCountedThreadSafe<BrowserFileSystemContext, | 20 : public base::RefCountedThreadSafe<BrowserFileSystemContext, |
| 24 BrowserThread::DeleteOnIOThread> { | 21 BrowserThread::DeleteOnIOThread>, |
| 22 public fileapi::SandboxedFileSystemContext { |
| 25 public: | 23 public: |
| 26 BrowserFileSystemContext(const FilePath& data_path, bool is_incognito); | 24 BrowserFileSystemContext(const FilePath& profile_path, bool is_incognito); |
| 27 virtual ~BrowserFileSystemContext(); | 25 virtual ~BrowserFileSystemContext(); |
| 28 | 26 |
| 29 // Quota related methods. | 27 // Quota related methods. |
| 30 bool CheckOriginQuota(const GURL& url, int64 growth); | |
| 31 void SetOriginQuotaUnlimited(const GURL& url); | 28 void SetOriginQuotaUnlimited(const GURL& url); |
| 32 void ResetOriginQuotaUnlimited(const GURL& url); | 29 void ResetOriginQuotaUnlimited(const GURL& url); |
| 33 | 30 |
| 34 fileapi::FileSystemPathManager* path_manager() { return path_manager_.get(); } | |
| 35 | |
| 36 private: | 31 private: |
| 37 scoped_ptr<fileapi::FileSystemQuotaManager> quota_manager_; | |
| 38 scoped_ptr<fileapi::FileSystemPathManager> path_manager_; | |
| 39 | |
| 40 DISALLOW_IMPLICIT_CONSTRUCTORS(BrowserFileSystemContext); | 32 DISALLOW_IMPLICIT_CONSTRUCTORS(BrowserFileSystemContext); |
| 41 }; | 33 }; |
| 42 | 34 |
| 43 #endif // CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ | 35 #endif // CHROME_BROWSER_FILE_SYSTEM_BROWSER_FILE_SYSTEM_CONTEXT_H_ |
| OLD | NEW |