Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2255)

Unified Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 1199933006: [MediaRouter] wireup send/receive messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 07917eabc8c88c2d3c2df41473d02943694e49a5..434784adf2a5952592ada96b4a409137cf751280 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -610,8 +610,17 @@ void PresentationServiceDelegateImpl::ListenForSessionMessages(
int render_process_id,
int render_frame_id,
const PresentationSessionMessageCallback& message_cb) {
- // BUG=464205
- NOTIMPLEMENTED();
+ const std::vector<MediaRoute::Id>& route_ids = frame_manager_->GetRouteIds(
+ RenderFrameHostId(render_process_id, render_frame_id));
+ if (route_ids.empty()) {
+ DVLOG(1) << "No media routes found";
+ scoped_ptr<ScopedVector<content::PresentationSessionMessage>> empty_list(
+ new ScopedVector<content::PresentationSessionMessage>());
+ message_cb.Run(empty_list.Pass());
imcheng (use chromium acct) 2015/06/23 21:59:37 why not just message_cb.Run(scoped_ptr<ScopedVecto
haibinlu 2015/06/23 23:36:14 Done.
+ return;
+ }
+
+ router_->ListenForRouteMessages(route_ids, message_cb);
}
void PresentationServiceDelegateImpl::SendMessage(
@@ -619,8 +628,19 @@ void PresentationServiceDelegateImpl::SendMessage(
int render_frame_id,
scoped_ptr<content::PresentationSessionMessage> message_request,
const SendMessageCallback& send_message_cb) {
- // BUG=464205
- NOTIMPLEMENTED();
+ if (message_request->is_binary()) {
imcheng (use chromium acct) 2015/06/23 21:59:37 Also need to run callback and return early in this
haibinlu 2015/06/23 23:36:14 Done.
+ NOTIMPLEMENTED();
+ }
+ const MediaRoute::Id& route_id = frame_manager_->GetRouteId(
+ RenderFrameHostId(render_process_id, render_frame_id),
+ message_request->presentation_id);
+ if (route_id.empty()) {
+ DVLOG(1) << "No active route for " << message_request->presentation_id;
+ send_message_cb.Run(false);
+ return;
+ }
+ router_->SendRouteMessage(route_id, *(message_request->message),
+ send_message_cb);
}
void PresentationServiceDelegateImpl::OnRouteCreated(const MediaRoute& route) {
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698