summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.h
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 17:26:13 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 17:26:13 +0000
commitd60c79650e1be14bb75b25362b2eadd0c76b48ba (patch)
tree13c7de9cd16935bd495a963ae04df2778d12fa04 /net/disk_cache/backend_impl.h
parentc0918c5df71848044da5e6268270fe2d640ab0bc (diff)
downloadchromium_src-d60c79650e1be14bb75b25362b2eadd0c76b48ba.zip
chromium_src-d60c79650e1be14bb75b25362b2eadd0c76b48ba.tar.gz
chromium_src-d60c79650e1be14bb75b25362b2eadd0c76b48ba.tar.bz2
First pass at adding http/backend cache events to the NetLog.
Adds sources and events for ActiveCacheEntry and EntryImpl objects, as well as adding cache read/write events to HttpCacheTransactions. Most new read/write events are only logged when NetLog logging mode is set to log all events. Also, net-internals now merges begin and end events that have parameters, as long as only one of them has parameters. I think this increases readability, at the cost of making it a little more difficult to follow timings with just the "st" values. BUG=59382 TEST=none yet, other than updates to existing tests. Review URL: http://codereview.chromium.org/4067002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70618 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.h')
-rw-r--r--net/disk_cache/backend_impl.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h
index 5637fbd..b481525 100644
--- a/net/disk_cache/backend_impl.h
+++ b/net/disk_cache/backend_impl.h
@@ -19,6 +19,10 @@
#include "net/disk_cache/stats.h"
#include "net/disk_cache/trace.h"
+namespace net {
+class NetLog;
+} // namespace net
+
namespace disk_cache {
enum BackendFlags {
@@ -38,10 +42,11 @@ enum BackendFlags {
class BackendImpl : public Backend {
friend class Eviction;
public:
- BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread);
+ BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread,
+ net::NetLog* net_log);
// mask can be used to limit the usable size of the hash table, for testing.
BackendImpl(const FilePath& path, uint32 mask,
- base::MessageLoopProxy* cache_thread);
+ base::MessageLoopProxy* cache_thread, net::NetLog* net_log);
~BackendImpl();
// Returns a new backend with the desired flags. See the declaration of
@@ -49,7 +54,8 @@ class BackendImpl : public Backend {
static int CreateBackend(const FilePath& full_path, bool force,
int max_bytes, net::CacheType type,
uint32 flags, base::MessageLoopProxy* thread,
- Backend** backend, CompletionCallback* callback);
+ net::NetLog* net_log, Backend** backend,
+ CompletionCallback* callback);
// Performs general initialization for this current instance of the cache.
int Init(CompletionCallback* callback);
@@ -357,6 +363,8 @@ class BackendImpl : public Backend {
bool first_timer_; // True if the timer has not been called.
bool throttle_requests_;
+ net::NetLog* net_log_;
+
Stats stats_; // Usage statistcs.
base::RepeatingTimer<BackendImpl> timer_; // Usage timer.
base::WaitableEvent done_; // Signals the end of background work.