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

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

Issue 2760163002: [IndexedDB] Pool and evict leveldb iterators, to save memory (Closed)
Patch Set: comments Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_CLASS_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 12
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "content/browser/indexed_db/indexed_db_backing_store.h" 15 #include "content/browser/indexed_db/indexed_db_backing_store.h"
16 #include "content/browser/indexed_db/indexed_db_database.h" 16 #include "content/browser/indexed_db/indexed_db_database.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" 18 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
19 19
20 namespace leveldb { 20 namespace leveldb {
21 class Iterator; 21 class Iterator;
22 class Snapshot;
22 } // namespace leveldb 23 } // namespace leveldb
23 24
24 namespace content { 25 namespace content {
25 26
26 class IndexedDBBackingStore; 27 class IndexedDBBackingStore;
27 class IndexedDBConnection; 28 class IndexedDBConnection;
28 class IndexedDBFactory; 29 class IndexedDBFactory;
29 class IndexedDBTransaction; 30 class IndexedDBTransaction;
30 class LevelDBDatabase; 31 class LevelDBDatabase;
31 class LevelDBIteratorImpl; 32 class LevelDBIteratorImpl;
(...skipping 16 matching lines...) Expand all
48 const IndexedDBDatabase::Identifier& unique_identifier); 49 const IndexedDBDatabase::Identifier& unique_identifier);
49 50
50 virtual std::unique_ptr<IndexedDBTransaction> CreateIndexedDBTransaction( 51 virtual std::unique_ptr<IndexedDBTransaction> CreateIndexedDBTransaction(
51 int64_t id, 52 int64_t id,
52 IndexedDBConnection* connection, 53 IndexedDBConnection* connection,
53 const std::set<int64_t>& scope, 54 const std::set<int64_t>& scope,
54 blink::WebIDBTransactionMode mode, 55 blink::WebIDBTransactionMode mode,
55 IndexedDBBackingStore::Transaction* backing_store_transaction); 56 IndexedDBBackingStore::Transaction* backing_store_transaction);
56 57
57 virtual std::unique_ptr<LevelDBIteratorImpl> CreateIteratorImpl( 58 virtual std::unique_ptr<LevelDBIteratorImpl> CreateIteratorImpl(
58 std::unique_ptr<leveldb::Iterator> iterator); 59 std::unique_ptr<leveldb::Iterator> iterator,
60 LevelDBDatabase* db,
61 const leveldb::Snapshot* snapshot);
59 62
60 virtual scoped_refptr<LevelDBTransaction> CreateLevelDBTransaction( 63 virtual scoped_refptr<LevelDBTransaction> CreateLevelDBTransaction(
61 LevelDBDatabase* db); 64 LevelDBDatabase* db);
62 65
63 protected: 66 protected:
64 IndexedDBClassFactory() {} 67 IndexedDBClassFactory() {}
65 virtual ~IndexedDBClassFactory() {} 68 virtual ~IndexedDBClassFactory() {}
66 friend struct base::LazyInstanceTraitsBase<IndexedDBClassFactory>; 69 friend struct base::LazyInstanceTraitsBase<IndexedDBClassFactory>;
67 }; 70 };
68 71
69 } // namespace content 72 } // namespace content
70 73
71 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_ 74 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CLASS_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698