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

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..e5a9f43c90ff7ec0e5c9a669763d08f447bd988f 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -610,8 +610,14 @@ void PresentationServiceDelegateImpl::ListenForSessionMessages(
int render_process_id,
int render_frame_id,
const PresentationSessionMessageCallback& message_cb) {
- // BUG=464205
- NOTIMPLEMENTED();
+ const auto& route_ids = frame_manager_->GetRouteIds(
imcheng (use chromium acct) 2015/06/22 21:08:07 Please spell out the type instead of using auto he
haibinlu 2015/06/22 23:22:40 Done.
+ RenderFrameHostId(render_process_id, render_frame_id));
+ if (route_ids.size() == 0) {
imcheng (use chromium acct) 2015/06/22 21:08:07 nit: if (route_ids.empty())
haibinlu 2015/06/22 23:22:40 Done.
+ DVLOG(1) << "No media routes found";
+ return;
imcheng (use chromium acct) 2015/06/22 21:08:07 It looks like the callback need to be invoked in t
haibinlu 2015/06/22 23:22:40 Done.
+ }
+
+ router_->ListenForRouteMessages(route_ids, message_cb);
}
void PresentationServiceDelegateImpl::SendMessage(
@@ -619,8 +625,20 @@ void PresentationServiceDelegateImpl::SendMessage(
int render_frame_id,
scoped_ptr<content::PresentationSessionMessage> message_request,
const SendMessageCallback& send_message_cb) {
- // BUG=464205
- 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) << "Presentation session was already closed: "
imcheng (use chromium acct) 2015/06/22 21:08:07 nit: maybe "Presentation session does not exist: "
haibinlu 2015/06/22 23:22:41 Done.
+ << message_request->presentation_id;
+ return;
imcheng (use chromium acct) 2015/06/22 21:08:07 ditto on invoking the callback in early returns he
haibinlu 2015/06/22 23:22:40 Done.
+ }
+ if (message_request->is_binary()) {
+ DVLOG(1) << "Binary message is not supported yet.";
+ return;
+ }
+ router_->SendRouteMessage(route_id, *(message_request->message.get()),
Kevin M 2015/06/22 22:42:26 .get() is unnecessary here.
haibinlu 2015/06/22 23:22:40 Done.
+ 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