| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 method_histogram_name.append(".EnvMethod"); | 192 method_histogram_name.append(".EnvMethod"); |
| 193 base::LinearHistogram::FactoryGet( | 193 base::LinearHistogram::FactoryGet( |
| 194 method_histogram_name, | 194 method_histogram_name, |
| 195 1, | 195 1, |
| 196 leveldb_env::kNumEntries, | 196 leveldb_env::kNumEntries, |
| 197 leveldb_env::kNumEntries + 1, | 197 leveldb_env::kNumEntries + 1, |
| 198 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(method); | 198 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(method); |
| 199 | 199 |
| 200 std::string error_histogram_name(histogram_name); | 200 std::string error_histogram_name(histogram_name); |
| 201 | 201 |
| 202 if (result == leveldb_env::METHOD_AND_PFE) { | 202 if (result == leveldb_env::METHOD_AND_BFE) { |
| 203 DCHECK_LT(error, 0); | 203 DCHECK_LT(error, 0); |
| 204 error_histogram_name.append(std::string(".PFE.") + | 204 error_histogram_name.append(std::string(".BFE.") + |
| 205 leveldb_env::MethodIDToString(method)); | 205 leveldb_env::MethodIDToString(method)); |
| 206 base::LinearHistogram::FactoryGet( | 206 base::LinearHistogram::FactoryGet( |
| 207 error_histogram_name, | 207 error_histogram_name, |
| 208 1, | 208 1, |
| 209 -base::File::FILE_ERROR_MAX, | 209 -base::File::FILE_ERROR_MAX, |
| 210 -base::File::FILE_ERROR_MAX + 1, | 210 -base::File::FILE_ERROR_MAX + 1, |
| 211 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(-error); | 211 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(-error); |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 const leveldb::Slice start_slice = MakeSlice(start); | 420 const leveldb::Slice start_slice = MakeSlice(start); |
| 421 const leveldb::Slice stop_slice = MakeSlice(stop); | 421 const leveldb::Slice stop_slice = MakeSlice(stop); |
| 422 // NULL batch means just wait for earlier writes to be done | 422 // NULL batch means just wait for earlier writes to be done |
| 423 db_->Write(leveldb::WriteOptions(), NULL); | 423 db_->Write(leveldb::WriteOptions(), NULL); |
| 424 db_->CompactRange(&start_slice, &stop_slice); | 424 db_->CompactRange(&start_slice, &stop_slice); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } | 427 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } |
| 428 | 428 |
| 429 } // namespace content | 429 } // namespace content |
| OLD | NEW |