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 #include "chrome/browser/devtools/devtools_network_interceptor.h" | 5 #include "chrome/browser/devtools/devtools_network_interceptor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 14 matching lines...) Expand all Loading... |
25 if (us_tick_length == 0) | 25 if (us_tick_length == 0) |
26 us_tick_length = 1; | 26 us_tick_length = 1; |
27 return base::TimeDelta::FromMicroseconds(us_tick_length); | 27 return base::TimeDelta::FromMicroseconds(us_tick_length); |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 DevToolsNetworkInterceptor::ThrottleRecord::ThrottleRecord() { | 32 DevToolsNetworkInterceptor::ThrottleRecord::ThrottleRecord() { |
33 } | 33 } |
34 | 34 |
| 35 DevToolsNetworkInterceptor::ThrottleRecord::ThrottleRecord( |
| 36 const ThrottleRecord& other) = default; |
| 37 |
35 DevToolsNetworkInterceptor::ThrottleRecord::~ThrottleRecord() { | 38 DevToolsNetworkInterceptor::ThrottleRecord::~ThrottleRecord() { |
36 } | 39 } |
37 | 40 |
38 DevToolsNetworkInterceptor::DevToolsNetworkInterceptor() | 41 DevToolsNetworkInterceptor::DevToolsNetworkInterceptor() |
39 : conditions_(new DevToolsNetworkConditions()), | 42 : conditions_(new DevToolsNetworkConditions()), |
40 download_last_tick_(0), | 43 download_last_tick_(0), |
41 upload_last_tick_(0), | 44 upload_last_tick_(0), |
42 weak_ptr_factory_(this) { | 45 weak_ptr_factory_(this) { |
43 } | 46 } |
44 | 47 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 std::remove_if(records->begin(), records->end(), | 281 std::remove_if(records->begin(), records->end(), |
279 [&callback](const ThrottleRecord& record){ | 282 [&callback](const ThrottleRecord& record){ |
280 return record.callback.Equals(callback); | 283 return record.callback.Equals(callback); |
281 }), | 284 }), |
282 records->end()); | 285 records->end()); |
283 } | 286 } |
284 | 287 |
285 bool DevToolsNetworkInterceptor::IsOffline() { | 288 bool DevToolsNetworkInterceptor::IsOffline() { |
286 return conditions_->offline(); | 289 return conditions_->offline(); |
287 } | 290 } |
OLD | NEW |