| 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   if (node_.Data()->pointer && !node_.Data()->dirty) | 
|  | 543     return true; | 
|  | 544 | 
| 542   return node_.Data()->dirty && current_id != node_.Data()->dirty; | 545   return node_.Data()->dirty && current_id != node_.Data()->dirty; | 
| 543 } | 546 } | 
| 544 | 547 | 
| 545 void EntryImpl::ClearDirtyFlag() { | 548 void EntryImpl::ClearDirtyFlag() { | 
| 546   node_.Data()->dirty = 0; | 549   node_.Data()->dirty = 0; | 
| 547 } | 550 } | 
| 548 | 551 | 
| 549 void EntryImpl::SetPointerForInvalidEntry(int32 new_id) { | 552 void EntryImpl::SetPointerForInvalidEntry(int32 new_id) { | 
| 550   node_.Data()->dirty = new_id; | 553   node_.Data()->dirty = new_id; | 
| 551   node_.Data()->pointer = this; | 554   node_.Data()->pointer = this; | 
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 853   Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 856   Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 
| 854         entry_.address().value(), node_.address().value()); | 857         entry_.address().value(), node_.address().value()); | 
| 855 | 858 | 
| 856   Trace("  data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 859   Trace("  data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 
| 857         entry_.Data()->data_addr[1], entry_.Data()->long_key); | 860         entry_.Data()->data_addr[1], entry_.Data()->long_key); | 
| 858 | 861 | 
| 859   Trace("  doomed: %d 0x%p 0x%x", doomed_, pointer, dirty); | 862   Trace("  doomed: %d 0x%p 0x%x", doomed_, pointer, dirty); | 
| 860 } | 863 } | 
| 861 | 864 | 
| 862 }  // namespace disk_cache | 865 }  // namespace disk_cache | 
| OLD | NEW | 
|---|