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

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

Issue 2233153002: IndexedDB: WrapUnique(new T(args..)) -> MakeUnique<T>(args...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MOAR MakeUnique calls Created 4 years, 4 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 (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 <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 : comparator_(comparator) {} 63 : comparator_(comparator) {}
64 bool operator()(const base::StringPiece& a, 64 bool operator()(const base::StringPiece& a,
65 const base::StringPiece& b) const { 65 const base::StringPiece& b) const {
66 return comparator_->Compare(a, b) < 0; 66 return comparator_->Compare(a, b) < 0;
67 } 67 }
68 68
69 private: 69 private:
70 const LevelDBComparator* comparator_; 70 const LevelDBComparator* comparator_;
71 }; 71 };
72 72
73 typedef std::map<base::StringPiece, Record*, Comparator> DataType; 73 typedef std::map<base::StringPiece, std::unique_ptr<Record>, Comparator>
74 DataType;
74 75
75 class DataIterator : public LevelDBIterator { 76 class DataIterator : public LevelDBIterator {
76 public: 77 public:
77 static std::unique_ptr<DataIterator> Create( 78 static std::unique_ptr<DataIterator> Create(
78 LevelDBTransaction* transaction); 79 LevelDBTransaction* transaction);
79 ~DataIterator() override; 80 ~DataIterator() override;
80 81
81 bool IsValid() const override; 82 bool IsValid() const override;
82 leveldb::Status SeekToLast() override; 83 leveldb::Status SeekToLast() override;
83 leveldb::Status Seek(const base::StringPiece& slice) override; 84 leveldb::Status Seek(const base::StringPiece& slice) override;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 LevelDBDatabase* db_; 171 LevelDBDatabase* db_;
171 std::unique_ptr<LevelDBWriteBatch> write_batch_; 172 std::unique_ptr<LevelDBWriteBatch> write_batch_;
172 bool finished_; 173 bool finished_;
173 174
174 DISALLOW_COPY_AND_ASSIGN(LevelDBDirectTransaction); 175 DISALLOW_COPY_AND_ASSIGN(LevelDBDirectTransaction);
175 }; 176 };
176 177
177 } // namespace content 178 } // namespace content
178 179
179 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_ 180 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698