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

Side by Side Diff: net/disk_cache/blockfile/backend_impl_v3.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply 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
« no previous file with comments | « net/disk_cache/blockfile/backend_impl.cc ('k') | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/disk_cache/blockfile/backend_impl_v3.h" 5 #include "net/disk_cache/blockfile/backend_impl_v3.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 DCHECK(!init_); 84 DCHECK(!init_);
85 if (init_) 85 if (init_)
86 return net::ERR_FAILED; 86 return net::ERR_FAILED;
87 87
88 return net::ERR_IO_PENDING; 88 return net::ERR_IO_PENDING;
89 } 89 }
90 90
91 // ------------------------------------------------------------------------ 91 // ------------------------------------------------------------------------
92 92
93 bool BackendImplV3::SetMaxSize(int max_bytes) { 93 bool BackendImplV3::SetMaxSize(int max_bytes) {
94 COMPILE_ASSERT(sizeof(max_bytes) == sizeof(max_size_), unsupported_int_model); 94 static_assert(sizeof(max_bytes) == sizeof(max_size_),
95 "unsupported int model");
95 if (max_bytes < 0) 96 if (max_bytes < 0)
96 return false; 97 return false;
97 98
98 // Zero size means use the default. 99 // Zero size means use the default.
99 if (!max_bytes) 100 if (!max_bytes)
100 return true; 101 return true;
101 102
102 // Avoid a DCHECK later on. 103 // Avoid a DCHECK later on.
103 if (max_bytes >= kint32max - kint32max / 10) 104 if (max_bytes >= kint32max - kint32max / 10)
104 max_bytes = kint32max - kint32max / 10 - 1; 105 max_bytes = kint32max - kint32max / 10 - 1;
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 } 1526 }
1526 1527
1527 void BackendImplV3::OnExternalCacheHit(const std::string& key) { 1528 void BackendImplV3::OnExternalCacheHit(const std::string& key) {
1528 NOTIMPLEMENTED(); 1529 NOTIMPLEMENTED();
1529 } 1530 }
1530 1531
1531 void BackendImplV3::CleanupCache() { 1532 void BackendImplV3::CleanupCache() {
1532 } 1533 }
1533 1534
1534 } // namespace disk_cache 1535 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/backend_impl.cc ('k') | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698