Commit graph

4 commits

Author SHA1 Message Date
Daniel Cheng
e125a3371f Add IceControllerInterface::GetConnections() and fix return type.
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}
2023-12-05 14:56:51 +00:00
Manashi Sarkar
c925f50c1c Revert "Correctly const-qualify return value of IceControllerInterface::connections()."
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}
2023-12-04 13:18:37 +00:00
Daniel Cheng
ad631f0d35 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}
2023-12-02 23:54:21 +00:00
Sameer Vijaykar
1adcde9dfe Use active ICE controller in P2PTransportChannel with an adapter (#6/n)
Controlled by a field trial, P2PTransportChannel can now use an active ICE controller instead of a legacy ICE controller.

P2PTransportChannel unit tests need non-trivial changes to exercise the refactored code path, so the testing changes are added in a follow-up CL.

Bug: webrtc:14367, webrtc:14131
Change-Id: I00d4930a5692c7d6d331ea9d6c2a2199304e363c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274701
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38114}
2022-09-19 09:41:30 +00:00