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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_write_batch.cc

Issue 2233153002: IndexedDB: WrapUnique(new T(args..)) -> MakeUnique<T>(args...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/indexed_db/leveldb/leveldb_write_batch.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_write_batch.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "third_party/leveldatabase/src/include/leveldb/slice.h" 9 #include "third_party/leveldatabase/src/include/leveldb/slice.h"
10 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" 10 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 std::unique_ptr<LevelDBWriteBatch> LevelDBWriteBatch::Create() { 14 std::unique_ptr<LevelDBWriteBatch> LevelDBWriteBatch::Create() {
15 return base::WrapUnique(new LevelDBWriteBatch); 15 return base::WrapUnique(new LevelDBWriteBatch());
cmumford 2016/08/10 23:03:47 It's too bad MakeUnique can't handle private metho
16 } 16 }
17 17
18 LevelDBWriteBatch::LevelDBWriteBatch() 18 LevelDBWriteBatch::LevelDBWriteBatch()
19 : write_batch_(new leveldb::WriteBatch) {} 19 : write_batch_(new leveldb::WriteBatch) {}
20 20
21 LevelDBWriteBatch::~LevelDBWriteBatch() {} 21 LevelDBWriteBatch::~LevelDBWriteBatch() {}
22 22
23 static leveldb::Slice MakeSlice(const base::StringPiece& s) { 23 static leveldb::Slice MakeSlice(const base::StringPiece& s) {
24 return leveldb::Slice(s.begin(), s.size()); 24 return leveldb::Slice(s.begin(), s.size());
25 } 25 }
26 26
27 void LevelDBWriteBatch::Put(const base::StringPiece& key, 27 void LevelDBWriteBatch::Put(const base::StringPiece& key,
28 const base::StringPiece& value) { 28 const base::StringPiece& value) {
29 write_batch_->Put(MakeSlice(key), MakeSlice(value)); 29 write_batch_->Put(MakeSlice(key), MakeSlice(value));
30 } 30 }
31 31
32 void LevelDBWriteBatch::Remove(const base::StringPiece& key) { 32 void LevelDBWriteBatch::Remove(const base::StringPiece& key) {
33 write_batch_->Delete(MakeSlice(key)); 33 write_batch_->Delete(MakeSlice(key));
34 } 34 }
35 35
36 void LevelDBWriteBatch::Clear() { write_batch_->Clear(); } 36 void LevelDBWriteBatch::Clear() { write_batch_->Clear(); }
37 37
38 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698