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