| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 RequestPriority priority, | 129 RequestPriority priority, |
| 130 bool ignore_limits) override { | 130 bool ignore_limits) override { |
| 131 std::unique_ptr<TestThrottle> test_throttle( | 131 std::unique_ptr<TestThrottle> test_throttle( |
| 132 new TestThrottle(throttle_new_requests_, delegate, this)); | 132 new TestThrottle(throttle_new_requests_, delegate, this)); |
| 133 outstanding_throttles_.insert(test_throttle.get()); | 133 outstanding_throttles_.insert(test_throttle.get()); |
| 134 return std::move(test_throttle); | 134 return std::move(test_throttle); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void UnthrottleAllRequests() { | 137 void UnthrottleAllRequests() { |
| 138 std::set<TestThrottle*> outstanding_throttles_copy(outstanding_throttles_); | 138 std::set<TestThrottle*> outstanding_throttles_copy(outstanding_throttles_); |
| 139 for (auto& throttle : outstanding_throttles_copy) { | 139 for (auto* throttle : outstanding_throttles_copy) { |
| 140 if (throttle->IsBlocked()) | 140 if (throttle->IsBlocked()) |
| 141 throttle->Unthrottle(); | 141 throttle->Unthrottle(); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 void set_throttle_new_requests(bool throttle_new_requests) { | 145 void set_throttle_new_requests(bool throttle_new_requests) { |
| 146 throttle_new_requests_ = throttle_new_requests; | 146 throttle_new_requests_ = throttle_new_requests; |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Includes both throttled and unthrottled throttles. | 149 // Includes both throttled and unthrottled throttles. |
| (...skipping 16368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16518 base::RunLoop().RunUntilIdle(); | 16518 base::RunLoop().RunUntilIdle(); |
| 16519 | 16519 |
| 16520 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); | 16520 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); |
| 16521 HttpRequestHeaders headers; | 16521 HttpRequestHeaders headers; |
| 16522 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); | 16522 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); |
| 16523 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); | 16523 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); |
| 16524 } | 16524 } |
| 16525 #endif // !defined(OS_IOS) | 16525 #endif // !defined(OS_IOS) |
| 16526 | 16526 |
| 16527 } // namespace net | 16527 } // namespace net |
| OLD | NEW |