| 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_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // MediaRouter implementation. | 67 // MediaRouter implementation. |
| 68 // Execution of the requests is delegated to the Do* methods, which can be | 68 // Execution of the requests is delegated to the Do* methods, which can be |
| 69 // enqueued for later use if the extension is temporarily suspended. | 69 // enqueued for later use if the extension is temporarily suspended. |
| 70 void CreateRoute(const MediaSource::Id& source_id, | 70 void CreateRoute(const MediaSource::Id& source_id, |
| 71 const MediaSink::Id& sink_id, | 71 const MediaSink::Id& sink_id, |
| 72 const GURL& origin, | 72 const GURL& origin, |
| 73 content::WebContents* web_contents, | 73 content::WebContents* web_contents, |
| 74 const std::vector<MediaRouteResponseCallback>& callbacks, | 74 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 75 base::TimeDelta timeout, | 75 base::TimeDelta timeout, |
| 76 bool off_the_record) override; | 76 bool incognito) override; |
| 77 void JoinRoute(const MediaSource::Id& source_id, | 77 void JoinRoute(const MediaSource::Id& source_id, |
| 78 const std::string& presentation_id, | 78 const std::string& presentation_id, |
| 79 const GURL& origin, | 79 const GURL& origin, |
| 80 content::WebContents* web_contents, | 80 content::WebContents* web_contents, |
| 81 const std::vector<MediaRouteResponseCallback>& callbacks, | 81 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 82 base::TimeDelta timeout, | 82 base::TimeDelta timeout, |
| 83 bool off_the_record) override; | 83 bool incognito) override; |
| 84 void ConnectRouteByRouteId( | 84 void ConnectRouteByRouteId( |
| 85 const MediaSource::Id& source, | 85 const MediaSource::Id& source, |
| 86 const MediaRoute::Id& route_id, | 86 const MediaRoute::Id& route_id, |
| 87 const GURL& origin, | 87 const GURL& origin, |
| 88 content::WebContents* web_contents, | 88 content::WebContents* web_contents, |
| 89 const std::vector<MediaRouteResponseCallback>& callbacks, | 89 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 90 base::TimeDelta timeout, | 90 base::TimeDelta timeout, |
| 91 bool off_the_record) override; | 91 bool incognito) override; |
| 92 void TerminateRoute(const MediaRoute::Id& route_id) override; | 92 void TerminateRoute(const MediaRoute::Id& route_id) override; |
| 93 void DetachRoute(const MediaRoute::Id& route_id) override; | 93 void DetachRoute(const MediaRoute::Id& route_id) override; |
| 94 void SendRouteMessage(const MediaRoute::Id& route_id, | 94 void SendRouteMessage(const MediaRoute::Id& route_id, |
| 95 const std::string& message, | 95 const std::string& message, |
| 96 const SendRouteMessageCallback& callback) override; | 96 const SendRouteMessageCallback& callback) override; |
| 97 void SendRouteBinaryMessage( | 97 void SendRouteBinaryMessage( |
| 98 const MediaRoute::Id& route_id, | 98 const MediaRoute::Id& route_id, |
| 99 std::unique_ptr<std::vector<uint8_t>> data, | 99 std::unique_ptr<std::vector<uint8_t>> data, |
| 100 const SendRouteMessageCallback& callback) override; | 100 const SendRouteMessageCallback& callback) override; |
| 101 void AddIssue(const Issue& issue) override; | 101 void AddIssue(const Issue& issue) override; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void UnregisterPresentationSessionMessagesObserver( | 229 void UnregisterPresentationSessionMessagesObserver( |
| 230 PresentationSessionMessagesObserver* observer) override; | 230 PresentationSessionMessagesObserver* observer) override; |
| 231 | 231 |
| 232 // These calls invoke methods in the component extension via Mojo. | 232 // These calls invoke methods in the component extension via Mojo. |
| 233 void DoCreateRoute(const MediaSource::Id& source_id, | 233 void DoCreateRoute(const MediaSource::Id& source_id, |
| 234 const MediaSink::Id& sink_id, | 234 const MediaSink::Id& sink_id, |
| 235 const std::string& origin, | 235 const std::string& origin, |
| 236 int tab_id, | 236 int tab_id, |
| 237 const std::vector<MediaRouteResponseCallback>& callbacks, | 237 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 238 base::TimeDelta timeout, | 238 base::TimeDelta timeout, |
| 239 bool off_the_record); | 239 bool incognito); |
| 240 void DoJoinRoute(const MediaSource::Id& source_id, | 240 void DoJoinRoute(const MediaSource::Id& source_id, |
| 241 const std::string& presentation_id, | 241 const std::string& presentation_id, |
| 242 const std::string& origin, | 242 const std::string& origin, |
| 243 int tab_id, | 243 int tab_id, |
| 244 const std::vector<MediaRouteResponseCallback>& callbacks, | 244 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 245 base::TimeDelta timeout, | 245 base::TimeDelta timeout, |
| 246 bool off_the_record); | 246 bool incognito); |
| 247 void DoConnectRouteByRouteId( | 247 void DoConnectRouteByRouteId( |
| 248 const MediaSource::Id& source_id, | 248 const MediaSource::Id& source_id, |
| 249 const MediaRoute::Id& route_id, | 249 const MediaRoute::Id& route_id, |
| 250 const std::string& origin, | 250 const std::string& origin, |
| 251 int tab_id, | 251 int tab_id, |
| 252 const std::vector<MediaRouteResponseCallback>& callbacks, | 252 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 253 base::TimeDelta timeout, | 253 base::TimeDelta timeout, |
| 254 bool off_the_record); | 254 bool incognito); |
| 255 void DoTerminateRoute(const MediaRoute::Id& route_id); | 255 void DoTerminateRoute(const MediaRoute::Id& route_id); |
| 256 void DoDetachRoute(const MediaRoute::Id& route_id); | 256 void DoDetachRoute(const MediaRoute::Id& route_id); |
| 257 void DoSendSessionMessage(const MediaRoute::Id& route_id, | 257 void DoSendSessionMessage(const MediaRoute::Id& route_id, |
| 258 const std::string& message, | 258 const std::string& message, |
| 259 const SendRouteMessageCallback& callback); | 259 const SendRouteMessageCallback& callback); |
| 260 void DoSendSessionBinaryMessage(const MediaRoute::Id& route_id, | 260 void DoSendSessionBinaryMessage(const MediaRoute::Id& route_id, |
| 261 std::unique_ptr<std::vector<uint8_t>> data, | 261 std::unique_ptr<std::vector<uint8_t>> data, |
| 262 const SendRouteMessageCallback& callback); | 262 const SendRouteMessageCallback& callback); |
| 263 void DoListenForRouteMessages(const MediaRoute::Id& route_id); | 263 void DoListenForRouteMessages(const MediaRoute::Id& route_id); |
| 264 void DoStopListeningForRouteMessages(const MediaRoute::Id& route_id); | 264 void DoStopListeningForRouteMessages(const MediaRoute::Id& route_id); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 interfaces::MediaRouter::PresentationConnectionState state) override; | 304 interfaces::MediaRouter::PresentationConnectionState state) override; |
| 305 void OnPresentationConnectionClosed( | 305 void OnPresentationConnectionClosed( |
| 306 const mojo::String& route_id, | 306 const mojo::String& route_id, |
| 307 interfaces::MediaRouter::PresentationConnectionCloseReason reason, | 307 interfaces::MediaRouter::PresentationConnectionCloseReason reason, |
| 308 const mojo::String& message) override; | 308 const mojo::String& message) override; |
| 309 | 309 |
| 310 // Converts the callback result of calling Mojo CreateRoute()/JoinRoute() | 310 // Converts the callback result of calling Mojo CreateRoute()/JoinRoute() |
| 311 // into a local callback. | 311 // into a local callback. |
| 312 void RouteResponseReceived( | 312 void RouteResponseReceived( |
| 313 const std::string& presentation_id, | 313 const std::string& presentation_id, |
| 314 bool off_the_record, | 314 bool incognito, |
| 315 const std::vector<MediaRouteResponseCallback>& callbacks, | 315 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 316 interfaces::MediaRoutePtr media_route, | 316 interfaces::MediaRoutePtr media_route, |
| 317 mojo::String error_text, | 317 mojo::String error_text, |
| 318 interfaces::RouteRequestResultCode result_code); | 318 interfaces::RouteRequestResultCode result_code); |
| 319 | 319 |
| 320 // Callback invoked by |event_page_tracker_| after an attempt to wake the | 320 // Callback invoked by |event_page_tracker_| after an attempt to wake the |
| 321 // component extension. If |success| is false, the pending request queue is | 321 // component extension. If |success| is false, the pending request queue is |
| 322 // drained. | 322 // drained. |
| 323 void EventPageWakeComplete(bool success); | 323 void EventPageWakeComplete(bool success); |
| 324 | 324 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 #endif | 434 #endif |
| 435 | 435 |
| 436 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; | 436 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; |
| 437 | 437 |
| 438 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 438 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
| 439 }; | 439 }; |
| 440 | 440 |
| 441 } // namespace media_router | 441 } // namespace media_router |
| 442 | 442 |
| 443 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 443 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
| OLD | NEW |