| Index: chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| index d0d1a196c72cee8927de24a58b59776342306123..257c801716529f8cc65bdbeff4ad23eda90ed4ca 100644
|
| --- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| +++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| @@ -75,8 +75,9 @@ class PresentationSessionMessagesObserver : public RouteMessageObserver {
|
| // |message_cb|: The callback to invoke whenever messages are received.
|
| // |route_id|: ID of MediaRoute to listen for messages.
|
| PresentationSessionMessagesObserver(
|
| - MediaRouter* router, const MediaRoute::Id& route_id,
|
| - const content::PresentationSessionMessageCallback& message_cb)
|
| + MediaRouter* router,
|
| + const MediaRoute::Id& route_id,
|
| + const content::PresentationConnectionMessageCallback& message_cb)
|
| : RouteMessageObserver(router, route_id), message_cb_(message_cb) {
|
| DCHECK(!message_cb_.is_null());
|
| }
|
| @@ -85,15 +86,17 @@ class PresentationSessionMessagesObserver : public RouteMessageObserver {
|
|
|
| void OnMessagesReceived(const std::vector<RouteMessage>& messages) final {
|
| DVLOG(2) << __func__ << ", number of messages : " << messages.size();
|
| - ScopedVector<content::PresentationSessionMessage> presentation_messages;
|
| + ScopedVector<content::PresentationConnectionMessage> presentation_messages;
|
| for (const RouteMessage& message : messages) {
|
| if (message.type == RouteMessage::TEXT && message.text) {
|
| - presentation_messages.push_back(new content::PresentationSessionMessage(
|
| - content::PresentationMessageType::TEXT));
|
| + presentation_messages.push_back(
|
| + new content::PresentationConnectionMessage(
|
| + content::PresentationMessageType::TEXT));
|
| presentation_messages.back()->message = *message.text;
|
| } else if (message.type == RouteMessage::BINARY && message.binary) {
|
| - presentation_messages.push_back(new content::PresentationSessionMessage(
|
| - content::PresentationMessageType::ARRAY_BUFFER));
|
| + presentation_messages.push_back(
|
| + new content::PresentationConnectionMessage(
|
| + content::PresentationMessageType::BINARY));
|
| presentation_messages.back()->data.reset(
|
| new std::vector<uint8_t>(*message.binary));
|
| }
|
| @@ -104,7 +107,7 @@ class PresentationSessionMessagesObserver : public RouteMessageObserver {
|
| }
|
|
|
| private:
|
| - const content::PresentationSessionMessageCallback message_cb_;
|
| + const content::PresentationConnectionMessageCallback message_cb_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PresentationSessionMessagesObserver);
|
| };
|
| @@ -138,7 +141,7 @@ class PresentationFrame {
|
| state_changed_cb);
|
| void ListenForSessionMessages(
|
| const content::PresentationSessionInfo& session,
|
| - const content::PresentationSessionMessageCallback& message_cb);
|
| + const content::PresentationConnectionMessageCallback& message_cb);
|
|
|
| void Reset();
|
| void RemoveConnection(const std::string& presentation_id,
|
| @@ -309,7 +312,7 @@ void PresentationFrame::ListenForConnectionStateChange(
|
|
|
| void PresentationFrame::ListenForSessionMessages(
|
| const content::PresentationSessionInfo& session,
|
| - const content::PresentationSessionMessageCallback& message_cb) {
|
| + const content::PresentationConnectionMessageCallback& message_cb) {
|
| auto it = presentation_id_to_route_id_.find(session.presentation_id);
|
| if (it == presentation_id_to_route_id_.end()) {
|
| DVLOG(2) << "ListenForSessionMessages: no route for "
|
| @@ -361,7 +364,7 @@ class PresentationFrameManager {
|
| void ListenForSessionMessages(
|
| const RenderFrameHostId& render_frame_host_id,
|
| const content::PresentationSessionInfo& session,
|
| - const content::PresentationSessionMessageCallback& message_cb);
|
| + const content::PresentationConnectionMessageCallback& message_cb);
|
|
|
| // Sets or clears the default presentation request and callback for the given
|
| // frame. Also sets / clears the default presentation requests for the owning
|
| @@ -534,7 +537,7 @@ void PresentationFrameManager::ListenForConnectionStateChange(
|
| void PresentationFrameManager::ListenForSessionMessages(
|
| const RenderFrameHostId& render_frame_host_id,
|
| const content::PresentationSessionInfo& session,
|
| - const content::PresentationSessionMessageCallback& message_cb) {
|
| + const content::PresentationConnectionMessageCallback& message_cb) {
|
| const auto it = presentation_frames_.find(render_frame_host_id);
|
| if (it == presentation_frames_.end()) {
|
| DVLOG(2) << "ListenForSessionMessages: PresentationFrame does not exist "
|
| @@ -881,11 +884,11 @@ void PresentationServiceDelegateImpl::Terminate(
|
| frame_manager_->RemoveConnection(rfh_id, presentation_id, route_id);
|
| }
|
|
|
| -void PresentationServiceDelegateImpl::ListenForSessionMessages(
|
| +void PresentationServiceDelegateImpl::ListenForConnectionMessages(
|
| int render_process_id,
|
| int render_frame_id,
|
| const content::PresentationSessionInfo& session,
|
| - const content::PresentationSessionMessageCallback& message_cb) {
|
| + const content::PresentationConnectionMessageCallback& message_cb) {
|
| frame_manager_->ListenForSessionMessages(
|
| RenderFrameHostId(render_process_id, render_frame_id), session,
|
| message_cb);
|
| @@ -895,7 +898,7 @@ void PresentationServiceDelegateImpl::SendMessage(
|
| int render_process_id,
|
| int render_frame_id,
|
| const content::PresentationSessionInfo& session,
|
| - std::unique_ptr<content::PresentationSessionMessage> message,
|
| + std::unique_ptr<content::PresentationConnectionMessage> message,
|
| const SendMessageCallback& send_message_cb) {
|
| const MediaRoute::Id& route_id = frame_manager_->GetRouteId(
|
| RenderFrameHostId(render_process_id, render_frame_id),
|
|
|