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

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

Issue 9702059: Disk cache: Remove all non essential synchronization from the cache destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
« net/disk_cache/file.h ('K') | « net/disk_cache/storage_block.h ('k') | 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) 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 #pragma once 7 #pragma once
8 8
9 #include "net/disk_cache/storage_block.h" 9 #include "net/disk_cache/storage_block.h"
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return; 82 return;
83 DCHECK(!modified_); 83 DCHECK(!modified_);
84 data_ = NULL; 84 data_ = NULL;
85 } 85 }
86 86
87 template<typename T> void StorageBlock<T>::set_modified() { 87 template<typename T> void StorageBlock<T>::set_modified() {
88 DCHECK(data_); 88 DCHECK(data_);
89 modified_ = true; 89 modified_ = true;
90 } 90 }
91 91
92 template<typename T> void StorageBlock<T>::clear_modified() {
93 modified_ = false;
94 }
95
92 template<typename T> T* StorageBlock<T>::Data() { 96 template<typename T> T* StorageBlock<T>::Data() {
93 if (!data_) 97 if (!data_)
94 AllocateData(); 98 AllocateData();
95 return data_; 99 return data_;
96 } 100 }
97 101
98 template<typename T> bool StorageBlock<T>::HasData() const { 102 template<typename T> bool StorageBlock<T>::HasData() const {
99 return (NULL != data_); 103 return (NULL != data_);
100 } 104 }
101 105
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 167 }
164 } 168 }
165 169
166 template<typename T> uint32 StorageBlock<T>::CalculateHash() const { 170 template<typename T> uint32 StorageBlock<T>::CalculateHash() const {
167 return Hash(reinterpret_cast<char*>(data_), offsetof(T, self_hash)); 171 return Hash(reinterpret_cast<char*>(data_), offsetof(T, self_hash));
168 } 172 }
169 173
170 } // namespace disk_cache 174 } // namespace disk_cache
171 175
172 #endif // NET_DISK_CACHE_STORAGE_BLOCK_INL_H_ 176 #endif // NET_DISK_CACHE_STORAGE_BLOCK_INL_H_
OLDNEW
« net/disk_cache/file.h ('K') | « net/disk_cache/storage_block.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698