| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 IndexedDBFactory* GetIDBFactory(); | 48 IndexedDBFactory* GetIDBFactory(); |
| 49 | 49 |
| 50 // The indexed db directory. | 50 // The indexed db directory. |
| 51 static const base::FilePath::CharType kIndexedDBDirectory[]; | 51 static const base::FilePath::CharType kIndexedDBDirectory[]; |
| 52 | 52 |
| 53 // Disables the exit-time deletion of session-only data. | 53 // Disables the exit-time deletion of session-only data. |
| 54 void SetForceKeepSessionState() { force_keep_session_state_ = true; } | 54 void SetForceKeepSessionState() { force_keep_session_state_ = true; } |
| 55 | 55 |
| 56 // IndexedDBContext implementation: | 56 // IndexedDBContext implementation: |
| 57 virtual base::TaskRunner* TaskRunner() const OVERRIDE; | 57 virtual base::TaskRunner* TaskRunner() const OVERRIDE; |
| 58 virtual std::vector<GURL> GetAllOrigins() OVERRIDE; | |
| 59 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; | 58 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; |
| 60 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; | 59 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; |
| 61 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; | |
| 62 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; | 60 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; |
| 63 virtual base::FilePath GetFilePathForTesting( | 61 virtual base::FilePath GetFilePathForTesting( |
| 64 const std::string& origin_id) const OVERRIDE; | 62 const std::string& origin_id) const OVERRIDE; |
| 65 virtual void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) | 63 virtual void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) |
| 66 OVERRIDE; | 64 OVERRIDE; |
| 67 | 65 |
| 68 // Methods called by IndexedDBDispatcherHost for quota support. | 66 // Methods called by IndexedDBDispatcherHost for quota support. |
| 69 void ConnectionOpened(const GURL& origin_url, IndexedDBConnection* db); | 67 void ConnectionOpened(const GURL& origin_url, IndexedDBConnection* db); |
| 70 void ConnectionClosed(const GURL& origin_url, IndexedDBConnection* db); | 68 void ConnectionClosed(const GURL& origin_url, IndexedDBConnection* db); |
| 71 void TransactionComplete(const GURL& origin_url); | 69 void TransactionComplete(const GURL& origin_url); |
| 72 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); | 70 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); |
| 73 bool IsOverQuota(const GURL& origin_url); | 71 bool IsOverQuota(const GURL& origin_url); |
| 74 | 72 |
| 75 quota::QuotaManagerProxy* quota_manager_proxy(); | 73 quota::QuotaManagerProxy* quota_manager_proxy(); |
| 76 | 74 |
| 75 std::vector<GURL> GetAllOrigins(); |
| 76 base::Time GetOriginLastModified(const GURL& origin_url); |
| 77 base::ListValue* GetAllOriginsDetails(); | 77 base::ListValue* GetAllOriginsDetails(); |
| 78 // ForceClose takes a value rather than a reference since it may release the | 78 // ForceClose takes a value rather than a reference since it may release the |
| 79 // owning object. | 79 // owning object. |
| 80 void ForceClose(const GURL origin_url); | 80 void ForceClose(const GURL origin_url); |
| 81 base::FilePath GetFilePath(const GURL& origin_url) const; | 81 base::FilePath GetFilePath(const GURL& origin_url) const; |
| 82 base::FilePath data_path() const { return data_path_; } | 82 base::FilePath data_path() const { return data_path_; } |
| 83 bool IsInOriginSet(const GURL& origin_url) { | 83 bool IsInOriginSet(const GURL& origin_url) { |
| 84 std::set<GURL>* set = GetOriginSet(); | 84 std::set<GURL>* set = GetOriginSet(); |
| 85 return set->find(origin_url) != set->end(); | 85 return set->find(origin_url) != set->end(); |
| 86 } | 86 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 OriginToSizeMap space_available_map_; | 138 OriginToSizeMap space_available_map_; |
| 139 typedef std::set<IndexedDBConnection*> ConnectionSet; | 139 typedef std::set<IndexedDBConnection*> ConnectionSet; |
| 140 std::map<GURL, ConnectionSet> connections_; | 140 std::map<GURL, ConnectionSet> connections_; |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 142 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace content | 145 } // namespace content |
| 146 | 146 |
| 147 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 147 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| OLD | NEW |