Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 return comparator_; | 454 return comparator_; |
| 455 } | 455 } |
| 456 | 456 |
| 457 void LevelDBDatabase::Compact(const base::StringPiece& start, | 457 void LevelDBDatabase::Compact(const base::StringPiece& start, |
| 458 const base::StringPiece& stop) { | 458 const base::StringPiece& stop) { |
| 459 const leveldb::Slice start_slice = MakeSlice(start); | 459 const leveldb::Slice start_slice = MakeSlice(start); |
| 460 const leveldb::Slice stop_slice = MakeSlice(stop); | 460 const leveldb::Slice stop_slice = MakeSlice(stop); |
| 461 db_->CompactRange(&start_slice, &stop_slice); | 461 db_->CompactRange(&start_slice, &stop_slice); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } | |
|
jsbell
2014/03/26 18:16:58
Given https://code.google.com/p/leveldb/issues/det
cmumford
2014/03/26 21:40:36
Yep, testing shows it to be sufficient.
| |
| 465 | |
| 464 } // namespace content | 466 } // namespace content |
| OLD | NEW |