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

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

Issue 508733002: Remove implicit conversions from scoped_refptr to T* in net/disk_cache/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | net/disk_cache/cache_creator.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/index_table_v3.h" 5 #include "net/disk_cache/blockfile/index_table_v3.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 void IndexTable::OnBackupTimer() { 779 void IndexTable::OnBackupTimer() {
780 if (!modified_) 780 if (!modified_)
781 return; 781 return;
782 782
783 int num_words = (header_->table_len + 31) / 32; 783 int num_words = (header_->table_len + 31) / 32;
784 int num_bytes = num_words * 4 + static_cast<int>(sizeof(*header_)); 784 int num_bytes = num_words * 4 + static_cast<int>(sizeof(*header_));
785 scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(num_bytes)); 785 scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(num_bytes));
786 memcpy(buffer->data(), header_, sizeof(*header_)); 786 memcpy(buffer->data(), header_, sizeof(*header_));
787 memcpy(buffer->data() + sizeof(*header_), backup_bitmap_storage_.get(), 787 memcpy(buffer->data() + sizeof(*header_), backup_bitmap_storage_.get(),
788 num_words * 4); 788 num_words * 4);
789 backend_->SaveIndex(buffer, num_bytes); 789 backend_->SaveIndex(buffer.get(), num_bytes);
790 modified_ = false; 790 modified_ = false;
791 } 791 }
792 792
793 // ----------------------------------------------------------------------- 793 // -----------------------------------------------------------------------
794 794
795 EntryCell IndexTable::FindEntryCellImpl(uint32 hash, Addr address, 795 EntryCell IndexTable::FindEntryCellImpl(uint32 hash, Addr address,
796 bool allow_deleted) { 796 bool allow_deleted) {
797 int bucket_num = static_cast<int>(hash & mask_); 797 int bucket_num = static_cast<int>(hash & mask_);
798 IndexBucket* bucket = &main_table_[bucket_num]; 798 IndexBucket* bucket = &main_table_[bucket_num];
799 do { 799 do {
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 bool IndexTable::MisplacedHash(const IndexCell& cell, uint32 hash) { 1140 bool IndexTable::MisplacedHash(const IndexCell& cell, uint32 hash) {
1141 if (!extra_bits_) 1141 if (!extra_bits_)
1142 return false; 1142 return false;
1143 1143
1144 uint32 mask = (1 << extra_bits_) - 1; 1144 uint32 mask = (1 << extra_bits_) - 1;
1145 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift; 1145 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift;
1146 return (GetHashValue(cell) & mask) != (hash & mask); 1146 return (GetHashValue(cell) & mask) != (hash & mask);
1147 } 1147 }
1148 1148
1149 } // namespace disk_cache 1149 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/cache_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698