Reland "Expose can_trickle_ice_candidates on PeerConnection"
This reverts commit cb8c40138ca170f841bc45fa6771cdfc4b966e5f.
Reason for revert: Added missing default.
Original change's description:
> Revert "Expose can_trickle_ice_candidates on PeerConnection"
>
> This reverts commit c6a65c8866487c6adc0a7bb472d3bad9389501f9.
>
> Reason for revert: Breaks downstream due to missing default
>
> Original change's description:
> > Expose can_trickle_ice_candidates on PeerConnection
> >
> > Bug: chromium:708484
> > Change-Id: I9a40e75066341f0d9f965bd3718bfcb3f0459533
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169450
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Taylor <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#30653}
>
> TBR=deadbeef@webrtc.org,hta@webrtc.org
>
> Change-Id: Iaa5b977c4237715a8a5127cf167cf6512a3f7059
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:708484
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169540
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30655}
TBR=deadbeef@webrtc.org,hta@webrtc.org
Change-Id: I608da7781f158b4b02dd226d4dcd5615c4935fa8
Bug: chromium:708484
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169541
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30656}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index b48247c..f6c28f8 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -1010,6 +1010,7 @@
sources = [ "test/compile_all_headers.cc" ]
deps = [
+ ":dummy_peer_connection",
":fake_frame_decryptor",
":fake_frame_encryptor",
":fake_media_transport",
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index cc37dab..0ae47b2 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -1109,6 +1109,13 @@
virtual IceGatheringState ice_gathering_state() = 0;
+ // Returns the current state of canTrickleIceCandidates per
+ // https://w3c.github.io/webrtc-pc/#attributes-1
+ virtual absl::optional<bool> can_trickle_ice_candidates() {
+ // TODO(crbug.com/708484): Remove default implementation.
+ return absl::nullopt;
+ }
+
// Start RtcEventLog using an existing output-sink. Takes ownership of
// |output| and passes it on to Call, which will take the ownership. If the
// operation fails the output will be closed and deallocated. The event log
diff --git a/api/peer_connection_proxy.h b/api/peer_connection_proxy.h
index 1b4ceea..c278308 100644
--- a/api/peer_connection_proxy.h
+++ b/api/peer_connection_proxy.h
@@ -131,6 +131,7 @@
PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state)
PROXY_METHOD0(PeerConnectionState, peer_connection_state)
PROXY_METHOD0(IceGatheringState, ice_gathering_state)
+PROXY_METHOD0(absl::optional<bool>, can_trickle_ice_candidates)
PROXY_METHOD2(bool,
StartRtcEventLog,
std::unique_ptr<RtcEventLogOutput>,
diff --git a/api/test/dummy_peer_connection.h b/api/test/dummy_peer_connection.h
index fcd91e3..102b068 100644
--- a/api/test/dummy_peer_connection.h
+++ b/api/test/dummy_peer_connection.h
@@ -229,6 +229,8 @@
return IceGatheringState();
}
+ absl::optional<bool> can_trickle_ice_candidates() { return absl::nullopt; }
+
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override {
return false;
diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h
index aacaaf6..4e0a74e 100644
--- a/api/test/mock_peerconnectioninterface.h
+++ b/api/test/mock_peerconnectioninterface.h
@@ -127,6 +127,7 @@
MOCK_METHOD0(standardized_ice_connection_state, IceConnectionState());
MOCK_METHOD0(peer_connection_state, PeerConnectionState());
MOCK_METHOD0(ice_gathering_state, IceGatheringState());
+ MOCK_METHOD0(can_trickle_ice_candidates, absl::optional<bool>());
MOCK_METHOD2(StartRtcEventLog,
bool(std::unique_ptr<RtcEventLogOutput>, int64_t));
MOCK_METHOD1(StartRtcEventLog, bool(std::unique_ptr<RtcEventLogOutput>));