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

Side by Side Diff: components/leveldb/leveldb_database_impl.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … Created 4 years, 7 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 | « components/leveldb/leveldb_database_impl.h ('k') | components/leveldb/leveldb_mojo_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/leveldb/leveldb_database_impl.h" 5 #include "components/leveldb/leveldb_database_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 14 matching lines...) Expand all
25 while ((new_id == 0) || (m.find(new_id) != m.end())) 25 while ((new_id == 0) || (m.find(new_id) != m.end()))
26 new_id = base::RandUint64(); 26 new_id = base::RandUint64();
27 27
28 return new_id; 28 return new_id;
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 LevelDBDatabaseImpl::LevelDBDatabaseImpl( 33 LevelDBDatabaseImpl::LevelDBDatabaseImpl(
34 leveldb::LevelDBDatabaseRequest request, 34 leveldb::LevelDBDatabaseRequest request,
35 scoped_ptr<leveldb::Env> environment, 35 std::unique_ptr<leveldb::Env> environment,
36 scoped_ptr<leveldb::DB> db) 36 std::unique_ptr<leveldb::DB> db)
37 : binding_(this, std::move(request)), 37 : binding_(this, std::move(request)),
38 environment_(std::move(environment)), 38 environment_(std::move(environment)),
39 db_(std::move(db)) {} 39 db_(std::move(db)) {}
40 40
41 LevelDBDatabaseImpl::~LevelDBDatabaseImpl() { 41 LevelDBDatabaseImpl::~LevelDBDatabaseImpl() {
42 for (auto& p : iterator_map_) 42 for (auto& p : iterator_map_)
43 delete p.second; 43 delete p.second;
44 for (auto& p : snapshot_map_) 44 for (auto& p : snapshot_map_)
45 db_->ReleaseSnapshot(p.second); 45 db_->ReleaseSnapshot(p.second);
46 } 46 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (!it->Valid()) { 231 if (!it->Valid()) {
232 callback.Run(false, LeveldbStatusToError(it->status()), nullptr, nullptr); 232 callback.Run(false, LeveldbStatusToError(it->status()), nullptr, nullptr);
233 return; 233 return;
234 } 234 }
235 235
236 callback.Run(true, LeveldbStatusToError(it->status()), GetArrayFor(it->key()), 236 callback.Run(true, LeveldbStatusToError(it->status()), GetArrayFor(it->key()),
237 GetArrayFor(it->value())); 237 GetArrayFor(it->value()));
238 } 238 }
239 239
240 } // namespace leveldb 240 } // namespace leveldb
OLDNEW
« no previous file with comments | « components/leveldb/leveldb_database_impl.h ('k') | components/leveldb/leveldb_mojo_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698