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

Side by Side Diff: chrome/browser/media/router/media_router_mojo_impl.h

Issue 1383653002: MediaRouterAction: Only observe Media Routes when there is a local route. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override; 131 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override;
132 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override; 132 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override;
133 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override; 133 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override;
134 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override; 134 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override;
135 void RegisterIssuesObserver(IssuesObserver* observer) override; 135 void RegisterIssuesObserver(IssuesObserver* observer) override;
136 void UnregisterIssuesObserver(IssuesObserver* observer) override; 136 void UnregisterIssuesObserver(IssuesObserver* observer) override;
137 void RegisterPresentationSessionMessagesObserver( 137 void RegisterPresentationSessionMessagesObserver(
138 PresentationSessionMessagesObserver* observer) override; 138 PresentationSessionMessagesObserver* observer) override;
139 void UnregisterPresentationSessionMessagesObserver( 139 void UnregisterPresentationSessionMessagesObserver(
140 PresentationSessionMessagesObserver* observer) override; 140 PresentationSessionMessagesObserver* observer) override;
141 void RegisterLocalMediaRoutesObserver(
142 LocalMediaRoutesObserver* observer) override;
143 void UnregisterLocalMediaRoutesObserver(
144 LocalMediaRoutesObserver* observer) override;
141 145
142 // These calls invoke methods in the component extension via Mojo. 146 // These calls invoke methods in the component extension via Mojo.
143 void DoCreateRoute(const MediaSource::Id& source_id, 147 void DoCreateRoute(const MediaSource::Id& source_id,
144 const MediaSink::Id& sink_id, 148 const MediaSink::Id& sink_id,
145 const std::string& origin, 149 const std::string& origin,
146 int tab_id, 150 int tab_id,
147 const std::vector<MediaRouteResponseCallback>& callbacks); 151 const std::vector<MediaRouteResponseCallback>& callbacks);
148 void DoJoinRoute(const MediaSource::Id& source_id, 152 void DoJoinRoute(const MediaSource::Id& source_id,
149 const std::string& presentation_id, 153 const std::string& presentation_id,
150 const std::string& origin, 154 const std::string& origin,
(...skipping 29 matching lines...) Expand all
180 // interfaces::MediaRouter implementation. 184 // interfaces::MediaRouter implementation.
181 void RegisterMediaRouteProvider( 185 void RegisterMediaRouteProvider(
182 interfaces::MediaRouteProviderPtr media_route_provider_ptr, 186 interfaces::MediaRouteProviderPtr media_route_provider_ptr,
183 const interfaces::MediaRouter::RegisterMediaRouteProviderCallback& 187 const interfaces::MediaRouter::RegisterMediaRouteProviderCallback&
184 callback) override; 188 callback) override;
185 void OnIssue(interfaces::IssuePtr issue) override; 189 void OnIssue(interfaces::IssuePtr issue) override;
186 void OnSinksReceived(const mojo::String& media_source, 190 void OnSinksReceived(const mojo::String& media_source,
187 mojo::Array<interfaces::MediaSinkPtr> sinks) override; 191 mojo::Array<interfaces::MediaSinkPtr> sinks) override;
188 void OnRoutesUpdated(mojo::Array<interfaces::MediaRoutePtr> routes) override; 192 void OnRoutesUpdated(mojo::Array<interfaces::MediaRoutePtr> routes) override;
189 193
194 // Converts the callback result of calling Mojo CreateRoute()/JoinRoute()
195 // into a local callback.
196 void RouteResponseReceived(
197 const std::string& presentation_id,
198 const std::vector<MediaRouteResponseCallback>& callbacks,
199 interfaces::MediaRoutePtr media_route,
200 const mojo::String& error_text);
201
190 // Pending requests queued to be executed once component extension 202 // Pending requests queued to be executed once component extension
191 // becomes ready. 203 // becomes ready.
192 std::vector<base::Closure> pending_requests_; 204 std::vector<base::Closure> pending_requests_;
193 205
194 base::ScopedPtrHashMap<MediaSource::Id, 206 base::ScopedPtrHashMap<MediaSource::Id,
195 scoped_ptr<base::ObserverList<MediaSinksObserver>>> 207 scoped_ptr<base::ObserverList<MediaSinksObserver>>>
196 sinks_observers_; 208 sinks_observers_;
197 209
210 base::ObserverList<LocalMediaRoutesObserver> local_routes_observers_;
211
198 base::ObserverList<MediaRoutesObserver> routes_observers_; 212 base::ObserverList<MediaRoutesObserver> routes_observers_;
199 213
200 using PresentationSessionMessagesObserverList = 214 using PresentationSessionMessagesObserverList =
201 base::ObserverList<PresentationSessionMessagesObserver>; 215 base::ObserverList<PresentationSessionMessagesObserver>;
202 base::ScopedPtrHashMap<MediaRoute::Id, 216 base::ScopedPtrHashMap<MediaRoute::Id,
203 scoped_ptr<PresentationSessionMessagesObserverList>> 217 scoped_ptr<PresentationSessionMessagesObserverList>>
204 messages_observers_; 218 messages_observers_;
205 // IDs of MediaRoutes being listened for messages. Note that this is 219 // IDs of MediaRoutes being listened for messages. Note that this is
206 // different from |message_observers_| because we might be waiting for 220 // different from |message_observers_| because we might be waiting for
207 // |OnRouteMessagesReceived()| to be invoked after all observers for that 221 // |OnRouteMessagesReceived()| to be invoked after all observers for that
(...skipping 27 matching lines...) Expand all
235 std::string instance_id_; 249 std::string instance_id_;
236 250
237 base::ThreadChecker thread_checker_; 251 base::ThreadChecker thread_checker_;
238 252
239 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); 253 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl);
240 }; 254 };
241 255
242 } // namespace media_router 256 } // namespace media_router
243 257
244 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ 258 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698