Index: chrome/browser/devtools/devtools_network_conditions.cc |
diff --git a/chrome/browser/devtools/devtools_network_conditions.cc b/chrome/browser/devtools/devtools_network_conditions.cc |
index 59e06b879c1f54f94fed26d1c4273f46a736a5c4..5e496b794ccf9495027f2a78ebe04a828b56baca 100644 |
--- a/chrome/browser/devtools/devtools_network_conditions.cc |
+++ b/chrome/browser/devtools/devtools_network_conditions.cc |
@@ -7,30 +7,22 @@ |
#include "url/gurl.h" |
DevToolsNetworkConditions::DevToolsNetworkConditions( |
- const std::vector<std::string>& domains, |
- double maximal_throughput) |
- : domains_(domains), |
- maximal_throughput_(maximal_throughput) { |
+ double latency, |
+ double download_throughput, |
+ double upload_throughput) |
+ : latency_(latency), |
+ download_throughput_(download_throughput), |
+ upload_throughput_(upload_throughput) { |
} |
DevToolsNetworkConditions::~DevToolsNetworkConditions() { |
} |
-bool DevToolsNetworkConditions::HasMatchingDomain(const GURL& url) const { |
- Domains::const_iterator domain = domains_.begin(); |
- if (domain == domains_.end()) |
- return true; |
- for (; domain != domains_.end(); ++domain) { |
- if (url.DomainIs(domain->data())) |
- return true; |
- } |
- return false; |
-} |
- |
bool DevToolsNetworkConditions::IsOffline() const { |
- return maximal_throughput_ == 0.0; |
+ return !IsThrottling(); |
} |
bool DevToolsNetworkConditions::IsThrottling() const { |
- return maximal_throughput_ != 0.0; |
+ return (latency_ != 0) || (download_throughput_ != 0.0) || |
+ (upload_throughput_ != 0); |
} |