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

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: One more divide-by-zero check 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..e47d95306b0e653f381bbfdbe5f6a05a4e8fe21b 100644
--- a/chrome/browser/devtools/devtools_network_transaction.h
+++ b/chrome/browser/devtools/devtools_network_transaction.h
@@ -47,6 +47,8 @@ class DevToolsNetworkTransaction : public net::HttpTransaction {
// Runs callback (if any) with net::ERR_INTERNET_DISCONNECTED result value.
void Fail();
+ void FireThrottledCallback();
+
// HttpTransaction methods:
virtual int Start(
const net::HttpRequestInfo* request,
@@ -102,6 +104,24 @@ 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_;
+ CallbackType callback_type_;
net::CompletionCallback proxy_callback_;
net::CompletionCallback callback_;

Powered by Google App Engine
This is Rietveld 408576698