• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONDITIONS_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONDITIONS_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "base/macros.h"
12 
13 class GURL;
14 
15 // DevToolsNetworkConditions holds information about desired network conditions.
16 class DevToolsNetworkConditions {
17  public:
18   DevToolsNetworkConditions();
19   ~DevToolsNetworkConditions();
20 
21   explicit DevToolsNetworkConditions(bool offline);
22   DevToolsNetworkConditions(bool offline,
23                             double latency,
24                             double download_throughput,
25                             double upload_throughput);
26 
27   bool IsThrottling() const;
28 
offline()29   bool offline() const { return offline_; }
latency()30   double latency() const { return latency_; }
download_throughput()31   double download_throughput() const { return download_throughput_; }
upload_throughput()32   double upload_throughput() const { return upload_throughput_; }
33 
34  private:
35   const bool offline_;
36   const double latency_;
37   const double download_throughput_;
38   const double upload_throughput_;
39 
40   DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkConditions);
41 };
42 
43 #endif  // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONDITIONS_H_
44