Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: content/browser/indexed_db/indexed_db_factory_impl.h

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Coding style fixes Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
7
8 #include <map>
9 #include <set>
10
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h"
14 #include "content/browser/indexed_db/indexed_db_database_callbacks_wrapper.h"
15 #include "content/browser/indexed_db/indexed_db_factory.h"
16 #include "content/common/content_export.h"
17
18 namespace content {
19
20 class DOMStringList;
21
22 class IndexedDBBackingStore;
23 class IndexedDBDatabaseImpl;
24
25 class CONTENT_EXPORT IndexedDBFactoryImpl : public IndexedDBFactory {
26 public:
27 static scoped_refptr<IndexedDBFactoryImpl> Create() {
28 return make_scoped_refptr(new IndexedDBFactoryImpl());
29 }
30
31 // Notifications from weak pointers.
32 virtual void RemoveIDBDatabaseBackend(const string16& unique_identifier);
33
34 virtual void GetDatabaseNames(scoped_refptr<IndexedDBCallbacksWrapper>,
35 const string16& database_identifier,
36 const string16& data_dir) OVERRIDE;
37 virtual void Open(const string16& name,
38 int64_t version,
39 int64_t transaction_id,
40 scoped_refptr<IndexedDBCallbacksWrapper>,
41 scoped_refptr<IndexedDBDatabaseCallbacksWrapper>,
42 const string16& database_identifier,
43 const string16& data_dir) OVERRIDE;
44
45 virtual void DeleteDatabase(const string16& name,
46 scoped_refptr<IndexedDBCallbacksWrapper>,
47 const string16& database_identifier,
48 const string16& data_dir) OVERRIDE;
49
50 protected:
51 IndexedDBFactoryImpl();
52 virtual ~IndexedDBFactoryImpl();
53 virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore(
54 const string16& database_identifier,
55 const string16& data_dir);
56
57 private:
58 typedef std::map<string16, scoped_refptr<IndexedDBDatabaseImpl> >
59 IndexedDBDatabaseMap;
60 IndexedDBDatabaseMap database_backend_map_;
61
62 typedef std::map<string16, base::WeakPtr<IndexedDBBackingStore> >
63 IndexedDBBackingStoreMap;
64 IndexedDBBackingStoreMap backing_store_map_;
65
66 std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_;
67
68 // Only one instance of the factory should exist at any given time.
69 static IndexedDBFactoryImpl* idb_factory_backend_impl;
70 };
71
72 } // namespace content
73
74 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698