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

Unified Diff: net/http/http_network_transaction.h

Issue 1901533002: Implementation of network level throttler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/http/http_network_transaction.h
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index 98b2e72982e3cd9e397cf25e9300d835d0635f1a..4764faee310687326de45139cc12645f08e2ae9a 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "crypto/ec_private_key.h"
#include "net/base/net_error_details.h"
+#include "net/base/network_stream_throttler.h"
#include "net/base/request_priority.h"
#include "net/http/http_auth.h"
#include "net/http/http_request_headers.h"
@@ -50,7 +51,8 @@ struct HttpRequestInfo;
class NET_EXPORT_PRIVATE HttpNetworkTransaction
: public HttpTransaction,
- public HttpStreamRequest::Delegate {
+ public HttpStreamRequest::Delegate,
+ public NetworkStreamThrottler::Delegate {
public:
HttpNetworkTransaction(RequestPriority priority,
HttpNetworkSession* session);
@@ -124,6 +126,9 @@ class NET_EXPORT_PRIVATE HttpNetworkTransaction
void OnQuicBroken() override;
void GetConnectionAttempts(ConnectionAttempts* out) const override;
+ // NetworkStreamThrottler::Delegate methods:
+ void OnThrottleStateChanged() override;
+
private:
friend class HttpNetworkTransactionSSLTest;
@@ -394,6 +399,11 @@ class NET_EXPORT_PRIVATE HttpNetworkTransaction
IPEndPoint remote_endpoint_;
// Network error details for this transaction.
NetErrorDetails net_error_details_;
+
+ // Communciate lifetime of transaction to the throttler, and
+ // throttled state to the transaction.
+ scoped_ptr<NetworkStreamThrottler::Throttle> throttle_;
+
DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction);
};

Powered by Google App Engine
This is Rietveld 408576698