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

Unified Diff: net/disk_cache/mem_entry_impl.h

Issue 6613027: Adds memory cache logging, and updates disk cache logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Oops Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/mem_entry_impl.h
===================================================================
--- net/disk_cache/mem_entry_impl.h (revision 78400)
+++ net/disk_cache/mem_entry_impl.h (working copy)
@@ -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 @@
// 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 @@
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 @@
~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 @@
// 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 @@
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);
};
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698