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

Unified Diff: net/base/network_delegate.h

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
Index: net/base/network_delegate.h
===================================================================
--- net/base/network_delegate.h (revision 147723)
+++ net/base/network_delegate.h (working copy)
@@ -48,6 +48,12 @@
};
typedef base::Callback<void(AuthRequiredResponse)> AuthCallback;
+ enum CacheWaitState {
+ CACHE_WAIT_STATE_START,
+ CACHE_WAIT_STATE_FINISH,
+ CACHE_WAIT_STATE_DONE
+ };
+
virtual ~NetworkDelegate() {}
// Notification interface called by the network stack. Note that these
@@ -90,6 +96,9 @@
int NotifyBeforeSocketStreamConnect(SocketStream* socket,
const CompletionCallback& callback);
+ void NotifyCacheWaitStateChange(const URLRequest& request,
+ CacheWaitState state);
+
private:
// This is the interface for subclasses of NetworkDelegate to implement. These
// member functions will be called by the respective public notification
@@ -214,6 +223,17 @@
// Called before a SocketStream tries to connect.
virtual int OnBeforeSocketStreamConnect(
SocketStream* socket, const CompletionCallback& callback) = 0;
+
+ // Called when the completion of a URLRequest is blocking on a cache
+ // transaction (CACHE_WAIT_STATE_START), or when a URLRequest is no longer
+ // blocked on a cache transaction (CACHE_WAIT_STATE_FINISH), or when a
+ // URLRequest is completely done (CACHE_WAIT_STATE_DONE), indicating
+ // cancellation of any pending cache waits for this request. Notice that
+ // START called several times for the same request. It is the responsibility
rvargas (doing something else) 2012/07/21 03:04:46 nit: start _is_ called (or may be called)
tburkard 2012/07/24 01:03:12 Done.
+ // of the delegate to keep track of the number of outstanding cache
+ // transactions.
+ virtual void OnCacheWaitStateChange(const URLRequest& request,
+ CacheWaitState state) = 0;
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698