diff options
author | jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 15:40:48 +0000 |
---|---|---|
committer | jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 15:40:48 +0000 |
commit | 1826a409a7b9f12a801d32a362e4826c50669364 (patch) | |
tree | 035584af5af8f151c756ba9ea761400b5c1dcf55 /net/http/http_transaction.h | |
parent | f522afaa8b6ff706b91c10e0680f4ceae9fd1a5e (diff) | |
download | chromium_src-1826a409a7b9f12a801d32a362e4826c50669364.zip chromium_src-1826a409a7b9f12a801d32a362e4826c50669364.tar.gz chromium_src-1826a409a7b9f12a801d32a362e4826c50669364.tar.bz2 |
Allows deferral of a URLRequest just before talking to the network, at
DoCreateStream time in the HttpNetworkTransaction. This hook allows
for experimentation with the ResourceScheduler so that it can defer
after first checking the cache, gathering the cookies, and starting
the WebRequest but before going to the network.
BUG=328741
Review URL: https://codereview.chromium.org/122453002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_transaction.h')
-rw-r--r-- | net/http/http_transaction.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/http/http_transaction.h b/net/http/http_transaction.h index 3776998..1facef7 100644 --- a/net/http/http_transaction.h +++ b/net/http/http_transaction.h @@ -28,6 +28,10 @@ class X509Certificate; // answered. Cookies are assumed to be managed by the caller. class NET_EXPORT_PRIVATE HttpTransaction { public: + // If |*defer| is set to true, the transaction will wait until + // ResumeNetworkStart is called before establishing a connection. + typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; + // Stops any pending IO and destroys the transaction object. virtual ~HttpTransaction() {} @@ -144,6 +148,13 @@ class NET_EXPORT_PRIVATE HttpTransaction { // Start(). Ownership of |create_helper| remains with the caller. virtual void SetWebSocketHandshakeStreamCreateHelper( WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0; + + // Set the callback to receive notification just before network use. + virtual void SetBeforeNetworkStartCallback( + const BeforeNetworkStartCallback& callback) = 0; + + // Resumes the transaction after being deferred. + virtual int ResumeNetworkStart() = 0; }; } // namespace net |