| 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/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 "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/disk_cache/mem_backend_impl.h" | 10 #include "net/disk_cache/mem_backend_impl.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // If the next child is discontinuous, break the loop. | 312 // If the next child is discontinuous, break the loop. |
| 313 if (FindNextChild(*start + continuous, len, ¤t_child)) | 313 if (FindNextChild(*start + continuous, len, ¤t_child)) |
| 314 break; | 314 break; |
| 315 } | 315 } |
| 316 return continuous; | 316 return continuous; |
| 317 } | 317 } |
| 318 *start = offset; | 318 *start = offset; |
| 319 return 0; | 319 return 0; |
| 320 } | 320 } |
| 321 | 321 |
| 322 int MemEntryImpl::ReadyForSparseIO( |
| 323 net::CompletionCallback* completion_callback) { |
| 324 return net::OK; |
| 325 } |
| 326 |
| 322 // ------------------------------------------------------------------------ | 327 // ------------------------------------------------------------------------ |
| 323 | 328 |
| 324 bool MemEntryImpl::CreateEntry(const std::string& key) { | 329 bool MemEntryImpl::CreateEntry(const std::string& key) { |
| 325 key_ = key; | 330 key_ = key; |
| 326 last_modified_ = Time::Now(); | 331 last_modified_ = Time::Now(); |
| 327 last_used_ = Time::Now(); | 332 last_used_ = Time::Now(); |
| 328 Open(); | 333 Open(); |
| 329 backend_->ModifyStorageSize(0, static_cast<int32>(key.size())); | 334 backend_->ModifyStorageSize(0, static_cast<int32>(key.size())); |
| 330 return true; | 335 return true; |
| 331 } | 336 } |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 scanned_len += kMaxSparseEntrySize - current_child_offset; | 485 scanned_len += kMaxSparseEntrySize - current_child_offset; |
| 481 } | 486 } |
| 482 return scanned_len; | 487 return scanned_len; |
| 483 } | 488 } |
| 484 | 489 |
| 485 void MemEntryImpl::DetachChild(int child_id) { | 490 void MemEntryImpl::DetachChild(int child_id) { |
| 486 children_->erase(child_id); | 491 children_->erase(child_id); |
| 487 } | 492 } |
| 488 | 493 |
| 489 } // namespace disk_cache | 494 } // namespace disk_cache |
| OLD | NEW |