OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |