| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/entry_impl.h" | 5 #include "net/disk_cache/entry_impl.h" |
| 6 | 6 |
| 7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 if (!entry->rankings()->Store()) { | 532 if (!entry->rankings()->Store()) { |
| 533 entry->Release(); | 533 entry->Release(); |
| 534 return NULL; | 534 return NULL; |
| 535 } | 535 } |
| 536 return entry; | 536 return entry; |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool EntryImpl::IsDirty(int32 current_id) { | 540 bool EntryImpl::IsDirty(int32 current_id) { |
| 541 DCHECK(node_.HasData()); | 541 DCHECK(node_.HasData()); |
| 542 // We are checking if the entry is valid or not. If there is a pointer here, |
| 543 // |dirty| has to be the id of the cache that is using the entry (the one |
| 544 // that created the pointer), 0 is not a valid id. |
| 542 if (node_.Data()->pointer && !node_.Data()->dirty) | 545 if (node_.Data()->pointer && !node_.Data()->dirty) |
| 543 return true; | 546 return true; |
| 544 | 547 |
| 545 return node_.Data()->dirty && current_id != node_.Data()->dirty; | 548 return node_.Data()->dirty && current_id != node_.Data()->dirty; |
| 546 } | 549 } |
| 547 | 550 |
| 548 void EntryImpl::ClearDirtyFlag() { | 551 void EntryImpl::ClearDirtyFlag() { |
| 549 node_.Data()->dirty = 0; | 552 node_.Data()->dirty = 0; |
| 550 } | 553 } |
| 551 | 554 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 859 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), |
| 857 entry_.address().value(), node_.address().value()); | 860 entry_.address().value(), node_.address().value()); |
| 858 | 861 |
| 859 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 862 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], |
| 860 entry_.Data()->data_addr[1], entry_.Data()->long_key); | 863 entry_.Data()->data_addr[1], entry_.Data()->long_key); |
| 861 | 864 |
| 862 Trace(" doomed: %d 0x%p 0x%x", doomed_, pointer, dirty); | 865 Trace(" doomed: %d 0x%p 0x%x", doomed_, pointer, dirty); |
| 863 } | 866 } |
| 864 | 867 |
| 865 } // namespace disk_cache | 868 } // namespace disk_cache |
| OLD | NEW |