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 <string> | 10 #include <string> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 IndexedDBFactory* GetIDBFactory(); | 49 IndexedDBFactory* GetIDBFactory(); |
50 | 50 |
51 // The indexed db directory. | 51 // The indexed db directory. |
52 static const base::FilePath::CharType kIndexedDBDirectory[]; | 52 static const base::FilePath::CharType kIndexedDBDirectory[]; |
53 | 53 |
54 // Disables the exit-time deletion of session-only data. | 54 // Disables the exit-time deletion of session-only data. |
55 void SetForceKeepSessionState() { force_keep_session_state_ = true; } | 55 void SetForceKeepSessionState() { force_keep_session_state_ = true; } |
56 | 56 |
57 // IndexedDBContext implementation: | 57 // IndexedDBContext implementation: |
58 virtual base::TaskRunner* TaskRunner() const OVERRIDE; | 58 virtual base::SequencedTaskRunner* TaskRunner() const OVERRIDE; |
59 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; | 59 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; |
60 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; | 60 virtual int64 GetOriginDiskUsage(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(base::SequencedTaskRunner* task_runner) | 64 virtual void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) |
65 OVERRIDE; | 65 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, IndexedDBConnection* db); | 68 void ConnectionOpened(const GURL& origin_url, IndexedDBConnection* db); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 // Only for testing. | 140 // Only for testing. |
141 void ResetCaches(); | 141 void ResetCaches(); |
142 | 142 |
143 scoped_refptr<IndexedDBFactory> factory_; | 143 scoped_refptr<IndexedDBFactory> factory_; |
144 base::FilePath data_path_; | 144 base::FilePath data_path_; |
145 // If true, nothing (not even session-only data) should be deleted on exit. | 145 // If true, nothing (not even session-only data) should be deleted on exit. |
146 bool force_keep_session_state_; | 146 bool force_keep_session_state_; |
147 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 147 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
148 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 148 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
149 base::SequencedTaskRunner* task_runner_; | 149 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
150 scoped_ptr<std::set<GURL> > origin_set_; | 150 scoped_ptr<std::set<GURL> > origin_set_; |
151 OriginToSizeMap origin_size_map_; | 151 OriginToSizeMap origin_size_map_; |
152 OriginToSizeMap space_available_map_; | 152 OriginToSizeMap space_available_map_; |
153 | 153 |
154 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 154 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
155 }; | 155 }; |
156 | 156 |
157 } // namespace content | 157 } // namespace content |
158 | 158 |
159 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 159 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
OLD | NEW |