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

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

Issue 8832006: Reverts a commit that caused ASAN failures, and 2 dependent commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/mem_backend_impl.h ('k') | net/disk_cache/mem_entry_impl.h » ('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) 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/mem_backend_impl.h" 5 #include "net/disk_cache/mem_backend_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/disk_cache/cache_util.h" 10 #include "net/disk_cache/cache_util.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 int MemBackendImpl::OpenEntry(const std::string& key, Entry** entry, 131 int MemBackendImpl::OpenEntry(const std::string& key, Entry** entry,
132 OldCompletionCallback* callback) { 132 OldCompletionCallback* callback) {
133 if (OpenEntry(key, entry)) 133 if (OpenEntry(key, entry))
134 return net::OK; 134 return net::OK;
135 135
136 return net::ERR_FAILED; 136 return net::ERR_FAILED;
137 } 137 }
138 138
139 int MemBackendImpl::OpenEntry(const std::string& key, Entry** entry,
140 const net::CompletionCallback& callback) {
141 if (OpenEntry(key, entry))
142 return net::OK;
143
144 return net::ERR_FAILED;
145 }
146
147 int MemBackendImpl::CreateEntry(const std::string& key, Entry** entry, 139 int MemBackendImpl::CreateEntry(const std::string& key, Entry** entry,
148 OldCompletionCallback* callback) { 140 OldCompletionCallback* callback) {
149 if (CreateEntry(key, entry)) 141 if (CreateEntry(key, entry))
150 return net::OK; 142 return net::OK;
151 143
152 return net::ERR_FAILED; 144 return net::ERR_FAILED;
153 } 145 }
154 146
155 int MemBackendImpl::CreateEntry(const std::string& key, Entry** entry,
156 const net::CompletionCallback& callback) {
157 if (CreateEntry(key, entry))
158 return net::OK;
159
160 return net::ERR_FAILED;
161 }
162
163 int MemBackendImpl::DoomEntry(const std::string& key, 147 int MemBackendImpl::DoomEntry(const std::string& key,
164 OldCompletionCallback* callback) { 148 OldCompletionCallback* callback) {
165 if (DoomEntry(key)) 149 if (DoomEntry(key))
166 return net::OK; 150 return net::OK;
167 151
168 return net::ERR_FAILED; 152 return net::ERR_FAILED;
169 } 153 }
170 154
171 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) { 155 int MemBackendImpl::DoomAllEntries(OldCompletionCallback* callback) {
172 if (DoomAllEntries()) 156 if (DoomAllEntries())
173 return net::OK; 157 return net::OK;
174 158
175 return net::ERR_FAILED; 159 return net::ERR_FAILED;
176 } 160 }
177 161
178 int MemBackendImpl::DoomAllEntries(const net::CompletionCallback& callback) {
179 if (DoomAllEntries())
180 return net::OK;
181
182 return net::ERR_FAILED;
183 }
184
185 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time, 162 int MemBackendImpl::DoomEntriesBetween(const base::Time initial_time,
186 const base::Time end_time, 163 const base::Time end_time,
187 OldCompletionCallback* callback) { 164 OldCompletionCallback* callback) {
188 if (DoomEntriesBetween(initial_time, end_time)) 165 if (DoomEntriesBetween(initial_time, end_time))
189 return net::OK; 166 return net::OK;
190 167
191 return net::ERR_FAILED; 168 return net::ERR_FAILED;
192 } 169 }
193 170
194 int MemBackendImpl::DoomEntriesBetween(
195 const base::Time initial_time, const base::Time end_time,
196 const net::CompletionCallback& callback) {
197 if (DoomEntriesBetween(initial_time, end_time))
198 return net::OK;
199
200 return net::ERR_FAILED;
201 }
202
203 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time, 171 int MemBackendImpl::DoomEntriesSince(const base::Time initial_time,
204 OldCompletionCallback* callback) { 172 OldCompletionCallback* callback) {
205 if (DoomEntriesSince(initial_time)) 173 if (DoomEntriesSince(initial_time))
206 return net::OK; 174 return net::OK;
207 175
208 return net::ERR_FAILED; 176 return net::ERR_FAILED;
209 } 177 }
210 178
211 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, 179 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
212 OldCompletionCallback* callback) { 180 OldCompletionCallback* callback) {
213 if (OpenNextEntry(iter, next_entry)) 181 if (OpenNextEntry(iter, next_entry))
214 return net::OK; 182 return net::OK;
215 183
216 return net::ERR_FAILED; 184 return net::ERR_FAILED;
217 } 185 }
218 186
219 int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
220 const net::CompletionCallback& callback) {
221 if (OpenNextEntry(iter, next_entry))
222 return net::OK;
223
224 return net::ERR_FAILED;
225 }
226
227 void MemBackendImpl::EndEnumeration(void** iter) { 187 void MemBackendImpl::EndEnumeration(void** iter) {
228 *iter = NULL; 188 *iter = NULL;
229 } 189 }
230 190
231 void MemBackendImpl::OnExternalCacheHit(const std::string& key) { 191 void MemBackendImpl::OnExternalCacheHit(const std::string& key) {
232 EntryMap::iterator it = entries_.find(key); 192 EntryMap::iterator it = entries_.find(key);
233 if (it != entries_.end()) { 193 if (it != entries_.end()) {
234 UpdateRank(it->second); 194 UpdateRank(it->second);
235 } 195 }
236 } 196 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (current_size_ > max_size_) 318 if (current_size_ > max_size_)
359 TrimCache(false); 319 TrimCache(false);
360 } 320 }
361 321
362 void MemBackendImpl::SubstractStorageSize(int32 bytes) { 322 void MemBackendImpl::SubstractStorageSize(int32 bytes) {
363 current_size_ -= bytes; 323 current_size_ -= bytes;
364 DCHECK_GE(current_size_, 0); 324 DCHECK_GE(current_size_, 0);
365 } 325 }
366 326
367 } // namespace disk_cache 327 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/mem_backend_impl.h ('k') | net/disk_cache/mem_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698