Home | History | Annotate | Download | only in devtools
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/devtools/devtools_network_conditions.h"
      6 
      7 #include "url/gurl.h"
      8 
      9 DevToolsNetworkConditions::DevToolsNetworkConditions()
     10     : offline_(false),
     11       latency_(0),
     12       download_throughput_(0),
     13       upload_throughput_(0) {
     14 }
     15 
     16 DevToolsNetworkConditions::DevToolsNetworkConditions(bool offline)
     17     : offline_(offline),
     18       latency_(0),
     19       download_throughput_(0),
     20       upload_throughput_(0) {
     21 }
     22 
     23 DevToolsNetworkConditions::DevToolsNetworkConditions(
     24     bool offline,
     25     double latency,
     26     double download_throughput,
     27     double upload_throughput)
     28     : offline_(offline),
     29       latency_(latency),
     30       download_throughput_(download_throughput),
     31       upload_throughput_(upload_throughput) {
     32 }
     33 
     34 DevToolsNetworkConditions::~DevToolsNetworkConditions() {
     35 }
     36 
     37 bool DevToolsNetworkConditions::IsThrottling() const {
     38   return (latency_ != 0) || (download_throughput_ != 0.0) ||
     39       (upload_throughput_ != 0);
     40 }
     41