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

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

Issue 8387058: Disk Cache: Remove "invalidating iterator" message from (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/rankings.h" 5 #include "net/disk_cache/rankings.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "net/disk_cache/backend_impl.h" 8 #include "net/disk_cache/backend_impl.h"
9 #include "net/disk_cache/entry_impl.h" 9 #include "net/disk_cache/entry_impl.h"
10 #include "net/disk_cache/errors.h" 10 #include "net/disk_cache/errors.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 *other->Data() = *node->Data(); 858 *other->Data() = *node->Data();
859 } 859 }
860 } 860 }
861 } 861 }
862 862
863 void Rankings::InvalidateIterators(CacheRankingsBlock* node) { 863 void Rankings::InvalidateIterators(CacheRankingsBlock* node) {
864 CacheAddr address = node->address().value(); 864 CacheAddr address = node->address().value();
865 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end(); 865 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end();
866 ++it) { 866 ++it) {
867 if (it->first == address) { 867 if (it->first == address) {
868 LOG(WARNING) << "Invalidating iterator at 0x" << std::hex << address; 868 DLOG(INFO) << "Invalidating iterator at 0x" << std::hex << address;
869 it->second->Discard(); 869 it->second->Discard();
870 } 870 }
871 } 871 }
872 } 872 }
873 873
874 void Rankings::IncrementCounter(List list) { 874 void Rankings::IncrementCounter(List list) {
875 if (!count_lists_) 875 if (!count_lists_)
876 return; 876 return;
877 877
878 DCHECK(control_data_->sizes[list] < kint32max); 878 DCHECK(control_data_->sizes[list] < kint32max);
879 if (control_data_->sizes[list] < kint32max) 879 if (control_data_->sizes[list] < kint32max)
880 control_data_->sizes[list]++; 880 control_data_->sizes[list]++;
881 } 881 }
882 882
883 void Rankings::DecrementCounter(List list) { 883 void Rankings::DecrementCounter(List list) {
884 if (!count_lists_) 884 if (!count_lists_)
885 return; 885 return;
886 886
887 DCHECK(control_data_->sizes[list] > 0); 887 DCHECK(control_data_->sizes[list] > 0);
888 if (control_data_->sizes[list] > 0) 888 if (control_data_->sizes[list] > 0)
889 control_data_->sizes[list]--; 889 control_data_->sizes[list]--;
890 } 890 }
891 891
892 } // namespace disk_cache 892 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698