Add override declarations to PeerConnectionObserver subclasses, and delete obsolete methods.
BUG=None Review-Url: https://codereview.webrtc.org/2660223002 Cr-Commit-Position: refs/heads/master@{#16374}
This commit is contained in:
parent
1783f169d9
commit
63b14b7d15
@ -84,37 +84,37 @@ class Conductor
|
|||||||
// PeerConnectionClientObserver implementation.
|
// PeerConnectionClientObserver implementation.
|
||||||
//
|
//
|
||||||
|
|
||||||
virtual void OnSignedIn();
|
void OnSignedIn() override;
|
||||||
|
|
||||||
virtual void OnDisconnected();
|
void OnDisconnected() override;
|
||||||
|
|
||||||
virtual void OnPeerConnected(int id, const std::string& name);
|
void OnPeerConnected(int id, const std::string& name) override;
|
||||||
|
|
||||||
virtual void OnPeerDisconnected(int id);
|
void OnPeerDisconnected(int id) override;
|
||||||
|
|
||||||
virtual void OnMessageFromPeer(int peer_id, const std::string& message);
|
void OnMessageFromPeer(int peer_id, const std::string& message) override;
|
||||||
|
|
||||||
virtual void OnMessageSent(int err);
|
void OnMessageSent(int err) override;
|
||||||
|
|
||||||
virtual void OnServerConnectionFailure();
|
void OnServerConnectionFailure() override;
|
||||||
|
|
||||||
//
|
//
|
||||||
// MainWndCallback implementation.
|
// MainWndCallback implementation.
|
||||||
//
|
//
|
||||||
|
|
||||||
virtual void StartLogin(const std::string& server, int port);
|
void StartLogin(const std::string& server, int port) override;
|
||||||
|
|
||||||
virtual void DisconnectFromServer();
|
void DisconnectFromServer() override;
|
||||||
|
|
||||||
virtual void ConnectToPeer(int peer_id);
|
void ConnectToPeer(int peer_id) override;
|
||||||
|
|
||||||
virtual void DisconnectFromCurrentPeer();
|
void DisconnectFromCurrentPeer() override;
|
||||||
|
|
||||||
virtual void UIThreadCallback(int msg_id, void* data);
|
void UIThreadCallback(int msg_id, void* data) override;
|
||||||
|
|
||||||
// CreateSessionDescriptionObserver implementation.
|
// CreateSessionDescriptionObserver implementation.
|
||||||
virtual void OnSuccess(webrtc::SessionDescriptionInterface* desc);
|
void OnSuccess(webrtc::SessionDescriptionInterface* desc) override;
|
||||||
virtual void OnFailure(const std::string& error);
|
void OnFailure(const std::string& error) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Send a message to the remote peer.
|
// Send a message to the remote peer.
|
||||||
|
|||||||
@ -71,21 +71,20 @@ class NullPeerConnectionObserver : public PeerConnectionObserver {
|
|||||||
using PeerConnectionObserver::OnDataChannel;
|
using PeerConnectionObserver::OnDataChannel;
|
||||||
|
|
||||||
virtual ~NullPeerConnectionObserver() = default;
|
virtual ~NullPeerConnectionObserver() = default;
|
||||||
virtual void OnMessage(const std::string& msg) {}
|
void OnSignalingChange(
|
||||||
virtual void OnSignalingMessage(const std::string& msg) {}
|
PeerConnectionInterface::SignalingState new_state) override {}
|
||||||
virtual void OnSignalingChange(
|
void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override {}
|
||||||
PeerConnectionInterface::SignalingState new_state) {}
|
void OnRemoveStream(
|
||||||
virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {}
|
rtc::scoped_refptr<MediaStreamInterface> stream) override {}
|
||||||
virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) {
|
void OnDataChannel(
|
||||||
}
|
rtc::scoped_refptr<DataChannelInterface> data_channel) override {}
|
||||||
virtual void OnDataChannel(
|
void OnRenegotiationNeeded() override {}
|
||||||
rtc::scoped_refptr<DataChannelInterface> data_channel) {}
|
void OnIceConnectionChange(
|
||||||
virtual void OnRenegotiationNeeded() {}
|
PeerConnectionInterface::IceConnectionState new_state) override {}
|
||||||
virtual void OnIceConnectionChange(
|
void OnIceGatheringChange(
|
||||||
PeerConnectionInterface::IceConnectionState new_state) {}
|
PeerConnectionInterface::IceGatheringState new_state) override {}
|
||||||
virtual void OnIceGatheringChange(
|
void OnIceCandidate(
|
||||||
PeerConnectionInterface::IceGatheringState new_state) {}
|
const webrtc::IceCandidateInterface* candidate) override {}
|
||||||
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@ -547,26 +547,6 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
|
|||||||
EXPECT_EQ(pc_->signaling_state(), new_state);
|
EXPECT_EQ(pc_->signaling_state(), new_state);
|
||||||
state_ = new_state;
|
state_ = new_state;
|
||||||
}
|
}
|
||||||
// TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
|
|
||||||
virtual void OnStateChange(StateType state_changed) {
|
|
||||||
if (pc_.get() == NULL)
|
|
||||||
return;
|
|
||||||
switch (state_changed) {
|
|
||||||
case kSignalingState:
|
|
||||||
// OnSignalingChange and OnStateChange(kSignalingState) should always
|
|
||||||
// be called approximately simultaneously. To ease testing, we require
|
|
||||||
// that they always be called in that order. This check verifies
|
|
||||||
// that OnSignalingChange has just been called.
|
|
||||||
EXPECT_EQ(pc_->signaling_state(), state_);
|
|
||||||
break;
|
|
||||||
case kIceState:
|
|
||||||
ADD_FAILURE();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ADD_FAILURE();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MediaStreamInterface* RemoteStream(const std::string& label) {
|
MediaStreamInterface* RemoteStream(const std::string& label) {
|
||||||
return remote_streams_->find(label);
|
return remote_streams_->find(label);
|
||||||
|
|||||||
@ -50,27 +50,24 @@ class PeerConnectionTestWrapper
|
|||||||
const webrtc::DataChannelInit& init);
|
const webrtc::DataChannelInit& init);
|
||||||
|
|
||||||
// Implements PeerConnectionObserver.
|
// Implements PeerConnectionObserver.
|
||||||
virtual void OnSignalingChange(
|
void OnSignalingChange(
|
||||||
webrtc::PeerConnectionInterface::SignalingState new_state) {}
|
webrtc::PeerConnectionInterface::SignalingState new_state) override {}
|
||||||
virtual void OnStateChange(
|
void OnAddStream(
|
||||||
webrtc::PeerConnectionObserver::StateType state_changed) {}
|
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) override;
|
||||||
virtual void OnAddStream(
|
void OnRemoveStream(
|
||||||
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream);
|
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) override {}
|
||||||
virtual void OnRemoveStream(
|
void OnDataChannel(
|
||||||
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {}
|
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) override ;
|
||||||
virtual void OnDataChannel(
|
void OnRenegotiationNeeded() override {}
|
||||||
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel);
|
void OnIceConnectionChange(
|
||||||
virtual void OnRenegotiationNeeded() {}
|
webrtc::PeerConnectionInterface::IceConnectionState new_state) override {}
|
||||||
virtual void OnIceConnectionChange(
|
void OnIceGatheringChange(
|
||||||
webrtc::PeerConnectionInterface::IceConnectionState new_state) {}
|
webrtc::PeerConnectionInterface::IceGatheringState new_state) override {}
|
||||||
virtual void OnIceGatheringChange(
|
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override;
|
||||||
webrtc::PeerConnectionInterface::IceGatheringState new_state) {}
|
|
||||||
virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate);
|
|
||||||
virtual void OnIceComplete() {}
|
|
||||||
|
|
||||||
// Implements CreateSessionDescriptionObserver.
|
// Implements CreateSessionDescriptionObserver.
|
||||||
virtual void OnSuccess(webrtc::SessionDescriptionInterface* desc);
|
void OnSuccess(webrtc::SessionDescriptionInterface* desc) override;
|
||||||
virtual void OnFailure(const std::string& error) {}
|
void OnFailure(const std::string& error) override {}
|
||||||
|
|
||||||
void CreateOffer(const webrtc::MediaConstraintsInterface* constraints);
|
void CreateOffer(const webrtc::MediaConstraintsInterface* constraints);
|
||||||
void CreateAnswer(const webrtc::MediaConstraintsInterface* constraints);
|
void CreateAnswer(const webrtc::MediaConstraintsInterface* constraints);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user