OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ |
7 | 7 |
8 #include "chrome/browser/media/router/media_route.h" | 8 #include "chrome/browser/media/router/media_route.h" |
9 #include "content/public/browser/presentation_service_delegate.h" | 9 #include "content/public/browser/presentation_service_delegate.h" |
10 #include "content/public/common/presentation_connection_message.h" | 10 #include "content/public/common/presentation_connection_message.h" |
11 #include "content/public/common/presentation_session.h" | 11 #include "content/public/common/presentation_info.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
13 | 13 |
14 namespace media_router { | 14 namespace media_router { |
15 | 15 |
16 class MediaRouter; | 16 class MediaRouter; |
17 | 17 |
18 // This class represents a browser side PresentationConnection. It connects with | 18 // This class represents a browser side PresentationConnection. It connects with |
19 // PresentationConnection owned by a render frame to enable message exchange. | 19 // PresentationConnection owned by a render frame to enable message exchange. |
20 // Message received on this class is further routed to Media Router. State of | 20 // Message received on this class is further routed to Media Router. State of |
21 // browser side PresentationConnection is always 'connected'. | 21 // browser side PresentationConnection is always 'connected'. |
22 // | 22 // |
23 // |SetTargetConnection| sets |target_connection_| to mojo handle of | 23 // |SetTargetConnection| sets |target_connection_| to mojo handle of |
24 // PresentationConnection object owned a render frame, and transits state of | 24 // PresentationConnection object owned a render frame, and transits state of |
25 // |target_connection_| to 'connected'. | 25 // |target_connection_| to 'connected'. |
26 // | 26 // |
27 // Send message from render frame to media router: | 27 // Send message from render frame to media router: |
28 // PresentationConnection::sendString(); | 28 // PresentationConnection::sendString(); |
29 // -> PresentationDispatcher::DoSendMessage(); | 29 // -> PresentationDispatcher::DoSendMessage(); |
30 // -> PresentationConnectionProxy::SendSessionMessage(); | 30 // -> PresentationConnectionProxy::SendConnectionMessage(); |
31 // --> (mojo call to browser side PresentationConnection) | 31 // --> (mojo call to browser side PresentationConnection) |
32 // -> BrowserPresentationConnectionProxy::OnMessage(); | 32 // -> BrowserPresentationConnectionProxy::OnMessage(); |
33 // -> MediaRouter::SendRouteMessage(); | 33 // -> MediaRouter::SendRouteMessage(); |
34 // | 34 // |
35 // Instance of this class is only created for remotely rendered presentations. | 35 // Instance of this class is only created for remotely rendered presentations. |
36 // It is owned by PresentationFrame. When PresentationFrame gets destroyed or | 36 // It is owned by PresentationFrame. When PresentationFrame gets destroyed or |
37 // |route_| is closed or terminated, instance of this class will be destroyed. | 37 // |route_| is closed or terminated, instance of this class will be destroyed. |
38 | 38 |
39 class BrowserPresentationConnectionProxy | 39 class BrowserPresentationConnectionProxy |
40 : public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) { | 40 : public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 MediaRouter* const router_; | 72 MediaRouter* const router_; |
73 const MediaRoute::Id route_id_; | 73 const MediaRoute::Id route_id_; |
74 | 74 |
75 mojo::Binding<blink::mojom::PresentationConnection> binding_; | 75 mojo::Binding<blink::mojom::PresentationConnection> binding_; |
76 blink::mojom::PresentationConnectionPtr target_connection_ptr_; | 76 blink::mojom::PresentationConnectionPtr target_connection_ptr_; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace media_router | 79 } // namespace media_router |
80 | 80 |
81 #endif // CHROME_BROWSER_MEDIA_ROUTER_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ | 81 #endif // CHROME_BROWSER_MEDIA_ROUTER_BROWSER_PRESENTATION_CONNECTION_PROXY_H_ |
OLD | NEW |