diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 23:46:58 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 23:46:58 +0000 |
commit | 84d4ceeee6546783aff920ba0625c0ce01f624ef (patch) | |
tree | 502d43daabfcabfc08a8b5b24cf302ddbe265cfa /net/disk_cache/entry_impl.h | |
parent | a8c1a314d8277b7ce4f701ce73957146e61a215f (diff) | |
download | chromium_src-84d4ceeee6546783aff920ba0625c0ce01f624ef.zip chromium_src-84d4ceeee6546783aff920ba0625c0ce01f624ef.tar.gz chromium_src-84d4ceeee6546783aff920ba0625c0ce01f624ef.tar.bz2 |
Disk cache: First pass to add support for sparse entries.
Adding Read/Write support.
BUG=12258
TEST=unittests.
original review: http://codereview.chromium.org/126179
Review URL: http://codereview.chromium.org/132031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.h')
-rw-r--r-- | net/disk_cache/entry_impl.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h index 72b38cb..00f44db 100644 --- a/net/disk_cache/entry_impl.h +++ b/net/disk_cache/entry_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,11 +13,13 @@ namespace disk_cache { class BackendImpl; +class SparseControl; // This class implements the Entry interface. An object of this // class represents a single entry on the cache. class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { friend class base::RefCounted<EntryImpl>; + friend class SparseControl; public: EntryImpl(BackendImpl* backend, Addr address); @@ -98,9 +100,9 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { void SetTimes(base::Time last_used, base::Time last_modified); private: - enum { - NUM_STREAMS = 3 - }; + enum { + NUM_STREAMS = 3 + }; ~EntryImpl(); @@ -138,6 +140,9 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { // Flush the in-memory data to the backing storage. bool Flush(int index, int size, bool async); + // Initializes the sparse control object. Returns a net error code. + int InitSparseData(); + // Logs this entry to the internal trace buffer. void Log(const char* msg); @@ -149,6 +154,8 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { // data and key. int unreported_size_[NUM_STREAMS]; // Bytes not reported yet to the backend. bool doomed_; // True if this entry was removed from the cache. + scoped_ptr<SparseControl> sparse_; // Support for sparse entries. + DISALLOW_EVIL_CONSTRUCTORS(EntryImpl); }; |