Remove deprecated PeerConnectionObserver::OnStateChange and OnIceComplete

These methods are no longer used.
OnStateChange needs to be removed from Chrome before this cl lands. https://codereview.chromium.org/1668413003/

TBR=glaznev@webrtc.org for webrtc/examples

Review URL: https://codereview.webrtc.org/1669993003

Cr-Commit-Position: refs/heads/master@{#11537}
This commit is contained in:
perkj 2016-02-09 03:09:43 -08:00 committed by Commit bot
parent 0715a83a07
commit dfb769d848
9 changed files with 33 additions and 77 deletions

View File

@ -1390,11 +1390,6 @@ void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) {
observer_->OnIceCandidate(candidate);
}
void PeerConnection::OnIceComplete() {
RTC_DCHECK(signaling_thread()->IsCurrent());
observer_->OnIceComplete();
}
void PeerConnection::OnIceConnectionReceivingChange(bool receiving) {
RTC_DCHECK(signaling_thread()->IsCurrent());
observer_->OnIceConnectionReceivingChange(receiving);
@ -1412,7 +1407,6 @@ void PeerConnection::ChangeSignalingState(
}
}
observer_->OnSignalingChange(signaling_state_);
observer_->OnStateChange(PeerConnectionObserver::kSignalingState);
}
void PeerConnection::OnAudioTrackAdded(AudioTrackInterface* track,

View File

@ -187,7 +187,6 @@ class PeerConnection : public PeerConnectionInterface,
void OnIceConnectionChange(IceConnectionState new_state) override;
void OnIceGatheringChange(IceGatheringState new_state) override;
void OnIceCandidate(const IceCandidateInterface* candidate) override;
void OnIceComplete() override;
void OnIceConnectionReceivingChange(bool receiving) override;
// Signals from WebRtcSession.

View File

@ -386,8 +386,6 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
return true;
}
void OnIceComplete() override { LOG(INFO) << id_ << "OnIceComplete"; }
void OnDataChannel(DataChannelInterface* data_channel) override {
LOG(INFO) << id_ << "OnDataChannel";
data_channel_ = data_channel;

View File

@ -465,11 +465,7 @@ class PeerConnectionObserver {
// Triggered when the SignalingState changed.
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) {}
// Triggered when SignalingState or IceState have changed.
// TODO(bemasc): Remove once callers transition to OnSignalingChange.
virtual void OnStateChange(StateType state_changed) {}
PeerConnectionInterface::SignalingState new_state) = 0;
// Triggered when media is received on a new stream from remote peer.
virtual void OnAddStream(MediaStreamInterface* stream) = 0;
@ -485,19 +481,15 @@ class PeerConnectionObserver {
// Called any time the IceConnectionState changes
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {}
PeerConnectionInterface::IceConnectionState new_state) = 0;
// Called any time the IceGatheringState changes
virtual void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) {}
PeerConnectionInterface::IceGatheringState new_state) = 0;
// New Ice candidate have been found.
virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
// TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
// All Ice candidates have been found.
virtual void OnIceComplete() {}
// Called when the ICE connection receiving status changes.
virtual void OnIceConnectionReceivingChange(bool receiving) {}

View File

@ -443,30 +443,29 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
return remote_streams_->find(label);
}
StreamCollectionInterface* remote_streams() const { return remote_streams_; }
virtual void OnAddStream(MediaStreamInterface* stream) {
void OnAddStream(MediaStreamInterface* stream) override {
last_added_stream_ = stream;
remote_streams_->AddStream(stream);
}
virtual void OnRemoveStream(MediaStreamInterface* stream) {
void OnRemoveStream(MediaStreamInterface* stream) override {
last_removed_stream_ = stream;
remote_streams_->RemoveStream(stream);
}
virtual void OnRenegotiationNeeded() {
renegotiation_needed_ = true;
}
virtual void OnDataChannel(DataChannelInterface* data_channel) {
void OnRenegotiationNeeded() override { renegotiation_needed_ = true; }
void OnDataChannel(DataChannelInterface* data_channel) override {
last_datachannel_ = data_channel;
}
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {
void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) override {
EXPECT_EQ(pc_->ice_connection_state(), new_state);
}
virtual void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) {
void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) override {
EXPECT_EQ(pc_->ice_gathering_state(), new_state);
ice_complete_ = new_state == PeerConnectionInterface::kIceGatheringComplete;
}
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) {
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override {
EXPECT_NE(PeerConnectionInterface::kIceGatheringNew,
pc_->ice_gathering_state());
@ -477,15 +476,6 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
candidate->sdp_mline_index(), sdp, NULL));
EXPECT_TRUE(last_candidate_.get() != NULL);
}
// TODO(bemasc): Remove this once callers transition to OnSignalingChange.
virtual void OnIceComplete() {
ice_complete_ = true;
// OnIceGatheringChange(IceGatheringCompleted) and OnIceComplete() should
// be called approximately simultaneously. For ease of testing, this
// check additionally requires that they be called in the above order.
EXPECT_EQ(PeerConnectionInterface::kIceGatheringComplete,
pc_->ice_gathering_state());
}
// Returns the label of the last added stream.
// Empty string if no stream have been added.

View File

@ -2059,7 +2059,6 @@ void WebRtcSession::OnTransportControllerGatheringState(
if (ice_observer_) {
ice_observer_->OnIceGatheringChange(
PeerConnectionInterface::kIceGatheringComplete);
ice_observer_->OnIceComplete();
}
}
}

View File

@ -96,10 +96,6 @@ class IceObserver {
PeerConnectionInterface::IceGatheringState new_state) {}
// New Ice candidate have been found.
virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
// All Ice candidates have been found.
// TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
// (via PeerConnectionObserver)
virtual void OnIceComplete() {}
// Called whenever the state changes between receiving and not receiving.
virtual void OnIceConnectionReceivingChange(bool receiving) {}

View File

@ -179,26 +179,21 @@ class MockIceObserver : public webrtc::IceObserver {
ice_gathering_state_(PeerConnectionInterface::kIceGatheringNew) {
}
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {
void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) override {
ice_connection_state_ = new_state;
}
virtual void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) {
void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) override {
// We can never transition back to "new".
EXPECT_NE(PeerConnectionInterface::kIceGatheringNew, new_state);
ice_gathering_state_ = new_state;
// oncandidatesready_ really means "ICE gathering is complete".
// This if statement ensures that this value remains correct when we
// transition from kIceGatheringComplete to kIceGatheringGathering.
if (new_state == PeerConnectionInterface::kIceGatheringGathering) {
oncandidatesready_ = false;
}
oncandidatesready_ =
new_state == PeerConnectionInterface::kIceGatheringComplete;
}
// Found a new candidate.
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) {
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override {
switch (candidate->sdp_mline_index()) {
case kMediaContentIndex0:
mline_0_candidates_.push_back(candidate->candidate());
@ -215,18 +210,6 @@ class MockIceObserver : public webrtc::IceObserver {
EXPECT_NE(PeerConnectionInterface::kIceGatheringNew, ice_gathering_state_);
}
// TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
virtual void OnIceComplete() {
EXPECT_FALSE(oncandidatesready_);
oncandidatesready_ = true;
// OnIceGatheringChange(IceGatheringCompleted) and OnIceComplete() should
// be called approximately simultaneously. For ease of testing, this
// check additionally requires that they be called in the above order.
EXPECT_EQ(PeerConnectionInterface::kIceGatheringComplete,
ice_gathering_state_);
}
bool oncandidatesready_;
std::vector<cricket::Candidate> mline_0_candidates_;
std::vector<cricket::Candidate> mline_1_candidates_;

View File

@ -64,14 +64,19 @@ class Conductor
//
// PeerConnectionObserver implementation.
//
virtual void OnStateChange(
webrtc::PeerConnectionObserver::StateType state_changed) {}
virtual void OnAddStream(webrtc::MediaStreamInterface* stream);
virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream);
virtual void OnDataChannel(webrtc::DataChannelInterface* channel) {}
virtual void OnRenegotiationNeeded() {}
virtual void OnIceChange() {}
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate);
void OnSignalingChange(
webrtc::PeerConnectionInterface::SignalingState new_state) override{};
void OnAddStream(webrtc::MediaStreamInterface* stream) override;
void OnRemoveStream(webrtc::MediaStreamInterface* stream) override;
void OnDataChannel(webrtc::DataChannelInterface* channel) override {}
void OnRenegotiationNeeded() override {}
void OnIceConnectionChange(
webrtc::PeerConnectionInterface::IceConnectionState new_state) override{};
void OnIceGatheringChange(
webrtc::PeerConnectionInterface::IceGatheringState new_state) override{};
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override;
void OnIceConnectionReceivingChange(bool receiving) override {}
//
// PeerConnectionClientObserver implementation.