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

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

Issue 342473004: DevTools: make network conditions emulation scoped (browser) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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_conditions.h
diff --git a/chrome/browser/devtools/devtools_network_conditions.h b/chrome/browser/devtools/devtools_network_conditions.h
index 7c9d477fdfe97f5080432a3d21cc84e5519f0359..e19f77e9438e14815c9cb3668659a2131b8a0f5f 100644
--- a/chrome/browser/devtools/devtools_network_conditions.h
+++ b/chrome/browser/devtools/devtools_network_conditions.h
@@ -16,24 +16,29 @@ class GURL;
class DevToolsNetworkConditions
: public base::RefCounted<DevToolsNetworkConditions> {
public:
- DevToolsNetworkConditions(const std::vector<std::string>& domains,
- double maximal_throughput);
+ DevToolsNetworkConditions();
+ explicit DevToolsNetworkConditions(bool offline);
+ DevToolsNetworkConditions(bool offline,
+ double latency,
+ double download_throughput,
+ double upload_throughput);
- bool HasMatchingDomain(const GURL& url) const;
- bool IsOffline() const;
bool IsThrottling() const;
- double maximal_throughput() const { return maximal_throughput_; }
+ bool offline() const { return offline_; }
+ double latency() const { return latency_; }
+ double download_throughput() const { return download_throughput_; }
+ double upload_throughput() const { return upload_throughput_; }
private:
friend class base::RefCounted<DevToolsNetworkConditions>;
virtual ~DevToolsNetworkConditions();
- // List of domains that will be affected by network conditions.
- typedef std::vector<std::string> Domains;
- const Domains domains_;
- const double maximal_throughput_;
+ const bool offline_;
+ const double latency_;
+ const double download_throughput_;
+ const double upload_throughput_;
DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkConditions);
};

Powered by Google App Engine
This is Rietveld 408576698