enabling network emulation in devtools
This commit is contained in:
parent
ab878c5f98
commit
a1e646f1b3
19 changed files with 1292 additions and 3 deletions
35
brightray/browser/net/devtools_network_conditions.cc
Normal file
35
brightray/browser/net/devtools_network_conditions.cc
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "browser/net/devtools_network_conditions.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
DevToolsNetworkConditions::DevToolsNetworkConditions(bool offline)
|
||||
: offline_(offline),
|
||||
latency_(0),
|
||||
download_throughput_(0),
|
||||
upload_throughput_(0) {
|
||||
}
|
||||
|
||||
DevToolsNetworkConditions::DevToolsNetworkConditions(
|
||||
bool offline,
|
||||
double latency,
|
||||
double download_throughput,
|
||||
double upload_throughput)
|
||||
: offline_(offline),
|
||||
latency_(latency),
|
||||
download_throughput_(download_throughput),
|
||||
upload_throughput_(upload_throughput) {
|
||||
}
|
||||
|
||||
DevToolsNetworkConditions::~DevToolsNetworkConditions() {
|
||||
}
|
||||
|
||||
bool DevToolsNetworkConditions::IsThrottling() const {
|
||||
return !offline_ && ((latency_ != 0.0) || (download_throughput_ != 0.0) ||
|
||||
(upload_throughput_ != 0.0));
|
||||
}
|
||||
|
||||
} // namespace brightray
|
Loading…
Add table
Add a link
Reference in a new issue