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

Unified Diff: chrome/browser/devtools/devtools_network_transaction.h

Issue 324953002: DevToolsNetworkController: support "limit throughput" network condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 6 years, 6 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: chrome/browser/devtools/devtools_network_transaction.h
diff --git a/chrome/browser/devtools/devtools_network_transaction.h b/chrome/browser/devtools/devtools_network_transaction.h
index 5a51ab200e47d45da675d2337049d4aec7b11e1f..37e84ed8694b5ff4baab98b805cd8c3de0fa6506 100644
--- a/chrome/browser/devtools/devtools_network_transaction.h
+++ b/chrome/browser/devtools/devtools_network_transaction.h
@@ -47,6 +47,13 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
// Runs callback (if any) with net::ERR_INTERNET_DISCONNECTED result value.
void Fail();
+ int64_t throttled_byte_count() const { return throttled_byte_count_; }
+ void DecreaseThrottledByteCount(int64_t delta) {
+ throttled_byte_count_ -= delta;
+ }
+
+ void FireThrottledCallback();
+
// HttpTransaction methods:
virtual int Start(
const net::HttpRequestInfo* request,
@@ -102,6 +109,25 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
// True if Fail was already invoked.
bool failed_;
+ enum CallbackType {
+ NONE,
+ READ,
+ RESTART_IGNORING_LAST_ERROR,
+ RESTART_WITH_AUTH,
+ RESTART_WITH_CERTIFICATE,
+ START
+ };
+
+ int SetupCallback(
+ net::CompletionCallback callback,
+ int result,
+ CallbackType callback_type);
+
+ void Throttle(int result);
+
+ int throttled_result_;
+ int64_t throttled_byte_count_;
+ CallbackType callback_type_;
net::CompletionCallback proxy_callback_;
net::CompletionCallback callback_;

Powered by Google App Engine
This is Rietveld 408576698