Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 public: | 161 public: |
| 162 MediaSinksQuery(); | 162 MediaSinksQuery(); |
| 163 ~MediaSinksQuery(); | 163 ~MediaSinksQuery(); |
| 164 | 164 |
| 165 // True if the query has been sent to the MRPM. | 165 // True if the query has been sent to the MRPM. |
| 166 bool is_active = false; | 166 bool is_active = false; |
| 167 | 167 |
| 168 // True if cached result is available. | 168 // True if cached result is available. |
| 169 bool has_cached_result = false; | 169 bool has_cached_result = false; |
| 170 | 170 |
| 171 GURL origin; | |
| 172 | |
| 171 // Cached list of sinks for the query, if |has_cached_result| is true. | 173 // Cached list of sinks for the query, if |has_cached_result| is true. |
| 172 // Empty otherwise. | 174 // Empty otherwise. |
| 173 std::vector<MediaSink> cached_sink_list; | 175 std::vector<MediaSink> cached_sink_list; |
| 174 base::ObserverList<MediaSinksObserver> observers; | 176 base::ObserverList<MediaSinksObserver> observers; |
| 175 DISALLOW_COPY_AND_ASSIGN(MediaSinksQuery); | 177 DISALLOW_COPY_AND_ASSIGN(MediaSinksQuery); |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 struct MediaRoutesQuery { | 180 struct MediaRoutesQuery { |
| 179 public: | 181 public: |
| 180 MediaRoutesQuery(); | 182 MediaRoutesQuery(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 void DoTerminateRoute(const MediaRoute::Id& route_id); | 250 void DoTerminateRoute(const MediaRoute::Id& route_id); |
| 249 void DoDetachRoute(const MediaRoute::Id& route_id); | 251 void DoDetachRoute(const MediaRoute::Id& route_id); |
| 250 void DoSendSessionMessage(const MediaRoute::Id& route_id, | 252 void DoSendSessionMessage(const MediaRoute::Id& route_id, |
| 251 const std::string& message, | 253 const std::string& message, |
| 252 const SendRouteMessageCallback& callback); | 254 const SendRouteMessageCallback& callback); |
| 253 void DoSendSessionBinaryMessage(const MediaRoute::Id& route_id, | 255 void DoSendSessionBinaryMessage(const MediaRoute::Id& route_id, |
| 254 scoped_ptr<std::vector<uint8_t>> data, | 256 scoped_ptr<std::vector<uint8_t>> data, |
| 255 const SendRouteMessageCallback& callback); | 257 const SendRouteMessageCallback& callback); |
| 256 void DoListenForRouteMessages(const MediaRoute::Id& route_id); | 258 void DoListenForRouteMessages(const MediaRoute::Id& route_id); |
| 257 void DoStopListeningForRouteMessages(const MediaRoute::Id& route_id); | 259 void DoStopListeningForRouteMessages(const MediaRoute::Id& route_id); |
| 258 void DoStartObservingMediaSinks(const MediaSource::Id& source_id); | 260 void DoStartObservingMediaSinks(const MediaSource::Id& source_id, |
| 261 const GURL& origin); | |
| 259 void DoStopObservingMediaSinks(const MediaSource::Id& source_id); | 262 void DoStopObservingMediaSinks(const MediaSource::Id& source_id); |
| 260 void DoStartObservingMediaRoutes(const MediaSource::Id& source_id); | 263 void DoStartObservingMediaRoutes(const MediaSource::Id& source_id); |
| 261 void DoStopObservingMediaRoutes(const MediaSource::Id& source_id); | 264 void DoStopObservingMediaRoutes(const MediaSource::Id& source_id); |
| 262 | 265 |
| 263 // Invoked when the next batch of messages arrives. | 266 // Invoked when the next batch of messages arrives. |
| 264 // |route_id|: ID of route of the messages. | 267 // |route_id|: ID of route of the messages. |
| 265 // |messages|: A list of messages received. | 268 // |messages|: A list of messages received. |
| 266 // |error|: true if an error occurred. | 269 // |error|: true if an error occurred. |
| 267 void OnRouteMessagesReceived( | 270 void OnRouteMessagesReceived( |
| 268 const MediaRoute::Id& route_id, | 271 const MediaRoute::Id& route_id, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 // we record the first such reason. | 323 // we record the first such reason. |
| 321 void SetWakeReason(MediaRouteProviderWakeReason reason); | 324 void SetWakeReason(MediaRouteProviderWakeReason reason); |
| 322 | 325 |
| 323 // Clears the wake reason after the extension has been awoken. | 326 // Clears the wake reason after the extension has been awoken. |
| 324 void ClearWakeReason(); | 327 void ClearWakeReason(); |
| 325 | 328 |
| 326 // Pending requests queued to be executed once component extension | 329 // Pending requests queued to be executed once component extension |
| 327 // becomes ready. | 330 // becomes ready. |
| 328 std::deque<base::Closure> pending_requests_; | 331 std::deque<base::Closure> pending_requests_; |
| 329 | 332 |
| 330 base::ScopedPtrHashMap<MediaSource::Id, scoped_ptr<MediaSinksQuery>> | 333 base::ScopedPtrHashMap<MediaSource::Id, scoped_ptr<MediaSinksQuery>> |
|
imcheng
2016/02/16 20:54:18
since queries with same source and different origi
matt.boetger
2016/03/03 05:42:22
Done.
| |
| 331 sinks_queries_; | 334 sinks_queries_; |
| 332 | 335 |
| 333 base::ScopedPtrHashMap<MediaSource::Id, scoped_ptr<MediaRoutesQuery>> | 336 base::ScopedPtrHashMap<MediaSource::Id, scoped_ptr<MediaRoutesQuery>> |
| 334 routes_queries_; | 337 routes_queries_; |
| 335 | 338 |
| 336 base::ObserverList<LocalMediaRoutesObserver> local_routes_observers_; | 339 base::ObserverList<LocalMediaRoutesObserver> local_routes_observers_; |
| 337 | 340 |
| 338 using PresentationSessionMessagesObserverList = | 341 using PresentationSessionMessagesObserverList = |
| 339 base::ObserverList<PresentationSessionMessagesObserver>; | 342 base::ObserverList<PresentationSessionMessagesObserver>; |
| 340 base::ScopedPtrHashMap<MediaRoute::Id, | 343 base::ScopedPtrHashMap<MediaRoute::Id, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 MediaRouteProviderWakeReason current_wake_reason_; | 393 MediaRouteProviderWakeReason current_wake_reason_; |
| 391 | 394 |
| 392 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; | 395 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; |
| 393 | 396 |
| 394 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 397 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
| 395 }; | 398 }; |
| 396 | 399 |
| 397 } // namespace media_router | 400 } // namespace media_router |
| 398 | 401 |
| 399 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ | 402 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ |
| OLD | NEW |