Commit 7be284bd authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename SignallingSender to SignalingSender

Rename SignallingSender to SignalingSender to use the same naming as the spec.

Bug: 1044584
Change-Id: Ieef65c03931f159f05019ee0799c789320bc164d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2331762Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Commit-Queue: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Cr-Commit-Position: refs/heads/master@{#794780}
parent 2e8dea38
......@@ -47,7 +47,7 @@ class FakeSharingMojoService : public sharing::mojom::Sharing {
// sharing::mojom::Sharing:
void CreateSharingWebRtcConnection(
mojo::PendingRemote<sharing::mojom::SignallingSender>,
mojo::PendingRemote<sharing::mojom::SignalingSender>,
mojo::PendingReceiver<sharing::mojom::SignallingReceiver>,
mojo::PendingRemote<sharing::mojom::SharingWebRtcConnectionDelegate>,
mojo::PendingReceiver<sharing::mojom::SharingWebRtcConnection>,
......
......@@ -148,7 +148,7 @@ void OnMessageSent(
} // namespace
struct SharingWebRtcMojoPipes {
MojoPipe<sharing::mojom::SignallingSender> signalling_sender;
MojoPipe<sharing::mojom::SignalingSender> signaling_sender;
MojoPipe<sharing::mojom::SignallingReceiver> signalling_receiver;
MojoPipe<sharing::mojom::SharingWebRtcConnectionDelegate> delegate;
MojoPipe<sharing::mojom::SharingWebRtcConnection> connection;
......@@ -266,7 +266,7 @@ SharingWebRtcConnectionHost* SharingServiceHost::CreateConnection(
auto pipes = std::make_unique<SharingWebRtcMojoPipes>();
auto signalling_host = std::make_unique<WebRtcSignallingHostFCM>(
std::move(pipes->signalling_sender.receiver),
std::move(pipes->signaling_sender.receiver),
std::move(pipes->signalling_receiver.remote), message_sender_,
CreateDeviceInfo(device_guid, fcm_configuration, device_source_));
......@@ -312,7 +312,7 @@ void SharingServiceHost::OnIceServersReceived(
}
sharing_utility_service_->CreateSharingWebRtcConnection(
std::move(pipes->signalling_sender.remote),
std::move(pipes->signaling_sender.remote),
std::move(pipes->signalling_receiver.receiver),
std::move(pipes->delegate.remote), std::move(pipes->connection.receiver),
std::move(pipes->socket_manager.remote),
......
......@@ -38,7 +38,7 @@ class FakeSharingMojoService : public sharing::mojom::Sharing,
// sharing::mojom::Sharing:
void CreateSharingWebRtcConnection(
mojo::PendingRemote<sharing::mojom::SignallingSender> signalling_sender,
mojo::PendingRemote<sharing::mojom::SignalingSender> signaling_sender,
mojo::PendingReceiver<sharing::mojom::SignallingReceiver>
signalling_receiver,
mojo::PendingRemote<sharing::mojom::SharingWebRtcConnectionDelegate>
......
......@@ -52,7 +52,7 @@ class MockSignallingHost : public WebRtcSignallingHostFCM {
public:
MockSignallingHost()
: WebRtcSignallingHostFCM(
mojo::PendingReceiver<sharing::mojom::SignallingSender>(),
mojo::PendingReceiver<sharing::mojom::SignalingSender>(),
mojo::PendingRemote<sharing::mojom::SignallingReceiver>(),
/*message_sender=*/nullptr,
CreateFakeDeviceInfo("id", "name")) {}
......
......@@ -12,13 +12,13 @@
#include "chrome/browser/sharing/sharing_send_message_result.h"
WebRtcSignallingHostFCM::WebRtcSignallingHostFCM(
mojo::PendingReceiver<sharing::mojom::SignallingSender> signalling_sender,
mojo::PendingReceiver<sharing::mojom::SignalingSender> signaling_sender,
mojo::PendingRemote<sharing::mojom::SignallingReceiver> signalling_receiver,
SharingMessageSender* message_sender,
std::unique_ptr<syncer::DeviceInfo> device_info)
: message_sender_(message_sender),
device_info_(std::move(device_info)),
signalling_sender_(this, std::move(signalling_sender)),
signaling_sender_(this, std::move(signaling_sender)),
signalling_receiver_(std::move(signalling_receiver)) {
DCHECK(device_info_);
}
......
......@@ -19,12 +19,12 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
// Handles the signalling part of a WebRTC connection via FCM. The signalling
// Handles the signaling part of a WebRTC connection via FCM. The signaling
// messages are sent via the |message_sender| to |device_info| through FCM.
class WebRtcSignallingHostFCM : public sharing::mojom::SignallingSender {
class WebRtcSignallingHostFCM : public sharing::mojom::SignalingSender {
public:
WebRtcSignallingHostFCM(
mojo::PendingReceiver<sharing::mojom::SignallingSender> signalling_sender,
mojo::PendingReceiver<sharing::mojom::SignalingSender> signaling_sender,
mojo::PendingRemote<sharing::mojom::SignallingReceiver>
signalling_receiver,
SharingMessageSender* message_sender,
......@@ -33,7 +33,7 @@ class WebRtcSignallingHostFCM : public sharing::mojom::SignallingSender {
WebRtcSignallingHostFCM& operator=(const WebRtcSignallingHostFCM&) = delete;
~WebRtcSignallingHostFCM() override;
// sharing::mojom::SignallingSender:
// sharing::mojom::SignalingSender:
void SendOffer(const std::string& offer, SendOfferCallback callback) override;
void SendIceCandidates(
std::vector<sharing::mojom::IceCandidatePtr> ice_candidates) override;
......@@ -53,7 +53,7 @@ class WebRtcSignallingHostFCM : public sharing::mojom::SignallingSender {
SharingMessageSender* message_sender_;
std::unique_ptr<syncer::DeviceInfo> device_info_;
mojo::Receiver<sharing::mojom::SignallingSender> signalling_sender_;
mojo::Receiver<sharing::mojom::SignalingSender> signaling_sender_;
mojo::Remote<sharing::mojom::SignallingReceiver> signalling_receiver_;
base::WeakPtrFactory<WebRtcSignallingHostFCM> weak_ptr_factory_{this};
......
......@@ -29,7 +29,7 @@ class MockSignallingService : public sharing::mojom::SignallingReceiver {
MOCK_METHOD1(OnIceCandidatesReceived,
void(std::vector<sharing::mojom::IceCandidatePtr>));
mojo::Remote<sharing::mojom::SignallingSender> signalling_sender;
mojo::Remote<sharing::mojom::SignalingSender> signaling_sender;
mojo::Receiver<sharing::mojom::SignallingReceiver> signalling_receiver{this};
};
......@@ -73,7 +73,7 @@ class WebRtcSignallingHostFCMTest : public testing::Test {
MockSharingMessageSender message_sender_;
MockSignallingService signalling_service_;
WebRtcSignallingHostFCM signalling_host_{
signalling_service_.signalling_sender.BindNewPipeAndPassReceiver(),
signalling_service_.signaling_sender.BindNewPipeAndPassReceiver(),
signalling_service_.signalling_receiver.BindNewPipeAndPassRemote(),
&message_sender_, CreateFakeDeviceInfo("id", "name")};
......
......@@ -14,8 +14,8 @@ import "services/network/public/mojom/mdns_responder.mojom";
// and is used by the browser process to offload unsafe protocol parsing.
interface Sharing {
// Creates a new Sharing connection via WebRTC.
// Signalling of WebRTC is done OOB by the browser using the
// |signalling_sender| and |signalling_receiver| interfaces.
// Signaling of WebRTC is done OOB by the browser using the |signaling_sender|
// and |signalling_receiver| interfaces.
// WebRTC messages to and from the browser process are handled via the
// |delegate| and |connection| interfaces.
// All network communication is handled by the |socket_manager| and
......@@ -23,7 +23,7 @@ interface Sharing {
// |ice_servers| contains the list of ICE servers to be used to establish a
// connection.
CreateSharingWebRtcConnection(
pending_remote<SignallingSender> signalling_sender,
pending_remote<SignalingSender> signaling_sender,
pending_receiver<SignallingReceiver> signalling_receiver,
pending_remote<SharingWebRtcConnectionDelegate> delegate,
pending_receiver<SharingWebRtcConnection> connection,
......
......@@ -7,7 +7,7 @@ module sharing.mojom;
import "url/mojom/url.mojom";
// Represents an ICE candidate as defined in RFC 5245. These will be exchanged
// OOB via the SignallingSender and SignallingReceiver interfaces.
// OOB via the SignalingSender and SignallingReceiver interfaces.
struct IceCandidate {
// Represents the remote address to connect to as defined in RFC 5245 # 15.1.
string candidate;
......@@ -42,9 +42,9 @@ interface IceConfigFetcher {
GetIceServers() => (array<IceServer> ice_servers);
};
// Signalling sender interface used to exchange offer / answer pairs and a list
// Signaling sender interface used to exchange offer / answer pairs and a list
// of ICE candidates OOB. Implemented in the browser process.
interface SignallingSender {
interface SignalingSender {
// Sends an offer to the remote expecting an answer in response. The content
// of both is in SDP format.
SendOffer(string offer) => (string answer);
......
......@@ -23,7 +23,7 @@ SharingImpl::SharingImpl(mojo::PendingReceiver<mojom::Sharing> receiver)
SharingImpl::~SharingImpl() = default;
void SharingImpl::CreateSharingWebRtcConnection(
mojo::PendingRemote<mojom::SignallingSender> signalling_sender,
mojo::PendingRemote<mojom::SignalingSender> signaling_sender,
mojo::PendingReceiver<mojom::SignallingReceiver> signalling_receiver,
mojo::PendingRemote<mojom::SharingWebRtcConnectionDelegate> delegate,
mojo::PendingReceiver<mojom::SharingWebRtcConnection> connection,
......@@ -36,7 +36,7 @@ void SharingImpl::CreateSharingWebRtcConnection(
// base::Unretained is safe as the |peer_connection| is owned by |this|.
auto sharing_connection = std::make_unique<SharingWebRtcConnection>(
webrtc_peer_connection_factory_.get(), std::move(ice_servers),
std::move(signalling_sender), std::move(signalling_receiver),
std::move(signaling_sender), std::move(signalling_receiver),
std::move(delegate), std::move(connection), std::move(socket_manager),
std::move(mdns_responder),
base::BindOnce(&SharingImpl::SharingWebRtcConnectionDisconnected,
......
......@@ -53,7 +53,7 @@ class SharingImpl : public mojom::Sharing {
// mojom::Sharing:
void CreateSharingWebRtcConnection(
mojo::PendingRemote<mojom::SignallingSender> signalling_sender,
mojo::PendingRemote<mojom::SignalingSender> signaling_sender,
mojo::PendingReceiver<mojom::SignallingReceiver> signalling_receiver,
mojo::PendingRemote<mojom::SharingWebRtcConnectionDelegate> delegate,
mojo::PendingReceiver<mojom::SharingWebRtcConnection> connection,
......
......@@ -41,7 +41,7 @@ class SharingImplTest : public testing::Test {
std::unique_ptr<MockSharingConnectionHost> CreateWebRtcConnection() {
auto connection = std::make_unique<MockSharingConnectionHost>();
service_->CreateSharingWebRtcConnection(
connection->signalling_sender.BindNewPipeAndPassRemote(),
connection->signaling_sender.BindNewPipeAndPassRemote(),
connection->signalling_receiver.BindNewPipeAndPassReceiver(),
connection->delegate.BindNewPipeAndPassRemote(),
connection->connection.BindNewPipeAndPassReceiver(),
......
......@@ -149,7 +149,7 @@ namespace sharing {
SharingWebRtcConnection::SharingWebRtcConnection(
webrtc::PeerConnectionFactoryInterface* connection_factory,
const std::vector<mojom::IceServerPtr>& ice_servers,
mojo::PendingRemote<mojom::SignallingSender> signalling_sender,
mojo::PendingRemote<mojom::SignalingSender> signaling_sender,
mojo::PendingReceiver<mojom::SignallingReceiver> signalling_receiver,
mojo::PendingRemote<mojom::SharingWebRtcConnectionDelegate> delegate,
mojo::PendingReceiver<mojom::SharingWebRtcConnection> connection,
......@@ -157,7 +157,7 @@ SharingWebRtcConnection::SharingWebRtcConnection(
mojo::PendingRemote<network::mojom::MdnsResponder> mdns_responder,
base::OnceCallback<void(SharingWebRtcConnection*)> on_disconnect)
: signalling_receiver_(this, std::move(signalling_receiver)),
signalling_sender_(std::move(signalling_sender)),
signaling_sender_(std::move(signaling_sender)),
connection_(this, std::move(connection)),
delegate_(std::move(delegate)),
p2p_socket_manager_(std::move(socket_manager)),
......@@ -175,7 +175,7 @@ SharingWebRtcConnection::SharingWebRtcConnection(
rtc_config.servers.push_back(ice_turn_server);
}
signalling_sender_.set_disconnect_handler(
signaling_sender_.set_disconnect_handler(
base::BindOnce(&SharingWebRtcConnection::CloseConnection,
weak_ptr_factory_.GetWeakPtr()));
delegate_.set_disconnect_handler(
......@@ -559,7 +559,7 @@ void SharingWebRtcConnection::OnOfferCreated(const std::string& sdp,
timing_recorder_.LogEvent(WebRtcTimingEvent::kOfferCreated);
signalling_sender_->SendOffer(
signaling_sender_->SendOffer(
sdp, base::BindOnce(&SharingWebRtcConnection::OnAnswerReceived,
weak_ptr_factory_.GetWeakPtr()));
}
......@@ -641,7 +641,7 @@ void SharingWebRtcConnection::CloseConnection() {
queued_messages_.pop();
}
signalling_sender_.reset();
signaling_sender_.reset();
delegate_.reset();
// Close DataChannel if necessary.
......@@ -718,7 +718,7 @@ void SharingWebRtcConnection::HandlePendingIceCandidates() {
}
if (!local_ice_candidates_.empty()) {
signalling_sender_->SendIceCandidates(std::move(local_ice_candidates_));
signaling_sender_->SendIceCandidates(std::move(local_ice_candidates_));
local_ice_candidates_.clear();
}
}
......
......@@ -34,7 +34,7 @@ namespace sharing {
class IpcPacketSocketFactory;
// Manages a WebRTC PeerConnection. Signalling is handled via the passed sender
// Manages a WebRTC PeerConnection. Signaling is handled via the passed sender
// and receiver. All network communication is handled by the network service via
// the passed P2PSocketManager and MdnsResponder pipes. All methods of this
// class are called on the same thread and the PeerConnectionFactory is setup to
......@@ -47,7 +47,7 @@ class SharingWebRtcConnection : public mojom::SignallingReceiver,
SharingWebRtcConnection(
webrtc::PeerConnectionFactoryInterface* connection_factory,
const std::vector<mojom::IceServerPtr>& ice_servers,
mojo::PendingRemote<mojom::SignallingSender> signalling_sender,
mojo::PendingRemote<mojom::SignalingSender> signaling_sender,
mojo::PendingReceiver<mojom::SignallingReceiver> signalling_receiver,
mojo::PendingRemote<mojom::SharingWebRtcConnectionDelegate> delegate,
mojo::PendingReceiver<mojom::SharingWebRtcConnection> connection,
......@@ -132,7 +132,7 @@ class SharingWebRtcConnection : public mojom::SignallingReceiver,
const rtc::scoped_refptr<const webrtc::RTCStatsReport>& report);
mojo::Receiver<mojom::SignallingReceiver> signalling_receiver_;
mojo::Remote<mojom::SignallingSender> signalling_sender_;
mojo::Remote<mojom::SignalingSender> signaling_sender_;
mojo::Receiver<mojom::SharingWebRtcConnection> connection_;
mojo::Remote<mojom::SharingWebRtcConnectionDelegate> delegate_;
mojo::Remote<network::mojom::P2PSocketManager> p2p_socket_manager_;
......
......@@ -35,7 +35,7 @@ class SharingClient {
base::OnceCallback<void(sharing::SharingWebRtcConnection*)> on_disconnect)
: connection_(pc_factory,
/*ice_servers=*/{},
host_.signalling_sender.BindNewPipeAndPassRemote(),
host_.signaling_sender.BindNewPipeAndPassRemote(),
host_.signalling_receiver.BindNewPipeAndPassReceiver(),
host_.delegate.BindNewPipeAndPassRemote(),
host_.connection.BindNewPipeAndPassReceiver(),
......
......@@ -173,7 +173,7 @@ class SharingWebRtcConnectionTest : public testing::Test {
connection_ = std::make_unique<SharingWebRtcConnection>(
mock_webrtc_pc_factory_.get(), std::vector<mojom::IceServerPtr>(),
connection_host_.signalling_sender.BindNewPipeAndPassRemote(),
connection_host_.signaling_sender.BindNewPipeAndPassRemote(),
connection_host_.signalling_receiver.BindNewPipeAndPassReceiver(),
connection_host_.delegate.BindNewPipeAndPassRemote(),
connection_host_.connection.BindNewPipeAndPassReceiver(),
......
......@@ -14,7 +14,7 @@
namespace sharing {
class MockSharingConnectionHost : public mojom::SignallingSender,
class MockSharingConnectionHost : public mojom::SignalingSender,
public mojom::SharingWebRtcConnectionDelegate,
public network::mojom::P2PSocketManager,
public network::mojom::MdnsResponder {
......@@ -25,7 +25,7 @@ class MockSharingConnectionHost : public mojom::SignallingSender,
delete;
~MockSharingConnectionHost() override;
// mojom::SignallingSender:
// mojom::SignalingSender:
MOCK_METHOD2(SendOffer, void(const std::string&, SendOfferCallback));
MOCK_METHOD1(SendIceCandidates, void(std::vector<mojom::IceCandidatePtr>));
......@@ -52,7 +52,7 @@ class MockSharingConnectionHost : public mojom::SignallingSender,
MOCK_METHOD2(RemoveNameForAddress,
void(const ::net::IPAddress&, RemoveNameForAddressCallback));
mojo::Receiver<mojom::SignallingSender> signalling_sender{this};
mojo::Receiver<mojom::SignalingSender> signaling_sender{this};
mojo::Remote<mojom::SignallingReceiver> signalling_receiver;
mojo::Receiver<mojom::SharingWebRtcConnectionDelegate> delegate{this};
mojo::Remote<mojom::SharingWebRtcConnection> connection;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment