| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ |
| 6 #define CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 namespace quota { | 11 namespace quota { |
| 12 class QuotaManager; | 12 class QuotaManager; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace fileapi { | 15 namespace storage { |
| 16 class FileSystemContext; | 16 class FileSystemContext; |
| 17 } // namespace fileapi | 17 } // namespace storage |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 class URLRequestContextGetter; | 20 class URLRequestContextGetter; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace webkit_database { | 23 namespace webkit_database { |
| 24 class DatabaseTracker; | 24 class DatabaseTracker; |
| 25 } // namespace webkit_database | 25 } // namespace webkit_database |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 // This class is effectively a struct, but we make it a class because we want to | 41 // This class is effectively a struct, but we make it a class because we want to |
| 42 // define copy constructors, assignment operators, and an Equals() function for | 42 // define copy constructors, assignment operators, and an Equals() function for |
| 43 // it which makes it look awkward as a struct. | 43 // it which makes it look awkward as a struct. |
| 44 class CONTENT_EXPORT WorkerStoragePartition { | 44 class CONTENT_EXPORT WorkerStoragePartition { |
| 45 public: | 45 public: |
| 46 WorkerStoragePartition( | 46 WorkerStoragePartition( |
| 47 net::URLRequestContextGetter* url_request_context, | 47 net::URLRequestContextGetter* url_request_context, |
| 48 net::URLRequestContextGetter* media_url_request_context, | 48 net::URLRequestContextGetter* media_url_request_context, |
| 49 ChromeAppCacheService* appcache_service, | 49 ChromeAppCacheService* appcache_service, |
| 50 quota::QuotaManager* quota_manager, | 50 quota::QuotaManager* quota_manager, |
| 51 fileapi::FileSystemContext* filesystem_context, | 51 storage::FileSystemContext* filesystem_context, |
| 52 webkit_database::DatabaseTracker* database_tracker, | 52 webkit_database::DatabaseTracker* database_tracker, |
| 53 IndexedDBContextImpl* indexed_db_context, | 53 IndexedDBContextImpl* indexed_db_context, |
| 54 ServiceWorkerContextWrapper* service_worker_context); | 54 ServiceWorkerContextWrapper* service_worker_context); |
| 55 ~WorkerStoragePartition(); | 55 ~WorkerStoragePartition(); |
| 56 | 56 |
| 57 // Declaring so these don't get inlined which has the unfortunate effect of | 57 // Declaring so these don't get inlined which has the unfortunate effect of |
| 58 // requiring all including classes to have the full definition of every member | 58 // requiring all including classes to have the full definition of every member |
| 59 // type. | 59 // type. |
| 60 WorkerStoragePartition(const WorkerStoragePartition& other); | 60 WorkerStoragePartition(const WorkerStoragePartition& other); |
| 61 const WorkerStoragePartition& operator=(const WorkerStoragePartition& rhs); | 61 const WorkerStoragePartition& operator=(const WorkerStoragePartition& rhs); |
| 62 | 62 |
| 63 bool Equals(const WorkerStoragePartition& other) const; | 63 bool Equals(const WorkerStoragePartition& other) const; |
| 64 | 64 |
| 65 net::URLRequestContextGetter* url_request_context() const { | 65 net::URLRequestContextGetter* url_request_context() const { |
| 66 return url_request_context_.get(); | 66 return url_request_context_.get(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 net::URLRequestContextGetter* media_url_request_context() const { | 69 net::URLRequestContextGetter* media_url_request_context() const { |
| 70 return media_url_request_context_.get(); | 70 return media_url_request_context_.get(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 ChromeAppCacheService* appcache_service() const { | 73 ChromeAppCacheService* appcache_service() const { |
| 74 return appcache_service_.get(); | 74 return appcache_service_.get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 quota::QuotaManager* quota_manager() const { | 77 quota::QuotaManager* quota_manager() const { |
| 78 return quota_manager_.get(); | 78 return quota_manager_.get(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 fileapi::FileSystemContext* filesystem_context() const { | 81 storage::FileSystemContext* filesystem_context() const { |
| 82 return filesystem_context_.get(); | 82 return filesystem_context_.get(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 webkit_database::DatabaseTracker* database_tracker() const { | 85 webkit_database::DatabaseTracker* database_tracker() const { |
| 86 return database_tracker_.get(); | 86 return database_tracker_.get(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 IndexedDBContextImpl* indexed_db_context() const { | 89 IndexedDBContextImpl* indexed_db_context() const { |
| 90 return indexed_db_context_.get(); | 90 return indexed_db_context_.get(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 ServiceWorkerContextWrapper* service_worker_context() const { | 93 ServiceWorkerContextWrapper* service_worker_context() const { |
| 94 return service_worker_context_.get(); | 94 return service_worker_context_.get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 void Copy(const WorkerStoragePartition& other); | 98 void Copy(const WorkerStoragePartition& other); |
| 99 | 99 |
| 100 scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 100 scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
| 101 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; | 101 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; |
| 102 scoped_refptr<ChromeAppCacheService> appcache_service_; | 102 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 103 scoped_refptr<quota::QuotaManager> quota_manager_; | 103 scoped_refptr<quota::QuotaManager> quota_manager_; |
| 104 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; | 104 scoped_refptr<storage::FileSystemContext> filesystem_context_; |
| 105 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 105 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 106 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 106 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
| 107 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 107 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 // WorkerStoragePartitionId can be used to identify each | 110 // WorkerStoragePartitionId can be used to identify each |
| 111 // WorkerStoragePartitions. We can hold WorkerStoragePartitionId without | 111 // WorkerStoragePartitions. We can hold WorkerStoragePartitionId without |
| 112 // extending the lifetime of all objects in the WorkerStoragePartition. | 112 // extending the lifetime of all objects in the WorkerStoragePartition. |
| 113 // That means that holding a WorkerStoragePartitionId doesn't mean the | 113 // That means that holding a WorkerStoragePartitionId doesn't mean the |
| 114 // corresponding partition and its members are kept alive. | 114 // corresponding partition and its members are kept alive. |
| 115 class CONTENT_EXPORT WorkerStoragePartitionId { | 115 class CONTENT_EXPORT WorkerStoragePartitionId { |
| 116 public: | 116 public: |
| 117 explicit WorkerStoragePartitionId(const WorkerStoragePartition& partition); | 117 explicit WorkerStoragePartitionId(const WorkerStoragePartition& partition); |
| 118 ~WorkerStoragePartitionId(); | 118 ~WorkerStoragePartitionId(); |
| 119 bool Equals(const WorkerStoragePartitionId& other) const; | 119 bool Equals(const WorkerStoragePartitionId& other) const; |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 net::URLRequestContextGetter* url_request_context_; | 122 net::URLRequestContextGetter* url_request_context_; |
| 123 net::URLRequestContextGetter* media_url_request_context_; | 123 net::URLRequestContextGetter* media_url_request_context_; |
| 124 ChromeAppCacheService* appcache_service_; | 124 ChromeAppCacheService* appcache_service_; |
| 125 quota::QuotaManager* quota_manager_; | 125 quota::QuotaManager* quota_manager_; |
| 126 fileapi::FileSystemContext* filesystem_context_; | 126 storage::FileSystemContext* filesystem_context_; |
| 127 webkit_database::DatabaseTracker* database_tracker_; | 127 webkit_database::DatabaseTracker* database_tracker_; |
| 128 IndexedDBContextImpl* indexed_db_context_; | 128 IndexedDBContextImpl* indexed_db_context_; |
| 129 ServiceWorkerContextWrapper* service_worker_context_; | 129 ServiceWorkerContextWrapper* service_worker_context_; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| 133 | 133 |
| 134 #endif // CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ | 134 #endif // CONTENT_BROWSER_SHARED_WORKERT_WORKER_STORAGE_PARTITION_H_ |
| OLD | NEW |