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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_transaction.h

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Settle on one name for the live blob journal. Created 7 years 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
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_LEVELDB_LEVELDB_TRANSACTION_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_
6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 LevelDBDatabase* db_; 127 LevelDBDatabase* db_;
128 const LevelDBSnapshot snapshot_; 128 const LevelDBSnapshot snapshot_;
129 const LevelDBComparator* comparator_; 129 const LevelDBComparator* comparator_;
130 Comparator data_comparator_; 130 Comparator data_comparator_;
131 DataType data_; 131 DataType data_;
132 bool finished_; 132 bool finished_;
133 std::set<TransactionIterator*> iterators_; 133 std::set<TransactionIterator*> iterators_;
134 }; 134 };
135 135
136 // The transaction actually does allow reading, but reads go straight to the
137 // database, ignoring any writes cached in write_batch_, and writes are
138 // write-through, without consolidation.
139 // TODO(ericu): Rename to LevelDBSimpleTransaction or perhaps
140 // LevelDBUncachedTransaction.
136 class LevelDBWriteOnlyTransaction { 141 class LevelDBWriteOnlyTransaction {
137 public: 142 public:
138 static scoped_ptr<LevelDBWriteOnlyTransaction> Create(LevelDBDatabase* db); 143 static scoped_ptr<LevelDBWriteOnlyTransaction> Create(LevelDBDatabase* db);
139 144
140 ~LevelDBWriteOnlyTransaction(); 145 ~LevelDBWriteOnlyTransaction();
146 void Put(const base::StringPiece& key, const std::string* value);
147 bool Get(const base::StringPiece& key, std::string* value, bool* found);
141 void Remove(const base::StringPiece& key); 148 void Remove(const base::StringPiece& key);
142 bool Commit(); 149 bool Commit();
143 150
144 private: 151 private:
145 explicit LevelDBWriteOnlyTransaction(LevelDBDatabase* db); 152 explicit LevelDBWriteOnlyTransaction(LevelDBDatabase* db);
146 153
147 LevelDBDatabase* db_; 154 LevelDBDatabase* db_;
148 scoped_ptr<LevelDBWriteBatch> write_batch_; 155 scoped_ptr<LevelDBWriteBatch> write_batch_;
149 bool finished_; 156 bool finished_;
150 }; 157 };
151 158
152 } // namespace content 159 } // namespace content
153 160
154 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_ 161 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698