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

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

Issue 791923003: replace COMPILE_ASSERT with static_assert in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixups Created 5 years, 11 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 1, 163 1,
164 2 /*boundary*/, 164 2 /*boundary*/,
165 2 /*boundary*/ + 1, 165 2 /*boundary*/ + 1,
166 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(1 /*sample*/); 166 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(1 /*sample*/);
167 return -1; 167 return -1;
168 } 168 }
169 int clamped_disk_space_k_bytes = free_disk_space_in_k_bytes > INT_MAX 169 int clamped_disk_space_k_bytes = free_disk_space_in_k_bytes > INT_MAX
170 ? INT_MAX 170 ? INT_MAX
171 : free_disk_space_in_k_bytes; 171 : free_disk_space_in_k_bytes;
172 const uint64 histogram_max = static_cast<uint64>(1e9); 172 const uint64 histogram_max = static_cast<uint64>(1e9);
173 COMPILE_ASSERT(histogram_max <= INT_MAX, histogram_max_too_big); 173 static_assert(histogram_max <= INT_MAX, "histogram_max too big");
174 base::Histogram::FactoryGet(name, 174 base::Histogram::FactoryGet(name,
175 1, 175 1,
176 histogram_max, 176 histogram_max,
177 11 /*buckets*/, 177 11 /*buckets*/,
178 base::HistogramBase::kUmaTargetedHistogramFlag) 178 base::HistogramBase::kUmaTargetedHistogramFlag)
179 ->Add(clamped_disk_space_k_bytes); 179 ->Add(clamped_disk_space_k_bytes);
180 return clamped_disk_space_k_bytes; 180 return clamped_disk_space_k_bytes;
181 } 181 }
182 182
183 static void ParseAndHistogramIOErrorDetails(const std::string& histogram_name, 183 static void ParseAndHistogramIOErrorDetails(const std::string& histogram_name,
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 const leveldb::Slice start_slice = MakeSlice(start); 429 const leveldb::Slice start_slice = MakeSlice(start);
430 const leveldb::Slice stop_slice = MakeSlice(stop); 430 const leveldb::Slice stop_slice = MakeSlice(stop);
431 // NULL batch means just wait for earlier writes to be done 431 // NULL batch means just wait for earlier writes to be done
432 db_->Write(leveldb::WriteOptions(), NULL); 432 db_->Write(leveldb::WriteOptions(), NULL);
433 db_->CompactRange(&start_slice, &stop_slice); 433 db_->CompactRange(&start_slice, &stop_slice);
434 } 434 }
435 435
436 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } 436 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); }
437 437
438 } // namespace content 438 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_leveldb_coding.cc ('k') | content/browser/power_profiler/power_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698