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

Side by Side Diff: net/disk_cache/storage_block-inl.h

Issue 10920026: Move hash.h/cc from net/disk_cache to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan, rvargas feedback Created 8 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/hash.cc ('k') | net/net.gyp » ('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 #ifndef NET_DISK_CACHE_STORAGE_BLOCK_INL_H_ 5 #ifndef NET_DISK_CACHE_STORAGE_BLOCK_INL_H_
6 #define NET_DISK_CACHE_STORAGE_BLOCK_INL_H_ 6 #define NET_DISK_CACHE_STORAGE_BLOCK_INL_H_
7 7
8 #include "net/disk_cache/storage_block.h" 8 #include "net/disk_cache/storage_block.h"
9 9
10 #include "base/hash.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "net/disk_cache/hash.h"
12 #include "net/disk_cache/trace.h" 12 #include "net/disk_cache/trace.h"
13 13
14 namespace disk_cache { 14 namespace disk_cache {
15 15
16 template<typename T> StorageBlock<T>::StorageBlock(MappedFile* file, 16 template<typename T> StorageBlock<T>::StorageBlock(MappedFile* file,
17 Addr address) 17 Addr address)
18 : data_(NULL), file_(file), address_(address), modified_(false), 18 : data_(NULL), file_(file), address_(address), modified_(false),
19 own_data_(false), extended_(false) { 19 own_data_(false), extended_(false) {
20 if (address.num_blocks() > 1) 20 if (address.num_blocks() > 1)
21 extended_ = true; 21 extended_ = true;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 delete data_; 160 delete data_;
161 } else { 161 } else {
162 data_->~T(); 162 data_->~T();
163 delete[] reinterpret_cast<char*>(data_); 163 delete[] reinterpret_cast<char*>(data_);
164 } 164 }
165 own_data_ = false; 165 own_data_ = false;
166 } 166 }
167 } 167 }
168 168
169 template<typename T> uint32 StorageBlock<T>::CalculateHash() const { 169 template<typename T> uint32 StorageBlock<T>::CalculateHash() const {
170 return Hash(reinterpret_cast<char*>(data_), offsetof(T, self_hash)); 170 return base::Hash(reinterpret_cast<char*>(data_), offsetof(T, self_hash));
171 } 171 }
172 172
173 } // namespace disk_cache 173 } // namespace disk_cache
174 174
175 #endif // NET_DISK_CACHE_STORAGE_BLOCK_INL_H_ 175 #endif // NET_DISK_CACHE_STORAGE_BLOCK_INL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/hash.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698