Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 FORCE_CLOSE_COPY_ORIGIN, | 54 FORCE_CLOSE_COPY_ORIGIN, |
| 55 FORCE_CLOSE_REASON_MAX | 55 FORCE_CLOSE_REASON_MAX |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // The indexed db directory. | 58 // The indexed db directory. |
| 59 static const base::FilePath::CharType kIndexedDBDirectory[]; | 59 static const base::FilePath::CharType kIndexedDBDirectory[]; |
| 60 | 60 |
| 61 // If |data_path| is empty, nothing will be saved to disk. | 61 // If |data_path| is empty, nothing will be saved to disk. |
| 62 IndexedDBContextImpl(const base::FilePath& data_path, | 62 IndexedDBContextImpl(const base::FilePath& data_path, |
| 63 storage::SpecialStoragePolicy* special_storage_policy, | 63 storage::SpecialStoragePolicy* special_storage_policy, |
| 64 storage::QuotaManagerProxy* quota_manager_proxy, | 64 storage::QuotaManagerProxy* quota_manager_proxy); |
| 65 scoped_refptr<base::SequencedTaskRunner> task_runner); | |
| 66 | 65 |
| 67 IndexedDBFactory* GetIDBFactory(); | 66 IndexedDBFactory* GetIDBFactory(); |
| 68 | 67 |
| 69 // Disables the exit-time deletion of session-only data. | 68 // Disables the exit-time deletion of session-only data. |
| 70 void SetForceKeepSessionState() { force_keep_session_state_ = true; } | 69 void SetForceKeepSessionState() { force_keep_session_state_ = true; } |
| 71 | 70 |
| 72 // IndexedDBContext implementation: | 71 // IndexedDBContext implementation: |
| 73 base::SequencedTaskRunner* TaskRunner() const override; | 72 base::SequencedTaskRunner* TaskRunner() const override; |
| 74 std::vector<IndexedDBInfo> GetAllOriginsInfo() override; | 73 std::vector<IndexedDBInfo> GetAllOriginsInfo() override; |
| 75 int64_t GetOriginDiskUsage(const GURL& origin_url) override; | 74 int64_t GetOriginDiskUsage(const GURL& origin_url) override; |
| 76 void DeleteForOrigin(const GURL& origin_url) override; | 75 void DeleteForOrigin(const GURL& origin_url) override; |
| 77 void CopyOriginData(const GURL& origin_url, | 76 void CopyOriginData(const GURL& origin_url, |
| 78 IndexedDBContext* dest_context) override; | 77 IndexedDBContext* dest_context) override; |
| 79 base::FilePath GetFilePathForTesting(const GURL& origin_url) const override; | 78 base::FilePath GetFilePathForTesting(const GURL& origin_url) const override; |
| 80 void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) override; | 79 void SetTaskRunnerForTesting( |
| 80 const scoped_refptr<base::SequencedTaskRunner>& task_runner) override; | |
|
gab
2017/06/13 15:31:23
ditto (prefer by value)
| |
| 81 | 81 |
| 82 // TODO(jsbell): Replace IndexedDBContext members with these. | 82 // TODO(jsbell): Replace IndexedDBContext members with these. |
| 83 int64_t GetOriginDiskUsage(const url::Origin& origin); | 83 int64_t GetOriginDiskUsage(const url::Origin& origin); |
| 84 void DeleteForOrigin(const url::Origin& origin); | 84 void DeleteForOrigin(const url::Origin& origin); |
| 85 void CopyOriginData(const url::Origin& origin, | 85 void CopyOriginData(const url::Origin& origin, |
| 86 IndexedDBContext* dest_context); | 86 IndexedDBContext* dest_context); |
| 87 base::FilePath GetFilePathForTesting(const url::Origin& origin) const; | 87 base::FilePath GetFilePathForTesting(const url::Origin& origin) const; |
| 88 | 88 |
| 89 // Methods called by IndexedDBDispatcherHost for quota support. | 89 // Methods called by IndexedDBDispatcherHost for quota support. |
| 90 void ConnectionOpened(const url::Origin& origin, IndexedDBConnection* db); | 90 void ConnectionOpened(const url::Origin& origin, IndexedDBConnection* db); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 165 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 166 std::unique_ptr<std::set<url::Origin>> origin_set_; | 166 std::unique_ptr<std::set<url::Origin>> origin_set_; |
| 167 std::map<url::Origin, int64_t> origin_size_map_; | 167 std::map<url::Origin, int64_t> origin_size_map_; |
| 168 | 168 |
| 169 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 169 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace content | 172 } // namespace content |
| 173 | 173 |
| 174 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 174 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| OLD | NEW |