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

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

Issue 1245213002: [MediaRouter] Implement send binary message from PSDImpl to MRPManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass scoped_ptr<>, avoid copying Created 5 years, 5 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
Index: chrome/browser/media/router/media_router_mojo_impl.cc
diff --git a/chrome/browser/media/router/media_router_mojo_impl.cc b/chrome/browser/media/router/media_router_mojo_impl.cc
index 976b0eeb70d8ccfb8e3a220ef0bc170bc2c08eff..eb9dfceb4638901b04163168d258315e31d604a6 100644
--- a/chrome/browser/media/router/media_router_mojo_impl.cc
+++ b/chrome/browser/media/router/media_router_mojo_impl.cc
@@ -244,6 +244,17 @@ void MediaRouterMojoImpl::SendRouteMessage(
base::Unretained(this), route_id, message, callback));
}
+void MediaRouterMojoImpl::SendRouteBinaryMessage(
+ const MediaRoute::Id& route_id,
+ scoped_ptr<std::vector<uint8>> data,
+ const SendRouteMessageCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoSendSessionBinaryMessage,
+ base::Unretained(this), route_id, data.get(),
haibinlu 2015/07/28 18:57:19 data.Pass()
USE s.singapati at gmail.com 2015/07/28 19:11:46 Then DoSendSessionBinaryMessage() has to take scop
Kevin M 2015/07/28 20:03:36 Use base::Passed(data.Pass()). If you just pass t
USE s.singapati at gmail.com 2015/07/29 11:22:01 Done.
+ callback));
+}
+
void MediaRouterMojoImpl::ListenForRouteMessages(
const std::vector<MediaRoute::Id>& route_ids,
const PresentationSessionMessageCallback& message_cb) {
@@ -378,6 +389,17 @@ void MediaRouterMojoImpl::DoSendSessionMessage(
media_route_provider_->SendRouteMessage(route_id, message, callback);
}
+void MediaRouterMojoImpl::DoSendSessionBinaryMessage(
+ const MediaRoute::Id& route_id,
+ std::vector<uint8>* data,
+ const SendRouteMessageCallback& callback) {
+ DVLOG_WITH_INSTANCE(1) << "SendRouteBinaryMessage " << route_id;
+ mojo::Array<uint8> mojo_array;
+ mojo_array.Swap(data);
+ media_route_provider_->SendRouteBinaryMessage(route_id, mojo_array.Pass(),
+ callback);
+}
+
void MediaRouterMojoImpl::DoListenForRouteMessages(
const std::vector<MediaRoute::Id>& route_ids,
const PresentationSessionMessageCallback& message_cb) {
« no previous file with comments | « chrome/browser/media/router/media_router_mojo_impl.h ('k') | chrome/browser/media/router/media_router_mojo_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698