OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 #include "url/origin.h" | 25 #include "url/origin.h" |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
29 } | 29 } |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 | 32 |
33 class IndexedDBBackingStore; | 33 class IndexedDBBackingStore; |
| 34 class IndexedDBDataFormatVersion; |
34 struct IndexedDBPendingConnection; | 35 struct IndexedDBPendingConnection; |
35 struct IndexedDBDataLossInfo; | 36 struct IndexedDBDataLossInfo; |
36 | 37 |
37 class CONTENT_EXPORT IndexedDBFactory | 38 class CONTENT_EXPORT IndexedDBFactory |
38 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<IndexedDBFactory>) { | 39 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<IndexedDBFactory>) { |
39 public: | 40 public: |
40 typedef std::multimap<url::Origin, IndexedDBDatabase*> OriginDBMap; | 41 typedef std::multimap<url::Origin, IndexedDBDatabase*> OriginDBMap; |
41 typedef OriginDBMap::const_iterator OriginDBMapIterator; | 42 typedef OriginDBMap::const_iterator OriginDBMapIterator; |
42 typedef std::pair<OriginDBMapIterator, OriginDBMapIterator> OriginDBs; | 43 typedef std::pair<OriginDBMapIterator, OriginDBMapIterator> OriginDBs; |
43 | 44 |
44 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, | 45 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, |
45 bool forced_close) = 0; | 46 bool forced_close) = 0; |
46 | 47 |
47 virtual void GetDatabaseNames( | 48 virtual void GetDatabaseNames( |
48 scoped_refptr<IndexedDBCallbacks> callbacks, | 49 scoped_refptr<IndexedDBCallbacks> callbacks, |
49 const url::Origin& origin, | 50 const url::Origin& origin, |
50 const base::FilePath& data_directory, | 51 const base::FilePath& data_directory, |
| 52 const IndexedDBDataFormatVersion& client_data_format_version, |
51 scoped_refptr<net::URLRequestContextGetter> request_context_getter) = 0; | 53 scoped_refptr<net::URLRequestContextGetter> request_context_getter) = 0; |
52 virtual void Open( | 54 virtual void Open( |
53 const base::string16& name, | 55 const base::string16& name, |
54 std::unique_ptr<IndexedDBPendingConnection> connection, | 56 std::unique_ptr<IndexedDBPendingConnection> connection, |
55 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 57 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
56 const url::Origin& origin, | 58 const url::Origin& origin, |
57 const base::FilePath& data_directory) = 0; | 59 const base::FilePath& data_directory, |
| 60 const IndexedDBDataFormatVersion& client_data_format_version) = 0; |
58 | 61 |
59 virtual void DeleteDatabase( | 62 virtual void DeleteDatabase( |
60 const base::string16& name, | 63 const base::string16& name, |
61 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 64 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
62 scoped_refptr<IndexedDBCallbacks> callbacks, | 65 scoped_refptr<IndexedDBCallbacks> callbacks, |
63 const url::Origin& origin, | 66 const url::Origin& origin, |
64 const base::FilePath& data_directory, | 67 const base::FilePath& data_directory, |
| 68 const IndexedDBDataFormatVersion& client_data_format_version, |
65 bool force_close) = 0; | 69 bool force_close) = 0; |
66 | 70 |
67 virtual void HandleBackingStoreFailure(const url::Origin& origin) = 0; | 71 virtual void HandleBackingStoreFailure(const url::Origin& origin) = 0; |
68 virtual void HandleBackingStoreCorruption( | 72 virtual void HandleBackingStoreCorruption( |
69 const url::Origin& origin, | 73 const url::Origin& origin, |
70 const IndexedDBDatabaseError& error) = 0; | 74 const IndexedDBDatabaseError& error) = 0; |
71 | 75 |
72 virtual OriginDBs GetOpenDatabasesForOrigin( | 76 virtual OriginDBs GetOpenDatabasesForOrigin( |
73 const url::Origin& origin) const = 0; | 77 const url::Origin& origin) const = 0; |
74 | 78 |
(...skipping 14 matching lines...) Expand all Loading... |
89 | 93 |
90 protected: | 94 protected: |
91 friend class base::RefCountedThreadSafe<IndexedDBFactory>; | 95 friend class base::RefCountedThreadSafe<IndexedDBFactory>; |
92 | 96 |
93 IndexedDBFactory() {} | 97 IndexedDBFactory() {} |
94 virtual ~IndexedDBFactory() {} | 98 virtual ~IndexedDBFactory() {} |
95 | 99 |
96 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 100 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
97 const url::Origin& origin, | 101 const url::Origin& origin, |
98 const base::FilePath& data_directory, | 102 const base::FilePath& data_directory, |
| 103 const IndexedDBDataFormatVersion& client_data_format_version, |
99 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 104 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
100 IndexedDBDataLossInfo* data_loss_info, | 105 IndexedDBDataLossInfo* data_loss_info, |
101 bool* disk_full, | 106 bool* disk_full, |
102 leveldb::Status* status) = 0; | 107 leveldb::Status* status) = 0; |
103 | 108 |
104 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( | 109 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( |
105 const url::Origin& origin, | 110 const url::Origin& origin, |
106 const base::FilePath& data_directory, | 111 const base::FilePath& data_directory, |
| 112 const IndexedDBDataFormatVersion& client_data_format_version, |
107 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 113 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
108 IndexedDBDataLossInfo* data_loss_info, | 114 IndexedDBDataLossInfo* data_loss_info, |
109 bool* disk_full, | 115 bool* disk_full, |
110 bool first_time, | 116 bool first_time, |
111 leveldb::Status* status) = 0; | 117 leveldb::Status* status) = 0; |
112 | 118 |
113 private: | 119 private: |
114 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactory); | 120 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactory); |
115 }; | 121 }; |
116 | 122 |
117 } // namespace content | 123 } // namespace content |
118 | 124 |
119 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ | 125 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
OLD | NEW |