OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic/core/quic_multipath_sent_packet_manager.h" | 5 #include "net/quic/core/quic_multipath_sent_packet_manager.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "net/quic/core/quic_bug_tracker.h" | 10 #include "net/quic/core/quic_bug_tracker.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 QuicPacketCount QuicMultipathSentPacketManager::GetSlowStartThresholdInTcpMss() | 309 QuicPacketCount QuicMultipathSentPacketManager::GetSlowStartThresholdInTcpMss() |
310 const { | 310 const { |
311 QuicSentPacketManagerInterface* path_manager = | 311 QuicSentPacketManagerInterface* path_manager = |
312 MaybeGetSentPacketManagerForActivePath(kDefaultPathId); | 312 MaybeGetSentPacketManagerForActivePath(kDefaultPathId); |
313 if (path_manager == nullptr) { | 313 if (path_manager == nullptr) { |
314 return 0; | 314 return 0; |
315 } | 315 } |
316 return path_manager->GetSlowStartThresholdInTcpMss(); | 316 return path_manager->GetSlowStartThresholdInTcpMss(); |
317 } | 317 } |
318 | 318 |
| 319 string QuicMultipathSentPacketManager::GetDebugState() const { |
| 320 string debug_state_by_path; |
| 321 for (size_t i = 0; i < path_managers_info_.size(); ++i) { |
| 322 if (path_managers_info_[i].manager == nullptr || |
| 323 path_managers_info_[i].state != ACTIVE) { |
| 324 continue; |
| 325 } |
| 326 const string& debug_state = path_managers_info_[i].manager->GetDebugState(); |
| 327 if (debug_state.empty()) { |
| 328 continue; |
| 329 } |
| 330 debug_state_by_path = |
| 331 debug_state_by_path + "[" + base::IntToString(i) + "]:" + debug_state; |
| 332 } |
| 333 return debug_state_by_path; |
| 334 } |
| 335 |
319 void QuicMultipathSentPacketManager::CancelRetransmissionsForStream( | 336 void QuicMultipathSentPacketManager::CancelRetransmissionsForStream( |
320 QuicStreamId stream_id) { | 337 QuicStreamId stream_id) { |
321 for (PathSentPacketManagerInfo path_manager_info : path_managers_info_) { | 338 for (PathSentPacketManagerInfo path_manager_info : path_managers_info_) { |
322 if (path_manager_info.manager != nullptr) { | 339 if (path_manager_info.manager != nullptr) { |
323 path_manager_info.manager->CancelRetransmissionsForStream(stream_id); | 340 path_manager_info.manager->CancelRetransmissionsForStream(stream_id); |
324 } | 341 } |
325 } | 342 } |
326 } | 343 } |
327 | 344 |
328 void QuicMultipathSentPacketManager::OnConnectionMigration( | 345 void QuicMultipathSentPacketManager::OnConnectionMigration( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 ConnectionCloseSource::FROM_SELF); | 510 ConnectionCloseSource::FROM_SELF); |
494 return; | 511 return; |
495 } | 512 } |
496 const string error_details = "Sent packet manager of path: (" + | 513 const string error_details = "Sent packet manager of path: (" + |
497 base::IntToString(path_id) + | 514 base::IntToString(path_id) + |
498 ") must be active but is not."; | 515 ") must be active but is not."; |
499 delegate_->OnUnrecoverableError(QUIC_MULTIPATH_PATH_NOT_ACTIVE, error_details, | 516 delegate_->OnUnrecoverableError(QUIC_MULTIPATH_PATH_NOT_ACTIVE, error_details, |
500 ConnectionCloseSource::FROM_SELF); | 517 ConnectionCloseSource::FROM_SELF); |
501 } | 518 } |
502 | 519 |
| 520 void QuicMultipathSentPacketManager::OnApplicationLimited() { |
| 521 for (PathSentPacketManagerInfo& path_manager_info : path_managers_info_) { |
| 522 if (path_manager_info.manager == nullptr || |
| 523 path_manager_info.state != ACTIVE) { |
| 524 continue; |
| 525 } |
| 526 path_manager_info.manager->OnApplicationLimited(); |
| 527 } |
| 528 } |
| 529 |
503 } // namespace net | 530 } // namespace net |
OLD | NEW |