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

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

Issue 1499423004: Remove kint32max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint9
Patch Set: rebase Created 5 years 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/index_table_v3.cc ('k') | net/disk_cache/cache_util.h » ('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/rankings.h" 5 #include "net/disk_cache/blockfile/rankings.h"
6 6
7 #include <stdint.h>
8
9 #include <limits>
10
7 #include "net/disk_cache/blockfile/backend_impl.h" 11 #include "net/disk_cache/blockfile/backend_impl.h"
8 #include "net/disk_cache/blockfile/disk_format.h" 12 #include "net/disk_cache/blockfile/disk_format.h"
9 #include "net/disk_cache/blockfile/entry_impl.h" 13 #include "net/disk_cache/blockfile/entry_impl.h"
10 #include "net/disk_cache/blockfile/errors.h" 14 #include "net/disk_cache/blockfile/errors.h"
11 #include "net/disk_cache/blockfile/histogram_macros.h" 15 #include "net/disk_cache/blockfile/histogram_macros.h"
12 #include "net/disk_cache/blockfile/stress_support.h" 16 #include "net/disk_cache/blockfile/stress_support.h"
13 17
14 // Provide a BackendImpl object to macros from histogram_macros.h. 18 // Provide a BackendImpl object to macros from histogram_macros.h.
15 #define CACHE_UMA_BACKEND_IMPL_OBJ backend_ 19 #define CACHE_UMA_BACKEND_IMPL_OBJ backend_
16 20
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 ++it) { 904 ++it) {
901 if (it->first == address) 905 if (it->first == address)
902 it->second->Discard(); 906 it->second->Discard();
903 } 907 }
904 } 908 }
905 909
906 void Rankings::IncrementCounter(List list) { 910 void Rankings::IncrementCounter(List list) {
907 if (!count_lists_) 911 if (!count_lists_)
908 return; 912 return;
909 913
910 DCHECK(control_data_->sizes[list] < kint32max); 914 DCHECK(control_data_->sizes[list] < std::numeric_limits<int32_t>::max());
911 if (control_data_->sizes[list] < kint32max) 915 if (control_data_->sizes[list] < std::numeric_limits<int32_t>::max())
912 control_data_->sizes[list]++; 916 control_data_->sizes[list]++;
913 } 917 }
914 918
915 void Rankings::DecrementCounter(List list) { 919 void Rankings::DecrementCounter(List list) {
916 if (!count_lists_) 920 if (!count_lists_)
917 return; 921 return;
918 922
919 DCHECK(control_data_->sizes[list] > 0); 923 DCHECK(control_data_->sizes[list] > 0);
920 if (control_data_->sizes[list] > 0) 924 if (control_data_->sizes[list] > 0)
921 control_data_->sizes[list]--; 925 control_data_->sizes[list]--;
922 } 926 }
923 927
924 } // namespace disk_cache 928 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/index_table_v3.cc ('k') | net/disk_cache/cache_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698