| Index: content/renderer/presentation/presentation_dispatcher.cc
|
| diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc
|
| index 2fe43611da2e17e4247c9eb1f10e6426bcb41cc2..f2279044d8490f0aac5246d81765c15549d3b28d 100644
|
| --- a/content/renderer/presentation/presentation_dispatcher.cc
|
| +++ b/content/renderer/presentation/presentation_dispatcher.cc
|
| @@ -535,14 +535,8 @@ void PresentationDispatcher::OnDefaultPresentationStarted(
|
| presentation_info.presentation_url,
|
| blink::WebString::FromUTF8(presentation_info.presentation_id)));
|
|
|
| - if (connection) {
|
| + if (connection)
|
| SetControllerConnection(presentation_info, connection);
|
| - // Change blink connection state to 'connected' before listening to
|
| - // connection message. Remove ListenForConnectionMessage() after
|
| - // TODO(crbug.com/687011): use BrowserPresentationConnectionProxy to send
|
| - // message from route to blink connection.
|
| - presentation_service_->ListenForConnectionMessages(presentation_info);
|
| - }
|
| }
|
|
|
| void PresentationDispatcher::OnConnectionCreated(
|
| @@ -562,12 +556,7 @@ void PresentationDispatcher::OnConnectionCreated(
|
| callback->OnSuccess(blink::WebPresentationInfo(
|
| presentation_info->presentation_url,
|
| blink::WebString::FromUTF8(presentation_info->presentation_id)));
|
| - // Change blink connection state to 'connected' before listening to
|
| - // connection message. Remove ListenForConnectionMessage() after
|
| - // TODO(crbug.com/687011): use BrowserPresentationConnectionProxy to send
|
| - // message from route to blink connection.
|
| SetControllerConnection(presentation_info.value(), callback->GetConnection());
|
| - presentation_service_->ListenForConnectionMessages(presentation_info.value());
|
| }
|
|
|
| void PresentationDispatcher::OnReceiverConnectionAvailable(
|
| @@ -619,32 +608,6 @@ void PresentationDispatcher::OnConnectionClosed(
|
| blink::WebString::FromUTF8(message));
|
| }
|
|
|
| -void PresentationDispatcher::OnConnectionMessagesReceived(
|
| - const PresentationInfo& presentation_info,
|
| - std::vector<PresentationConnectionMessage> messages) {
|
| - if (!controller_)
|
| - return;
|
| -
|
| - for (size_t i = 0; i < messages.size(); ++i) {
|
| - // Note: Passing batches of messages to the Blink layer would be more
|
| - // efficient.
|
| - auto web_presentation_info = blink::WebPresentationInfo(
|
| - presentation_info.presentation_url,
|
| - blink::WebString::FromUTF8(presentation_info.presentation_id));
|
| -
|
| - if (messages[i].is_binary()) {
|
| - controller_->DidReceiveConnectionBinaryMessage(
|
| - web_presentation_info, &(messages[i].data->front()),
|
| - messages[i].data->size());
|
| - } else {
|
| - DCHECK(messages[i].message);
|
| - controller_->DidReceiveConnectionTextMessage(
|
| - web_presentation_info,
|
| - blink::WebString::FromUTF8(*messages[i].message));
|
| - }
|
| - }
|
| -}
|
| -
|
| void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() {
|
| if (presentation_service_.get())
|
| return;
|
|
|