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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #include "content/browser/indexed_db/leveldb/leveldb_database.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_database.h"
6 6
7 #include <cerrno> 7 #include <cerrno>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 options.env = leveldb::IDBEnv(); 121 options.env = leveldb::IDBEnv();
122 // ChromiumEnv assumes UTF8, converts back to FilePath before using. 122 // ChromiumEnv assumes UTF8, converts back to FilePath before using.
123 return leveldb::DestroyDB(file_name.AsUTF8Unsafe(), options); 123 return leveldb::DestroyDB(file_name.AsUTF8Unsafe(), options);
124 } 124 }
125 125
126 namespace { 126 namespace {
127 class LockImpl : public LevelDBLock { 127 class LockImpl : public LevelDBLock {
128 public: 128 public:
129 explicit LockImpl(leveldb::Env* env, leveldb::FileLock* lock) 129 explicit LockImpl(leveldb::Env* env, leveldb::FileLock* lock)
130 : env_(env), lock_(lock) {} 130 : env_(env), lock_(lock) {}
131 virtual ~LockImpl() { env_->UnlockFile(lock_); } 131 ~LockImpl() override { env_->UnlockFile(lock_); }
132
132 private: 133 private:
133 leveldb::Env* env_; 134 leveldb::Env* env_;
134 leveldb::FileLock* lock_; 135 leveldb::FileLock* lock_;
135 136
136 DISALLOW_COPY_AND_ASSIGN(LockImpl); 137 DISALLOW_COPY_AND_ASSIGN(LockImpl);
137 }; 138 };
138 } // namespace 139 } // namespace
139 140
140 scoped_ptr<LevelDBLock> LevelDBDatabase::LockForTesting( 141 scoped_ptr<LevelDBLock> LevelDBDatabase::LockForTesting(
141 const base::FilePath& file_name) { 142 const base::FilePath& file_name) {
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 const leveldb::Slice start_slice = MakeSlice(start); 428 const leveldb::Slice start_slice = MakeSlice(start);
428 const leveldb::Slice stop_slice = MakeSlice(stop); 429 const leveldb::Slice stop_slice = MakeSlice(stop);
429 // NULL batch means just wait for earlier writes to be done 430 // NULL batch means just wait for earlier writes to be done
430 db_->Write(leveldb::WriteOptions(), NULL); 431 db_->Write(leveldb::WriteOptions(), NULL);
431 db_->CompactRange(&start_slice, &stop_slice); 432 db_->CompactRange(&start_slice, &stop_slice);
432 } 433 }
433 434
434 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } 435 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); }
435 436
436 } // namespace content 437 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.h ('k') | content/browser/indexed_db/leveldb/leveldb_iterator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698