Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_class_factory.h
blobb2d202653f6990539bfe2f572c028924c8ce13f9
1 // Copyright 2014 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.
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_
8 #include <set>
10 #include "base/lazy_instance.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/browser/indexed_db/indexed_db_backing_store.h"
13 #include "content/browser/indexed_db/indexed_db_database.h"
14 #include "content/common/content_export.h"
15 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
17 namespace leveldb {
18 class Iterator;
19 } // namespace leveldb
21 namespace content {
23 class IndexedDBBackingStore;
24 class IndexedDBDatabaseCallbacks;
25 class IndexedDBFactory;
26 class IndexedDBTransaction;
27 class LevelDBDatabase;
28 class LevelDBIteratorImpl;
29 class LevelDBTransaction;
31 // Use this factory to create some IndexedDB objects. Exists solely to
32 // facilitate tests which sometimes need to inject mock objects into the system.
33 class CONTENT_EXPORT IndexedDBClassFactory {
34 public:
35 typedef IndexedDBClassFactory* GetterCallback();
37 static IndexedDBClassFactory* Get();
39 static void SetIndexedDBClassFactoryGetter(GetterCallback* cb);
41 virtual IndexedDBDatabase* CreateIndexedDBDatabase(
42 const base::string16& name,
43 IndexedDBBackingStore* backing_store,
44 IndexedDBFactory* factory,
45 const IndexedDBDatabase::Identifier& unique_identifier);
47 virtual IndexedDBTransaction* CreateIndexedDBTransaction(
48 int64 id,
49 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks,
50 const std::set<int64>& scope,
51 blink::WebIDBTransactionMode mode,
52 IndexedDBDatabase* db,
53 IndexedDBBackingStore::Transaction* backing_store_transaction);
55 virtual LevelDBIteratorImpl* CreateIteratorImpl(
56 scoped_ptr<leveldb::Iterator> iterator);
57 virtual LevelDBTransaction* CreateLevelDBTransaction(LevelDBDatabase* db);
59 protected:
60 IndexedDBClassFactory() {}
61 virtual ~IndexedDBClassFactory() {}
62 friend struct base::DefaultLazyInstanceTraits<IndexedDBClassFactory>;
65 } // namespace content
67 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_