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 void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, |
24 bool forcedClose) override; | 24 bool forcedClose) override; |
25 | 25 |
26 virtual void GetDatabaseNames( | 26 void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, |
27 scoped_refptr<IndexedDBCallbacks> callbacks, | 27 const GURL& origin_url, |
28 const GURL& origin_url, | 28 const base::FilePath& data_directory, |
29 const base::FilePath& data_directory, | 29 net::URLRequestContext* request_context) override; |
30 net::URLRequestContext* request_context) override; | 30 void Open(const base::string16& name, |
31 virtual void Open(const base::string16& name, | 31 const IndexedDBPendingConnection& connection, |
32 const IndexedDBPendingConnection& connection, | 32 net::URLRequestContext* request_context, |
33 net::URLRequestContext* request_context, | 33 const GURL& origin_url, |
34 const GURL& origin_url, | 34 const base::FilePath& data_directory) override; |
35 const base::FilePath& data_directory) override; | |
36 | 35 |
37 virtual void DeleteDatabase(const base::string16& name, | 36 void DeleteDatabase(const base::string16& name, |
38 net::URLRequestContext* request_context, | 37 net::URLRequestContext* request_context, |
39 scoped_refptr<IndexedDBCallbacks> callbacks, | 38 scoped_refptr<IndexedDBCallbacks> callbacks, |
40 const GURL& origin_url, | 39 const GURL& origin_url, |
41 const base::FilePath& data_directory) override; | 40 const base::FilePath& data_directory) override; |
42 | 41 |
43 virtual void HandleBackingStoreFailure(const GURL& origin_url) override; | 42 void HandleBackingStoreFailure(const GURL& origin_url) override; |
44 virtual void HandleBackingStoreCorruption( | 43 void HandleBackingStoreCorruption( |
45 const GURL& origin_url, | 44 const GURL& origin_url, |
46 const IndexedDBDatabaseError& error) override; | 45 const IndexedDBDatabaseError& error) override; |
47 | 46 |
48 virtual OriginDBs GetOpenDatabasesForOrigin( | 47 OriginDBs GetOpenDatabasesForOrigin(const GURL& origin_url) const override; |
49 const GURL& origin_url) const override; | |
50 | 48 |
51 virtual void ForceClose(const GURL& origin_url) override; | 49 void ForceClose(const GURL& origin_url) override; |
52 | 50 |
53 // Called by the IndexedDBContext destructor so the factory can do cleanup. | 51 // Called by the IndexedDBContext destructor so the factory can do cleanup. |
54 virtual void ContextDestroyed() override; | 52 void ContextDestroyed() override; |
55 | 53 |
56 // Called by the IndexedDBActiveBlobRegistry. | 54 // Called by the IndexedDBActiveBlobRegistry. |
57 virtual void ReportOutstandingBlobs(const GURL& origin_url, | 55 void ReportOutstandingBlobs(const GURL& origin_url, |
58 bool blobs_outstanding) override; | 56 bool blobs_outstanding) override; |
59 | 57 |
60 // Called by an IndexedDBDatabase when it is actually deleted. | 58 // Called by an IndexedDBDatabase when it is actually deleted. |
61 virtual void DatabaseDeleted( | 59 void DatabaseDeleted( |
62 const IndexedDBDatabase::Identifier& identifier) override; | 60 const IndexedDBDatabase::Identifier& identifier) override; |
63 | 61 |
64 virtual size_t GetConnectionCount(const GURL& origin_url) const override; | 62 size_t GetConnectionCount(const GURL& origin_url) const override; |
65 | 63 |
66 protected: | 64 protected: |
67 virtual ~IndexedDBFactoryImpl(); | 65 ~IndexedDBFactoryImpl() override; |
68 | 66 |
69 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 67 scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
70 const GURL& origin_url, | 68 const GURL& origin_url, |
71 const base::FilePath& data_directory, | 69 const base::FilePath& data_directory, |
72 net::URLRequestContext* request_context, | 70 net::URLRequestContext* request_context, |
73 blink::WebIDBDataLoss* data_loss, | 71 blink::WebIDBDataLoss* data_loss, |
74 std::string* data_loss_reason, | 72 std::string* data_loss_reason, |
75 bool* disk_full, | 73 bool* disk_full, |
76 leveldb::Status* s) override; | 74 leveldb::Status* s) override; |
77 | 75 |
78 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( | 76 scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( |
79 const GURL& origin_url, | 77 const GURL& origin_url, |
80 const base::FilePath& data_directory, | 78 const base::FilePath& data_directory, |
81 net::URLRequestContext* request_context, | 79 net::URLRequestContext* request_context, |
82 blink::WebIDBDataLoss* data_loss, | 80 blink::WebIDBDataLoss* data_loss, |
83 std::string* data_loss_message, | 81 std::string* data_loss_message, |
84 bool* disk_full, | 82 bool* disk_full, |
85 bool first_time, | 83 bool first_time, |
86 leveldb::Status* s) override; | 84 leveldb::Status* s) override; |
87 | 85 |
88 void ReleaseBackingStore(const GURL& origin_url, bool immediate); | 86 void ReleaseBackingStore(const GURL& origin_url, bool immediate); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; | 127 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_; |
130 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; | 128 IndexedDBBackingStoreMap backing_stores_with_active_blobs_; |
131 std::set<GURL> backends_opened_since_boot_; | 129 std::set<GURL> backends_opened_since_boot_; |
132 | 130 |
133 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactoryImpl); | 131 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactoryImpl); |
134 }; | 132 }; |
135 | 133 |
136 } // namespace content | 134 } // namespace content |
137 | 135 |
138 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ | 136 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_ |
OLD | NEW |