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/rankings.cc

Issue 1910023002: Remove partial blockfile v3 disk_cache implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 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> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return false; 535 return false;
536 536
537 if ((node->address().value() == data->next) && !IsTail(data->next, &list)) 537 if ((node->address().value() == data->next) && !IsTail(data->next, &list))
538 return false; 538 return false;
539 539
540 if (!data->next && !data->prev) 540 if (!data->next && !data->prev)
541 return true; 541 return true;
542 542
543 Addr next_addr(data->next); 543 Addr next_addr(data->next);
544 Addr prev_addr(data->prev); 544 Addr prev_addr(data->prev);
545 if (!next_addr.SanityCheckV2() || next_addr.file_type() != RANKINGS || 545 if (!next_addr.SanityCheck() || next_addr.file_type() != RANKINGS ||
546 !prev_addr.SanityCheckV2() || prev_addr.file_type() != RANKINGS) 546 !prev_addr.SanityCheck() || prev_addr.file_type() != RANKINGS)
547 return false; 547 return false;
548 548
549 return true; 549 return true;
550 } 550 }
551 551
552 bool Rankings::DataSanityCheck(CacheRankingsBlock* node, bool from_list) const { 552 bool Rankings::DataSanityCheck(CacheRankingsBlock* node, bool from_list) const {
553 const RankingsNode* data = node->Data(); 553 const RankingsNode* data = node->Data();
554 if (!data->contents) 554 if (!data->contents)
555 return false; 555 return false;
556 556
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 void Rankings::DecrementCounter(List list) { 920 void Rankings::DecrementCounter(List list) {
921 if (!count_lists_) 921 if (!count_lists_)
922 return; 922 return;
923 923
924 DCHECK(control_data_->sizes[list] > 0); 924 DCHECK(control_data_->sizes[list] > 0);
925 if (control_data_->sizes[list] > 0) 925 if (control_data_->sizes[list] > 0)
926 control_data_->sizes[list]--; 926 control_data_->sizes[list]--;
927 } 927 }
928 928
929 } // namespace disk_cache 929 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/index_table_v3_unittest.cc ('k') | net/disk_cache/blockfile/sparse_control_v3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698