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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 } | 388 } |
389 | 389 |
390 const LevelDBComparator* LevelDBDatabase::Comparator() const { | 390 const LevelDBComparator* LevelDBDatabase::Comparator() const { |
391 return comparator_; | 391 return comparator_; |
392 } | 392 } |
393 | 393 |
394 void LevelDBDatabase::Compact(const base::StringPiece& start, | 394 void LevelDBDatabase::Compact(const base::StringPiece& start, |
395 const base::StringPiece& stop) { | 395 const base::StringPiece& stop) { |
396 const leveldb::Slice start_slice = MakeSlice(start); | 396 const leveldb::Slice start_slice = MakeSlice(start); |
397 const leveldb::Slice stop_slice = MakeSlice(stop); | 397 const leveldb::Slice stop_slice = MakeSlice(stop); |
398 db_->Write(leveldb::WriteOptions(), NULL); | |
jsbell
2014/07/17 18:33:24
Please add a comment explaining why this is here.
cmumford
2014/07/17 20:51:42
Done.
| |
398 db_->CompactRange(&start_slice, &stop_slice); | 399 db_->CompactRange(&start_slice, &stop_slice); |
399 } | 400 } |
400 | 401 |
401 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } | 402 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } |
402 | 403 |
403 } // namespace content | 404 } // namespace content |
OLD | NEW |