diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 18:53:02 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 18:53:02 +0000 |
commit | 9eb8cdff6c4e93d2609ee9a12cbd6b3dfa8b7d7f (patch) | |
tree | a3024687f2041d1f464aeb073d289c1bb7daae74 /net/disk_cache/mem_entry_impl.h | |
parent | d767b2c624529faef3bf78230f8873e91b244868 (diff) | |
download | chromium_src-9eb8cdff6c4e93d2609ee9a12cbd6b3dfa8b7d7f.zip chromium_src-9eb8cdff6c4e93d2609ee9a12cbd6b3dfa8b7d7f.tar.gz chromium_src-9eb8cdff6c4e93d2609ee9a12cbd6b3dfa8b7d7f.tar.bz2 |
Adds memory cache logging, and updates disk cache logging.
Memory and disk cache use the same set of events, with the same parameters (Though the disk cache has a couple events the memory cache does not). Most disk cache events were renamed so as to no longer imply a connection to the disk cache, and all disk cache-related NetLog parameter class definitions were moved to a new file, since they're shared by both entry type.
BUG=59382
TEST=none
Review URL: http://codereview.chromium.org/6613027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/mem_entry_impl.h')
-rw-r--r-- | net/disk_cache/mem_entry_impl.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/net/disk_cache/mem_entry_impl.h b/net/disk_cache/mem_entry_impl.h index f4ac4ef..f195b75 100644 --- a/net/disk_cache/mem_entry_impl.h +++ b/net/disk_cache/mem_entry_impl.h @@ -8,6 +8,7 @@ #include "base/hash_tables.h" #include "base/scoped_ptr.h" +#include "net/base/net_log.h" #include "net/disk_cache/disk_cache.h" #include "testing/gtest/include/gtest/gtest_prod.h" @@ -54,7 +55,7 @@ class MemEntryImpl : public Entry { // Performs the initialization of a EntryImpl that will be added to the // cache. - bool CreateEntry(const std::string& key); + bool CreateEntry(const std::string& key, net::NetLog* net_log); // Permanently destroys this entry. void InternalDoom(); @@ -82,6 +83,14 @@ class MemEntryImpl : public Entry { return parent_ ? kChildEntry : kParentEntry; } + std::string& key() { + return key_; + } + + net::BoundNetLog& net_log() { + return net_log_; + } + // Entry interface. virtual void Doom(); virtual void Close(); @@ -113,6 +122,14 @@ class MemEntryImpl : public Entry { ~MemEntryImpl(); + // Do all the work for corresponding public functions. Implemented as + // separate functions to make logging of results simpler. + int InternalReadData(int index, int offset, net::IOBuffer* buf, int buf_len); + int InternalWriteData(int index, int offset, net::IOBuffer* buf, int buf_len, + bool truncate); + int InternalReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len); + int InternalWriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len); + // Old Entry interface. int GetAvailableRange(int64 offset, int len, int64* start); @@ -129,7 +146,7 @@ class MemEntryImpl : public Entry { // Performs the initialization of a MemEntryImpl as a child entry. // |parent| is the pointer to the parent entry. |child_id| is the ID of // the new child. - bool InitChildEntry(MemEntryImpl* parent, int child_id); + bool InitChildEntry(MemEntryImpl* parent, int child_id, net::NetLog* net_log); // Returns an entry responsible for |offset|. The returned entry can be a // child entry or this entry itself if |offset| points to the first range. @@ -163,6 +180,8 @@ class MemEntryImpl : public Entry { MemBackendImpl* backend_; // Back pointer to the cache. bool doomed_; // True if this entry was removed from the cache. + net::BoundNetLog net_log_; + DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); }; |