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

Unified Diff: chrome/browser/media/router/mojo/media_router_mojo_impl.h

Issue 2111303003: [Media Router] Replace route messaging API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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/mojo/media_router_mojo_impl.h
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.h b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
index 075fa1f2768629b9f0c16c75854f21cbe54d934a..0b70d72a5f932196e64a6c3c203750810f710d8e 100644
--- a/chrome/browser/media/router/mojo/media_router_mojo_impl.h
+++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
@@ -136,6 +136,10 @@ class MediaRouterMojoImpl : public MediaRouterBase,
RegisterAndUnregisterMediaSinksObserverWithAvailabilityChange);
FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
RegisterAndUnregisterMediaRoutesObserver);
+ FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
+ PresentationSessionMessagesSingleObserver);
+ FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
+ PresentationSessionMessagesMultipleObservers);
FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest, HandleIssue);
FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoExtensionTest,
DeferredBindingAndSuspension);
@@ -261,7 +265,7 @@ class MediaRouterMojoImpl : public MediaRouterBase,
void DoSendSessionBinaryMessage(const MediaRoute::Id& route_id,
std::unique_ptr<std::vector<uint8_t>> data,
const SendRouteMessageCallback& callback);
- void DoListenForRouteMessages(const MediaRoute::Id& route_id);
+ void DoStartListeningForRouteMessages(const MediaRoute::Id& route_id);
void DoStopListeningForRouteMessages(const MediaRoute::Id& route_id);
void DoStartObservingMediaSinks(const MediaSource::Id& source_id);
void DoStopObservingMediaSinks(const MediaSource::Id& source_id);
@@ -274,15 +278,6 @@ class MediaRouterMojoImpl : public MediaRouterBase,
const std::string& domain,
const MediaSinkSearchResponseCallback& sink_callback);
- // Invoked when the next batch of messages arrives.
- // |route_id|: ID of route of the messages.
- // |messages|: A list of messages received.
- // |error|: true if an error occurred.
- void OnRouteMessagesReceived(
- const MediaRoute::Id& route_id,
- mojo::Array<interfaces::RouteMessagePtr> messages,
- bool error);
-
// Error handler callback for |binding_| and |media_route_provider_|.
void OnConnectionError();
@@ -307,6 +302,9 @@ class MediaRouterMojoImpl : public MediaRouterBase,
const mojo::String& route_id,
interfaces::MediaRouter::PresentationConnectionCloseReason reason,
const mojo::String& message) override;
+ void OnRouteMessagesReceived(
+ const mojo::String& route_id,
+ mojo::Array<interfaces::RouteMessagePtr> messages) override;
// Converts the callback result of calling Mojo CreateRoute()/JoinRoute()
// into a local callback.
@@ -378,12 +376,6 @@ class MediaRouterMojoImpl : public MediaRouterBase,
std::unique_ptr<PresentationSessionMessagesObserverList>>
messages_observers_;
- // IDs of MediaRoutes being listened for messages. Note that this is
- // different from |message_observers_| because we might be waiting for
- // |OnRouteMessagesReceived()| to be invoked after all observers for that
- // route have been removed.
- std::set<MediaRoute::Id> route_ids_listening_for_messages_;
-
IssueManager issue_manager_;
// Binds |this| to a Mojo connection stub for interfaces::MediaRouter.
« no previous file with comments | « chrome/browser/media/router/mojo/media_router.mojom ('k') | chrome/browser/media/router/mojo/media_router_mojo_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698