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

Unified Diff: net/http/http_cache.h

Issue 4067002: First pass at adding http/backend cache to NetLog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removing class I decided not to use Created 10 years 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
Index: net/http/http_cache.h
===================================================================
--- net/http/http_cache.h (revision 68857)
+++ net/http/http_cache.h (working copy)
@@ -30,6 +30,7 @@
#include "net/base/cache_type.h"
#include "net/base/completion_callback.h"
#include "net/base/load_states.h"
+#include "net/base/net_log.h"
#include "net/http/http_transaction_factory.h"
class GURL;
@@ -50,7 +51,6 @@
struct HttpRequestInfo;
class HttpResponseInfo;
class IOBuffer;
-class NetLog;
class ProxyService;
class SSLConfigService;
class ViewCacheHelper;
@@ -87,7 +87,8 @@
// The implementation must not access the factory object after invoking the
// |callback| because the object can be deleted from within the callback.
virtual int CreateBackend(disk_cache::Backend** backend,
- CompletionCallback* callback) = 0;
+ CompletionCallback* callback,
+ NetLog* net_log) = 0;
rvargas (doing something else) 2010/12/11 00:29:01 nit: this should be the first argument.
};
// A default backend factory for the common use cases.
@@ -105,7 +106,8 @@
// BackendFactory implementation.
virtual int CreateBackend(disk_cache::Backend** backend,
- CompletionCallback* callback);
+ CompletionCallback* callback,
+ NetLog* net_log);
private:
CacheType type_;
@@ -138,7 +140,8 @@
// by the HttpCache and will be destroyed using |delete| when the HttpCache is
// destroyed.
HttpCache(HttpTransactionFactory* network_layer,
- BackendFactory* backend_factory);
+ BackendFactory* backend_factory,
+ NetLog* net_log);
HttpTransactionFactory* network_layer() { return network_layer_.get(); }
@@ -212,8 +215,9 @@
TransactionList pending_queue;
bool will_process_pending_queue;
bool doomed;
+ BoundNetLog net_log;
rvargas (doing something else) 2010/12/11 00:29:01 I'm not convinced that making ActiveEntry a source
mmenke 2010/12/11 01:51:05 I wasn't sure if they were worth logging or not.
- explicit ActiveEntry(disk_cache::Entry*);
+ explicit ActiveEntry(disk_cache::Entry* entry, NetLog* net_log);
~ActiveEntry();
};
@@ -293,6 +297,11 @@
// one (in this case, the entry is no longer valid).
int AddTransactionToEntry(ActiveEntry* entry, Transaction* trans);
+ // Same as AddTransactionToEntry, except it does create a NetLog event for
+ // queuing the event. Used by OnProcessPendingQueue to prevent redundant
+ // logging.
+ int AddTransactionToEntryInternal(ActiveEntry* entry, Transaction* trans);
+
// Called when the transaction has finished working with this entry. |cancel|
// is true if the operation was cancelled by the caller instead of running
// to completion.
@@ -342,6 +351,8 @@
// Variables ----------------------------------------------------------------
+ NetLog* net_log_;
+
// Used when lazily constructing the disk_cache_.
scoped_ptr<BackendFactory> backend_factory_;
bool building_backend_;

Powered by Google App Engine
This is Rietveld 408576698