Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: net/disk_cache/entry_impl.cc

Issue 119072: Disk cache: Interface for the sparse cache support.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 if (io_callback && completed) 346 if (io_callback && completed)
347 io_callback->Discard(); 347 io_callback->Discard();
348 348
349 if (backend_->cache_type() == net::DISK_CACHE) 349 if (backend_->cache_type() == net::DISK_CACHE)
350 stats.AddTime(Time::Now() - start); 350 stats.AddTime(Time::Now() - start);
351 return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING; 351 return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING;
352 } 352 }
353 353
354 int EntryImpl::ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
355 net::CompletionCallback* completion_callback) {
356 return net::ERR_CACHE_OPERATION_NOT_SUPPORTED;
357 }
358
359 int EntryImpl::WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
360 net::CompletionCallback* completion_callback) {
361 return net::ERR_CACHE_OPERATION_NOT_SUPPORTED;
362 }
363
364 int EntryImpl::GetAvailableRange(int64 offset, int len, int64* start) {
365 return net::ERR_CACHE_OPERATION_NOT_SUPPORTED;
366 }
367
354 uint32 EntryImpl::GetHash() { 368 uint32 EntryImpl::GetHash() {
355 return entry_.Data()->hash; 369 return entry_.Data()->hash;
356 } 370 }
357 371
358 bool EntryImpl::CreateEntry(Addr node_address, const std::string& key, 372 bool EntryImpl::CreateEntry(Addr node_address, const std::string& key,
359 uint32 hash) { 373 uint32 hash) {
360 Trace("Create entry In"); 374 Trace("Create entry In");
361 EntryStore* entry_store = entry_.Data(); 375 EntryStore* entry_store = entry_.Data();
362 RankingsNode* node = node_.Data(); 376 RankingsNode* node = node_.Data();
363 memset(entry_store, 0, sizeof(EntryStore) * entry_.address().num_blocks()); 377 memset(entry_store, 0, sizeof(EntryStore) * entry_.address().num_blocks());
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), 824 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this),
811 entry_.address().value(), node_.address().value()); 825 entry_.address().value(), node_.address().value());
812 826
813 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], 827 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0],
814 entry_.Data()->data_addr[1], entry_.Data()->long_key); 828 entry_.Data()->data_addr[1], entry_.Data()->long_key);
815 829
816 Trace(" doomed: %d 0x%p 0x%x", doomed_, pointer, dirty); 830 Trace(" doomed: %d 0x%p 0x%x", doomed_, pointer, dirty);
817 } 831 }
818 832
819 } // namespace disk_cache 833 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698