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

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

Issue 7461106: Inform disk cache of WebKit memory cache hits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
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_entry_impl.h" 5 #include "net/disk_cache/mem_entry_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 bool MemEntryImpl::CouldBeSparse() const { 252 bool MemEntryImpl::CouldBeSparse() const {
253 DCHECK_EQ(kParentEntry, type()); 253 DCHECK_EQ(kParentEntry, type());
254 return (children_.get() != NULL); 254 return (children_.get() != NULL);
255 } 255 }
256 256
257 int MemEntryImpl::ReadyForSparseIO( 257 int MemEntryImpl::ReadyForSparseIO(
258 net::CompletionCallback* completion_callback) { 258 net::CompletionCallback* completion_callback) {
259 return net::OK; 259 return net::OK;
260 } 260 }
261 261
262 void MemEntryImpl::UpdateRankForExternalCacheHit() {
263 UpdateRank(false);
264 }
265
262 // ------------------------------------------------------------------------ 266 // ------------------------------------------------------------------------
263 267
264 MemEntryImpl::~MemEntryImpl() { 268 MemEntryImpl::~MemEntryImpl() {
265 for (int i = 0; i < NUM_STREAMS; i++) 269 for (int i = 0; i < NUM_STREAMS; i++)
266 backend_->ModifyStorageSize(data_size_[i], 0); 270 backend_->ModifyStorageSize(data_size_[i], 0);
267 backend_->ModifyStorageSize(static_cast<int32>(key_.size()), 0); 271 backend_->ModifyStorageSize(static_cast<int32>(key_.size()), 0);
268 net_log_.EndEvent(net::NetLog::TYPE_DISK_CACHE_MEM_ENTRY_IMPL, NULL); 272 net_log_.EndEvent(net::NetLog::TYPE_DISK_CACHE_MEM_ENTRY_IMPL, NULL);
269 } 273 }
270 274
271 int MemEntryImpl::InternalReadData(int index, int offset, net::IOBuffer* buf, 275 int MemEntryImpl::InternalReadData(int index, int offset, net::IOBuffer* buf,
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 scanned_len += kMaxSparseEntrySize - current_child_offset; 619 scanned_len += kMaxSparseEntrySize - current_child_offset;
616 } 620 }
617 return scanned_len; 621 return scanned_len;
618 } 622 }
619 623
620 void MemEntryImpl::DetachChild(int child_id) { 624 void MemEntryImpl::DetachChild(int child_id) {
621 children_->erase(child_id); 625 children_->erase(child_id);
622 } 626 }
623 627
624 } // namespace disk_cache 628 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698