OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "content/browser/indexed_db/indexed_db_factory.h" | 12 #include "content/browser/indexed_db/indexed_db_factory.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class IndexedDBContextImpl; | 16 class IndexedDBContextImpl; |
17 | 17 |
18 class CONTENT_EXPORT IndexedDBFactoryImpl : public IndexedDBFactory { | 18 class CONTENT_EXPORT IndexedDBFactoryImpl : public IndexedDBFactory { |
19 public: | 19 public: |
20 explicit IndexedDBFactoryImpl(IndexedDBContextImpl* context); | 20 explicit IndexedDBFactoryImpl(IndexedDBContextImpl* context); |
21 | 21 |
22 // content::IndexedDBFactory overrides: | 22 // content::IndexedDBFactory overrides: |
23 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, | 23 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, |
24 bool forcedClose) OVERRIDE; | 24 bool forcedClose) override; |
25 | 25 |
26 virtual void GetDatabaseNames( | 26 virtual void GetDatabaseNames( |
27 scoped_refptr<IndexedDBCallbacks> callbacks, | 27 scoped_refptr<IndexedDBCallbacks> callbacks, |
28 const GURL& origin_url, | 28 const GURL& origin_url, |
29 const base::FilePath& data_directory, | 29 const base::FilePath& data_directory, |
30 net::URLRequestContext* request_context) OVERRIDE; | 30 net::URLRequestContext* request_context) override; |
31 virtual void Open(const base::string16& name, | 31 virtual void Open(const base::string16& name, |
32 const IndexedDBPendingConnection& connection, | 32 const IndexedDBPendingConnection& connection, |
33 net::URLRequestContext* request_context, | 33 net::URLRequestContext* request_context, |
34 const GURL& origin_url, | 34 const GURL& origin_url, |
35 const base::FilePath& data_directory) OVERRIDE; | 35 const base::FilePath& data_directory) override; |
36 | 36 |
37 virtual void DeleteDatabase(const base::string16& name, | 37 virtual void DeleteDatabase(const base::string16& name, |
38 net::URLRequestContext* request_context, | 38 net::URLRequestContext* request_context, |
39 scoped_refptr<IndexedDBCallbacks> callbacks, | 39 scoped_refptr<IndexedDBCallbacks> callbacks, |
40 const GURL& origin_url, | 40 const GURL& origin_url, |
41 const base::FilePath& data_directory) OVERRIDE; | 41 const base::FilePath& data_directory) override; |
42 | 42 |
43 virtual void HandleBackingStoreFailure(const GURL& origin_url) OVERRIDE; | 43 virtual void HandleBackingStoreFailure(const GURL& origin_url) override; |
44 virtual void HandleBackingStoreCorruption( | 44 virtual void HandleBackingStoreCorruption( |
45 const GURL& origin_url, | 45 const GURL& origin_url, |
46 const IndexedDBDatabaseError& error) OVERRIDE; | 46 const IndexedDBDatabaseError& error) override; |
47 | 47 |
48 virtual OriginDBs GetOpenDatabasesForOrigin( | 48 virtual OriginDBs GetOpenDatabasesForOrigin( |
49 const GURL& origin_url) const OVERRIDE; | 49 const GURL& origin_url) const override; |
50 | 50 |
51 virtual void ForceClose(const GURL& origin_url) OVERRIDE; | 51 virtual void ForceClose(const GURL& origin_url) override; |
52 | 52 |
53 // Called by the IndexedDBContext destructor so the factory can do cleanup. | 53 // Called by the IndexedDBContext destructor so the factory can do cleanup. |
54 virtual void ContextDestroyed() OVERRIDE; | 54 virtual void ContextDestroyed() override; |
55 | 55 |
56 // Called by the IndexedDBActiveBlobRegistry. | 56 // Called by the IndexedDBActiveBlobRegistry. |
57 virtual void ReportOutstandingBlobs(const GURL& origin_url, | 57 virtual void ReportOutstandingBlobs(const GURL& origin_url, |
58 bool blobs_outstanding) OVERRIDE; | 58 bool blobs_outstanding) override; |
59 | 59 |
60 // Called by an IndexedDBDatabase when it is actually deleted. | 60 // Called by an IndexedDBDatabase when it is actually deleted. |
61 virtual void DatabaseDeleted( | 61 virtual void DatabaseDeleted( |
62 const IndexedDBDatabase::Identifier& identifier) OVERRIDE; | 62 const IndexedDBDatabase::Identifier& identifier) override; |
63 | 63 |
64 virtual size_t GetConnectionCount(const GURL& origin_url) const OVERRIDE; | 64 virtual size_t GetConnectionCount(const GURL& origin_url) const override; |
65 | 65 |
66 protected: | 66 protected: |
67 virtual ~IndexedDBFactoryImpl(); | 67 virtual ~IndexedDBFactoryImpl(); |
68 | 68 |
69 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 69 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
70 const GURL& origin_url, | 70 const GURL& origin_url, |
71 const base::FilePath& data_directory, | 71 const base::FilePath& data_directory, |
72 net::URLRequestContext* request_context, | 72 net::URLRequestContext* request_context, |
73 blink::WebIDBDataLoss* data_loss, | 73 blink::WebIDBDataLoss* data_loss, |
74 std::string* data_loss_reason, | 74 std::string* data_loss_reason, |
75 bool* disk_full, | 75 bool* disk_full, |
76 leveldb::Status* s) OVERRIDE; | 76 leveldb::Status* s) override; |
77 | 77 |
78 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( | 78 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( |
79 const GURL& origin_url, | 79 const GURL& origin_url, |
80 const base::FilePath& data_directory, | 80 const base::FilePath& data_directory, |
81 net::URLRequestContext* request_context, | 81 net::URLRequestContext* request_context, |
82 blink::WebIDBDataLoss* data_loss, | 82 blink::WebIDBDataLoss* data_loss, |
83 std::string* data_loss_message, | 83 std::string* data_loss_message, |
84 bool* disk_full, | 84 bool* disk_full, |
85 bool first_time, | 85 bool first_time, |
86 leveldb::Status* s) OVERRIDE; | 86 leveldb::Status* s) override; |
87 | 87 |
88 void ReleaseBackingStore(const GURL& origin_url, bool immediate); | 88 void ReleaseBackingStore(const GURL& origin_url, bool immediate); |
89 void CloseBackingStore(const GURL& origin_url); | 89 void CloseBackingStore(const GURL& origin_url); |
90 IndexedDBContextImpl* context() const { return context_; } | 90 IndexedDBContextImpl* context() const { return context_; } |
91 | 91 |
92 private: | 92 private: |
93 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, | 93 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, |
94 BackingStoreReleasedOnForcedClose); | 94 BackingStoreReleasedOnForcedClose); |
95 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, | 95 FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, |
96 BackingStoreReleaseDelayedOnClose); | 96 BackingStoreReleaseDelayedOnClose); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; | 129 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; |
130 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; | 130 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; |
131 std::set<GURL> backends_opened_since_boot_; | 131 std::set<GURL> backends_opened_since_boot_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactoryImpl); | 133 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactoryImpl); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace content | 136 } // namespace content |
137 | 137 |
138 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ | 138 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ |
OLD | NEW |