| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 } | 377 } |
| 378 | 378 |
| 379 int EntryImpl::GetAvailableRange(int64 offset, int len, int64* start) { | 379 int EntryImpl::GetAvailableRange(int64 offset, int len, int64* start) { |
| 380 int result = InitSparseData(); | 380 int result = InitSparseData(); |
| 381 if (net::OK != result) | 381 if (net::OK != result) |
| 382 return result; | 382 return result; |
| 383 | 383 |
| 384 return sparse_->GetAvailableRange(offset, len, start); | 384 return sparse_->GetAvailableRange(offset, len, start); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void EntryImpl::CancelSparseIO() { |
| 388 if (!sparse_.get()) |
| 389 return; |
| 390 |
| 391 sparse_->CancelIO(); |
| 392 } |
| 393 |
| 394 int EntryImpl::ReadyForSparseIO(net::CompletionCallback* completion_callback) { |
| 395 if (!sparse_.get()) |
| 396 return net::OK; |
| 397 |
| 398 return sparse_->ReadyToUse(completion_callback); |
| 399 } |
| 400 |
| 387 // ------------------------------------------------------------------------ | 401 // ------------------------------------------------------------------------ |
| 388 | 402 |
| 389 uint32 EntryImpl::GetHash() { | 403 uint32 EntryImpl::GetHash() { |
| 390 return entry_.Data()->hash; | 404 return entry_.Data()->hash; |
| 391 } | 405 } |
| 392 | 406 |
| 393 bool EntryImpl::CreateEntry(Addr node_address, const std::string& key, | 407 bool EntryImpl::CreateEntry(Addr node_address, const std::string& key, |
| 394 uint32 hash) { | 408 uint32 hash) { |
| 395 Trace("Create entry In"); | 409 Trace("Create entry In"); |
| 396 EntryStore* entry_store = entry_.Data(); | 410 EntryStore* entry_store = entry_.Data(); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), | 918 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), |
| 905 entry_.address().value(), node_.address().value()); | 919 entry_.address().value(), node_.address().value()); |
| 906 | 920 |
| 907 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], | 921 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], |
| 908 entry_.Data()->data_addr[1], entry_.Data()->long_key); | 922 entry_.Data()->data_addr[1], entry_.Data()->long_key); |
| 909 | 923 |
| 910 Trace(" doomed: %d 0x%x", doomed_, dirty); | 924 Trace(" doomed: %d 0x%x", doomed_, dirty); |
| 911 } | 925 } |
| 912 | 926 |
| 913 } // namespace disk_cache | 927 } // namespace disk_cache |
| OLD | NEW |