| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 bool is_upload, | 45 bool is_upload, |
| 46 const ThrottleCallback& callback); | 46 const ThrottleCallback& callback); |
| 47 void StopThrottle(const ThrottleCallback& callback); | 47 void StopThrottle(const ThrottleCallback& callback); |
| 48 | 48 |
| 49 bool IsOffline(); | 49 bool IsOffline(); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 struct ThrottleRecord { | 52 struct ThrottleRecord { |
| 53 public: | 53 public: |
| 54 ThrottleRecord(); | 54 ThrottleRecord(); |
| 55 ThrottleRecord(const ThrottleRecord& other); |
| 55 ~ThrottleRecord(); | 56 ~ThrottleRecord(); |
| 56 int result; | 57 int result; |
| 57 int64_t bytes; | 58 int64_t bytes; |
| 58 int64_t send_end; | 59 int64_t send_end; |
| 59 bool is_upload; | 60 bool is_upload; |
| 60 ThrottleCallback callback; | 61 ThrottleCallback callback; |
| 61 }; | 62 }; |
| 62 using ThrottleRecords = std::vector<ThrottleRecord>; | 63 using ThrottleRecords = std::vector<ThrottleRecord>; |
| 63 | 64 |
| 64 void FinishRecords(ThrottleRecords* records, bool offline); | 65 void FinishRecords(ThrottleRecords* records, bool offline); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 93 base::TimeDelta latency_length_; | 94 base::TimeDelta latency_length_; |
| 94 uint64_t download_last_tick_; | 95 uint64_t download_last_tick_; |
| 95 uint64_t upload_last_tick_; | 96 uint64_t upload_last_tick_; |
| 96 | 97 |
| 97 base::WeakPtrFactory<DevToolsNetworkInterceptor> weak_ptr_factory_; | 98 base::WeakPtrFactory<DevToolsNetworkInterceptor> weak_ptr_factory_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkInterceptor); | 100 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkInterceptor); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ | 103 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_INTERCEPTOR_H_ |
| OLD | NEW |