OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class TimeTicks; | 21 class TimeTicks; |
22 } | 22 } |
23 | 23 |
24 // DevToolsNetworkInterceptor emulates network conditions for transactions with | 24 // DevToolsNetworkInterceptor emulates network conditions for transactions with |
25 // specific client id. | 25 // specific client id. |
26 class DevToolsNetworkInterceptor { | 26 class DevToolsNetworkInterceptor { |
27 public: | 27 public: |
28 class Throttable { | 28 class Throttable { |
29 public: | 29 public: |
30 virtual ~Throttable() {} | 30 virtual ~Throttable() {} |
31 virtual bool HasStarted() = 0; | |
32 virtual bool HasFailed() = 0; | |
33 virtual void Fail() = 0; | 31 virtual void Fail() = 0; |
34 virtual int64_t ThrottledByteCount() = 0; | 32 virtual int64_t ThrottledByteCount() = 0; |
35 virtual void Throttled(int64_t count) = 0; | 33 virtual void Throttled(int64_t count) = 0; |
36 virtual void ThrottleFinished() = 0; | 34 virtual void ThrottleFinished() = 0; |
37 virtual void GetSendEndTiming(base::TimeTicks* send_end) = 0; | 35 virtual void GetSendEndTiming(base::TimeTicks* send_end) = 0; |
38 }; | 36 }; |
39 | 37 |
40 DevToolsNetworkInterceptor(); | 38 DevToolsNetworkInterceptor(); |
41 virtual ~DevToolsNetworkInterceptor(); | 39 virtual ~DevToolsNetworkInterceptor(); |
42 | 40 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 base::TimeDelta tick_length_; | 79 base::TimeDelta tick_length_; |
82 base::TimeDelta latency_length_; | 80 base::TimeDelta latency_length_; |
83 uint64_t last_tick_; | 81 uint64_t last_tick_; |
84 | 82 |
85 base::WeakPtrFactory<DevToolsNetworkInterceptor> weak_ptr_factory_; | 83 base::WeakPtrFactory<DevToolsNetworkInterceptor> weak_ptr_factory_; |
86 | 84 |
87 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkInterceptor); | 85 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkInterceptor); |
88 }; | 86 }; |
89 | 87 |
90 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ | 88 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ |
OLD | NEW |