| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace quota { | 29 namespace quota { |
| 30 class QuotaManagerProxy; | 30 class QuotaManagerProxy; |
| 31 class SpecialStoragePolicy; | 31 class SpecialStoragePolicy; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 class WebIDBDatabaseImpl; | 36 class IndexedDBConnection; |
| 37 | 37 |
| 38 class CONTENT_EXPORT IndexedDBContextImpl | 38 class CONTENT_EXPORT IndexedDBContextImpl |
| 39 : NON_EXPORTED_BASE(public IndexedDBContext) { | 39 : NON_EXPORTED_BASE(public IndexedDBContext) { |
| 40 public: | 40 public: |
| 41 // If |data_path| is empty, nothing will be saved to disk. | 41 // If |data_path| is empty, nothing will be saved to disk. |
| 42 IndexedDBContextImpl(const base::FilePath& data_path, | 42 IndexedDBContextImpl(const base::FilePath& data_path, |
| 43 quota::SpecialStoragePolicy* special_storage_policy, | 43 quota::SpecialStoragePolicy* special_storage_policy, |
| 44 quota::QuotaManagerProxy* quota_manager_proxy, | 44 quota::QuotaManagerProxy* quota_manager_proxy, |
| 45 base::SequencedTaskRunner* task_runner); | 45 base::SequencedTaskRunner* task_runner); |
| 46 | 46 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; | 58 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; |
| 59 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; | 59 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; |
| 60 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; | 60 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; |
| 61 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; | 61 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; |
| 62 virtual base::FilePath GetFilePathForTesting( | 62 virtual base::FilePath GetFilePathForTesting( |
| 63 const std::string& origin_id) const OVERRIDE; | 63 const std::string& origin_id) const OVERRIDE; |
| 64 virtual void SetTaskRunnerForTesting( | 64 virtual void SetTaskRunnerForTesting( |
| 65 base::SequencedTaskRunner* task_runner) OVERRIDE; | 65 base::SequencedTaskRunner* task_runner) OVERRIDE; |
| 66 | 66 |
| 67 // Methods called by IndexedDBDispatcherHost for quota support. | 67 // Methods called by IndexedDBDispatcherHost for quota support. |
| 68 void ConnectionOpened(const GURL& origin_url, WebIDBDatabaseImpl* db); | 68 void ConnectionOpened(const GURL& origin_url, IndexedDBConnection* db); |
| 69 void ConnectionClosed(const GURL& origin_url, WebIDBDatabaseImpl* db); | 69 void ConnectionClosed(const GURL& origin_url, IndexedDBConnection* db); |
| 70 void TransactionComplete(const GURL& origin_url); | 70 void TransactionComplete(const GURL& origin_url); |
| 71 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); | 71 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); |
| 72 bool IsOverQuota(const GURL& origin_url); | 72 bool IsOverQuota(const GURL& origin_url); |
| 73 | 73 |
| 74 quota::QuotaManagerProxy* quota_manager_proxy(); | 74 quota::QuotaManagerProxy* quota_manager_proxy(); |
| 75 | 75 |
| 76 void ForceClose(const GURL& origin_url); | 76 void ForceClose(const GURL& origin_url); |
| 77 base::FilePath GetFilePath(const GURL& origin_url); | 77 base::FilePath GetFilePath(const GURL& origin_url); |
| 78 base::FilePath data_path() const { return data_path_; } | 78 base::FilePath data_path() const { return data_path_; } |
| 79 bool IsInOriginSet(const GURL& origin_url) { | 79 bool IsInOriginSet(const GURL& origin_url) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 scoped_refptr<IndexedDBFactory> idb_factory_; | 124 scoped_refptr<IndexedDBFactory> idb_factory_; |
| 125 base::FilePath data_path_; | 125 base::FilePath data_path_; |
| 126 // If true, nothing (not even session-only data) should be deleted on exit. | 126 // If true, nothing (not even session-only data) should be deleted on exit. |
| 127 bool force_keep_session_state_; | 127 bool force_keep_session_state_; |
| 128 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 128 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 129 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 129 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
| 130 base::SequencedTaskRunner* task_runner_; | 130 base::SequencedTaskRunner* task_runner_; |
| 131 scoped_ptr<std::set<GURL> > origin_set_; | 131 scoped_ptr<std::set<GURL> > origin_set_; |
| 132 OriginToSizeMap origin_size_map_; | 132 OriginToSizeMap origin_size_map_; |
| 133 OriginToSizeMap space_available_map_; | 133 OriginToSizeMap space_available_map_; |
| 134 typedef std::set<WebIDBDatabaseImpl*> ConnectionSet; | 134 typedef std::set<IndexedDBConnection*> ConnectionSet; |
| 135 std::map<GURL, ConnectionSet> connections_; | 135 std::map<GURL, ConnectionSet> connections_; |
| 136 | 136 |
| 137 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 137 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| 141 | 141 |
| 142 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 142 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| OLD | NEW |