OLD | NEW |
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 #include "net/disk_cache/memory/mem_entry_impl.h" | 5 #include "net/disk_cache/memory/mem_entry_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 : key_(key), | 263 : key_(key), |
264 ref_count_(0), | 264 ref_count_(0), |
265 child_id_(child_id), | 265 child_id_(child_id), |
266 child_first_pos_(0), | 266 child_first_pos_(0), |
267 parent_(parent), | 267 parent_(parent), |
268 last_modified_(Time::Now()), | 268 last_modified_(Time::Now()), |
269 last_used_(last_modified_), | 269 last_used_(last_modified_), |
270 backend_(backend), | 270 backend_(backend), |
271 doomed_(false) { | 271 doomed_(false) { |
272 backend_->OnEntryInserted(this); | 272 backend_->OnEntryInserted(this); |
273 net_log_ = net::BoundNetLog::Make(net_log, | 273 net_log_ = net::NetLogWithSource::Make( |
274 net::NetLogSourceType::MEMORY_CACHE_ENTRY); | 274 net_log, net::NetLogSourceType::MEMORY_CACHE_ENTRY); |
275 net_log_.BeginEvent(net::NetLogEventType::DISK_CACHE_MEM_ENTRY_IMPL, | 275 net_log_.BeginEvent(net::NetLogEventType::DISK_CACHE_MEM_ENTRY_IMPL, |
276 base::Bind(&NetLogEntryCreationCallback, this)); | 276 base::Bind(&NetLogEntryCreationCallback, this)); |
277 } | 277 } |
278 | 278 |
279 MemEntryImpl::~MemEntryImpl() { | 279 MemEntryImpl::~MemEntryImpl() { |
280 backend_->ModifyStorageSize(-GetStorageSize()); | 280 backend_->ModifyStorageSize(-GetStorageSize()); |
281 | 281 |
282 if (type() == PARENT_ENTRY) { | 282 if (type() == PARENT_ENTRY) { |
283 if (children_) { | 283 if (children_) { |
284 EntryMap children; | 284 EntryMap children; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 scanned_len += first_pos - current_child_offset; | 579 scanned_len += first_pos - current_child_offset; |
580 break; | 580 break; |
581 } | 581 } |
582 } | 582 } |
583 scanned_len += kMaxSparseEntrySize - current_child_offset; | 583 scanned_len += kMaxSparseEntrySize - current_child_offset; |
584 } | 584 } |
585 return scanned_len; | 585 return scanned_len; |
586 } | 586 } |
587 | 587 |
588 } // namespace disk_cache | 588 } // namespace disk_cache |
OLD | NEW |