This is a replacement for `connections()`, which is const-qualified but
returns a `rtc::ArrayView<const cricket::Connection*>`. Unfortunately,
this is a view of mutable pointers to `const cricket::Connection`
objects: this means that the pointers in `IceControllerInterface`'s
backing store can be reassigned.
Returning `rtc::ArrayView<const cricket::Connection* const>` is more
consistent with how a view returned from a const-qualified method should
behave. Unfortunately, there are downstream overrides of this method, so
instead of just fixing this outright, add a new method with the correct
return type. Once downstream is updated, the old method can then be
removed.
Bug: chromium:1409870, webrtc:15702
Change-Id: I3d8f0c2f0bcf4c393ee63959cb61761ac00a28ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329962
Reviewed-by: Jonas Oreland <jonaso@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41318}
This reverts commit ad631f0d35.
Reason for revert: error: virtual function 'connections' has a different return type ('ArrayView<const cricket::Connection *>') than the function it overrides (which has return type 'ArrayView<const Connection *const>')
Original change's description:
> Correctly const-qualify return value of IceControllerInterface::connections().
>
> This is intended to be a read-only view across a container of const
> Connection*, but due to the missing const, elements of the container
> could actually be re-assigned through the ArrayView.
>
> This was discovered when trying to roll Googletest, since Googletest was
> fixed to const-qualify converting actions:
> cbca6bc395
>
> Bug: chromium:1409870
> Change-Id: Iadd3abe6807111987e422b8510a23f2a4f7026ed
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329481
> Auto-Submit: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#41300}
Bug: chromium:1409870
Change-Id: Id0026eb7727a3d1408045d0040b3b080cca07832
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329762
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Manashi Sarkar <manashi@google.com>
Cr-Commit-Position: refs/heads/main@{#41307}
This is intended to be a read-only view across a container of const
Connection*, but due to the missing const, elements of the container
could actually be re-assigned through the ArrayView.
This was discovered when trying to roll Googletest, since Googletest was
fixed to const-qualify converting actions:
cbca6bc395
Bug: chromium:1409870
Change-Id: Iadd3abe6807111987e422b8510a23f2a4f7026ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329481
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41300}
This change removes the following after internal cleanup:
- IceRecheckEvent::Type enum, replaced with IceSwitchReason
- IceControllerEvent alias for IceRecheckEvent
Bug: webrtc:14125, webrtc:14131
Change-Id: I07bfeb7fa8a9c4d4a3f940213befd6418dfd6644
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264145
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37118}
This changes renames the event to better suit its purpose. An alias
with the old name is added for compatibility pending internal cleanup.
Bug: webrtc:14125, webrtc:14131
Change-Id: I87026e19f2620eaa6a6770dcbedf1d0399c6c6b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264149
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37111}
This is a partial reland of commit 794e68cf3d
which uses the new enum in P2PTransportChannel and BasicIceController.
Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from
> the ICE switch reason. Further cleanup is earmarked, and will be
> landed after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}
Bug: webrtc:14125, webrtc:14131
Change-Id: I81b0338ae2f0560cd3df7ad9bd9af37e7c3499df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264554
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37105}
This is a partial reland of commit 794e68cf3d
which
- adds a new enum - IceSwitchReason
- adds a member for the new enum in IceControllerEvent
- adds methods to IceControllerInterface accepting the new enum
- adds conversion between the old and new enums for compatibility
Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from
> the ICE switch reason. Further cleanup is earmarked, and will be
> landed after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}
Bug: webrtc:14125, webrtc:14131
Change-Id: I2ccdd53c80e38dc139669aa3f438864befed3dc0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264506
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37094}
This reverts commit 794e68cf3d.
Reason for revert: Possibly breaks downstream project
Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from the
> ICE switch reason. Further cleanup is earmarked, and will be landed
> after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}
Bug: webrtc:14125, webrtc:14131
Change-Id: Ie6c4dea0f9007f78ce2bf1ee4e6b1dbca08f3142
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264505
Auto-Submit: Sameer Vijaykar <samvi@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37059}
This change is the first step in decoupling IceControllerEvent from the
ICE switch reason. Further cleanup is earmarked, and will be landed
after some internal cleanup.
This change
- adds a new enum - IceSwitchReason
- adds a member for the new enum in IceControllerEvent
- uses the new enum within P2PTransportChannel
- adds methods to IceControllerInterface accepting the new enum
- deprecates usages of the old enum in IceControllerInterface
- adds conversion between the old and new enums for compatibility
Bug: webrtc:14125, webrtc:14131
Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37051}
During SelectConnectionToPing, optional connection had the value of nullptr which led the code to crash.
Bug: None
Change-Id: Ibe9a54b71bbd62f3b80d676ca80d64ff951dda51
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206081
Commit-Queue: Tim Na <natim@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33197}
This patch enables an IceController to use
Connection::ForgetLearnedState by returning it
in a SwitchResult, that will cause P2PTransportChannel
to call the method.
BUG: webrtc:11463
Change-Id: I098bbbd2fb2961822b165770189ac0c2225d1cb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176511
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31458}
this is a NOP refactoring, that modify return type
of IceControllerInterface::SelectConnectionToPing to a struct
(rather than existing pair). The modification is done
so that one can safely add new return values in the struct.
Step 1) Create a typedef for return value.
- merge downstream and change it to start using new type.
Step 2) Change typedef to struct,
adding constructors from old type to new type
merge and change downstream to use "real" constructors
Step 3) remove temporary constructors
Step 4) Eat cake
Each step requires a merge downstream, with corresponding
changes there.
Bug: chromium:1024965
Change-Id: I46ad4a58426a7d33b84bc78caab55893315d25c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171874
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30921}
this is a NOP refactoring, that modify return type
of IceControllerInterface::SelectConnectionToPing to a struct
(rather than existing pair). The modification is done
so that one can safely add new return values in the struct.
Step 1) Create a typedef for return value.
- merge downstream and change it to start using new type.
Step 2) Change typedef to struct,
adding constructors from old type to new type
merge and change downstream to use "real" constructors
Step 3) remove temporary constructors
Step 4) Eat cake
Each step requires a merge downstream, with corresponding
changes there.
Bug: chromium:1024965
Change-Id: I79df9528f842ea73ca8896cedd62ad3a5cf5b767
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171807
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30914}
this is a NOP refactoring, that modify return type
of IceControllerInterface::SelectConnectionToPing to a struct
(rather than existing pair). The modification is done
so that one can safely add new return values in the struct.
Step 1) Create a typedef for return value.
- merge downstream and change it to start using new type.
Step 2) Change typedef to struct,
adding constructors from old type to new type
merge and change downstream to use "real" constructors
Step 3) remove temporary constructors
Step 4) Eat cake
Each step requires a merge downstream, with corresponding
changes there.
Bug: chromium:1024965
Change-Id: I6ebb8658a77e0ef5c24acb382c0cb6413403c168
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171691
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30902}
This patch adds a new enum value in IceControllerEvent::Type,
that allows an IceController to request a recheck without
any of the predefined event occuring.
This patch is a NOP for BasicIceController.
BUG=webrtc:10647
Change-Id: Idf1d0946480437109ff272946679fef559ca7beb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161047
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29976}
This patch moves the logic for
- selection of connection to ping
- selection of connection to use
- selection of connection to prune
into own file and puts it behind a new interface called 'IceControllerInterface'.
BUG=webrtc:10647
Change-Id: I10228b3edd361d3200fa4a734d74a319560966c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158205
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29850}