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_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const MediaSource::Id& source, | 74 const MediaSource::Id& source, |
75 const std::string& presentation_id, | 75 const std::string& presentation_id, |
76 const GURL& origin, | 76 const GURL& origin, |
77 int tab_id, | 77 int tab_id, |
78 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 78 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
79 | 79 |
80 // Closes the media route specified by |route_id|. | 80 // Closes the media route specified by |route_id|. |
81 virtual void CloseRoute(const MediaRoute::Id& route_id) = 0; | 81 virtual void CloseRoute(const MediaRoute::Id& route_id) = 0; |
82 | 82 |
83 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. | 83 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. |
84 // TODO(imcheng): Support additional data types: Blob, ArrayBuffer, | |
85 // ArrayBufferView. | |
86 virtual void SendRouteMessage(const MediaRoute::Id& route_id, | 84 virtual void SendRouteMessage(const MediaRoute::Id& route_id, |
87 const std::string& message, | 85 const std::string& message, |
88 const SendRouteMessageCallback& callback) = 0; | 86 const SendRouteMessageCallback& callback) = 0; |
89 | 87 |
| 88 // Sends |data| to a MediaSink connected via MediaRoute with |route_id|. |
| 89 virtual void SendRouteBinaryMessage( |
| 90 const MediaRoute::Id& route_id, |
| 91 const std::vector<uint8_t>& data, |
| 92 const SendRouteMessageCallback& callback) = 0; |
| 93 |
90 // Gets the next batch of messages from one of the routes in |route_ids|. | 94 // Gets the next batch of messages from one of the routes in |route_ids|. |
91 // |message_cb|: Invoked with a non-empty list of messages when there are | 95 // |message_cb|: Invoked with a non-empty list of messages when there are |
92 // messages, an empty list when messaging channel had error. | 96 // messages, an empty list when messaging channel had error. |
93 // It is not invoked until there are messages available or error. | 97 // It is not invoked until there are messages available or error. |
94 virtual void ListenForRouteMessages( | 98 virtual void ListenForRouteMessages( |
95 const std::vector<MediaRoute::Id>& route_ids, | 99 const std::vector<MediaRoute::Id>& route_ids, |
96 const PresentationSessionMessageCallback& message_cb) = 0; | 100 const PresentationSessionMessageCallback& message_cb) = 0; |
97 | 101 |
98 // Clears the issue with the id |issue_id|. | 102 // Clears the issue with the id |issue_id|. |
99 virtual void ClearIssue(const Issue::Id& issue_id) = 0; | 103 virtual void ClearIssue(const Issue::Id& issue_id) = 0; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // in undefined behavior. | 143 // in undefined behavior. |
140 virtual void RegisterIssuesObserver(IssuesObserver* observer) = 0; | 144 virtual void RegisterIssuesObserver(IssuesObserver* observer) = 0; |
141 | 145 |
142 // Removes the IssuesObserver |observer|. | 146 // Removes the IssuesObserver |observer|. |
143 virtual void UnregisterIssuesObserver(IssuesObserver* observer) = 0; | 147 virtual void UnregisterIssuesObserver(IssuesObserver* observer) = 0; |
144 }; | 148 }; |
145 | 149 |
146 } // namespace media_router | 150 } // namespace media_router |
147 | 151 |
148 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 152 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
OLD | NEW |