OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_H_ |
| 6 #define CONTENT_BROWSER_STORAGE_PARTITION_H_ |
| 7 |
| 8 #include "base/file_path.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 |
| 11 namespace fileapi { |
| 12 class FileSystemContext; |
| 13 } |
| 14 |
| 15 namespace quota { |
| 16 class QuotaManager; |
| 17 } |
| 18 |
| 19 namespace webkit_database { |
| 20 class DatabaseTracker; |
| 21 } |
| 22 |
| 23 class ChromeAppCacheService; |
| 24 class DOMStorageContextImpl; |
| 25 |
| 26 namespace content { |
| 27 |
| 28 class BrowserContext; |
| 29 class IndexedDBContext; |
| 30 |
| 31 // Defines the what persistent state a child process can access. |
| 32 // |
| 33 // The StoragePartition defines the view each child process has of the |
| 34 // persistent state inside the BrowserContext. This is used to implement |
| 35 // isolated storage where a renderer with isolated storage cannot see |
| 36 // the cookies, localStorage, etc., that normal web renderers have access to. |
| 37 class StoragePartition { |
| 38 public: |
| 39 ~StoragePartition(); |
| 40 |
| 41 // TODO(ajwong): Break the direct dependency on |context|. We only |
| 42 // need 3 pieces of info from it. |
| 43 static StoragePartition* Create(BrowserContext* context, |
| 44 const FilePath& partition_path); |
| 45 |
| 46 quota::QuotaManager* quota_manager() { return quota_manager_; } |
| 47 ChromeAppCacheService* appcache_service() { return appcache_service_; } |
| 48 fileapi::FileSystemContext* filesystem_context() { |
| 49 return filesystem_context_; |
| 50 } |
| 51 webkit_database::DatabaseTracker* database_tracker() { |
| 52 return database_tracker_; |
| 53 } |
| 54 DOMStorageContextImpl* dom_storage_context() { return dom_storage_context_; } |
| 55 IndexedDBContext* indexed_db_context() { return indexed_db_context_; } |
| 56 |
| 57 private: |
| 58 StoragePartition(const FilePath& partition_path, |
| 59 quota::QuotaManager* quota_manager, |
| 60 ChromeAppCacheService* appcache_service, |
| 61 fileapi::FileSystemContext* filesystem_context, |
| 62 webkit_database::DatabaseTracker* database_tracker, |
| 63 DOMStorageContextImpl* dom_storage_context, |
| 64 IndexedDBContext* indexed_db_context); |
| 65 |
| 66 FilePath partition_path_; |
| 67 scoped_refptr<quota::QuotaManager> quota_manager_; |
| 68 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 69 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; |
| 70 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 71 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; |
| 72 scoped_refptr<IndexedDBContext> indexed_db_context_; |
| 73 }; |
| 74 |
| 75 } // namespace content |
| 76 |
| 77 #endif // CONTENT_BROWSER_STORAGE_PARTITION_H_ |
OLD | NEW |