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_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 18 matching lines...) Expand all Loading... | |
| 29 base::Callback<void(scoped_ptr<MediaRoute>, const std::string&)>; | 29 base::Callback<void(scoped_ptr<MediaRoute>, const std::string&)>; |
| 30 | 30 |
| 31 // An interface for handling resources related to media routing. | 31 // An interface for handling resources related to media routing. |
| 32 // Responsible for registering observers for receiving sink availability | 32 // Responsible for registering observers for receiving sink availability |
| 33 // updates, handling route requests/responses, and operating on routes (e.g. | 33 // updates, handling route requests/responses, and operating on routes (e.g. |
| 34 // posting messages or closing). | 34 // posting messages or closing). |
| 35 class MediaRouter { | 35 class MediaRouter { |
| 36 public: | 36 public: |
| 37 virtual ~MediaRouter() {} | 37 virtual ~MediaRouter() {} |
| 38 | 38 |
| 39 // Requests a media route from |source| to |sink_id|. | 39 // Requests a media route from |source| to |sink_id|. |
|
Wez
2015/05/20 17:51:45
nit: Rephrase the comment to match the request->cr
imcheng (use chromium acct)
2015/05/20 22:01:11
Done. It only creates a new route. We will have a
| |
| 40 // |callback| is invoked with a response indicating success or failure. | 40 // |callback| is invoked with a response indicating success or failure. |
| 41 virtual void RequestRoute(const MediaSourceId& source, | 41 virtual void CreateRoute(const MediaSourceId& source, |
| 42 const MediaSinkId& sink_id, | 42 const MediaSinkId& sink_id, |
| 43 const MediaRouteResponseCallback& callback) = 0; | 43 const MediaRouteResponseCallback& callback) = 0; |
| 44 | 44 |
| 45 // Closes the media route specified by |route_id|. | 45 // Closes the media route specified by |route_id|. |
| 46 virtual void CloseRoute(const MediaRouteId& route_id) = 0; | 46 virtual void CloseRoute(const MediaRouteId& route_id) = 0; |
| 47 | 47 |
| 48 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. | 48 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. |
| 49 // TODO(imcheng): Support additional data types: Blob, ArrayBuffer, | 49 // TODO(imcheng): Support additional data types: Blob, ArrayBuffer, |
| 50 // ArrayBufferView. | 50 // ArrayBufferView. |
| 51 virtual void PostMessage(const MediaRouteId& route_id, | 51 virtual void PostMessage(const MediaRouteId& route_id, |
| 52 const std::string& message) = 0; | 52 const std::string& message) = 0; |
| 53 | 53 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 virtual bool RegisterMediaRoutesObserver(MediaRoutesObserver* observer) = 0; | 92 virtual bool RegisterMediaRoutesObserver(MediaRoutesObserver* observer) = 0; |
| 93 | 93 |
| 94 // Removes a previously added MediaRoutesObserver. |observer| will stop | 94 // Removes a previously added MediaRoutesObserver. |observer| will stop |
| 95 // receiving further updates. | 95 // receiving further updates. |
| 96 virtual void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) = 0; | 96 virtual void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) = 0; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace media_router | 99 } // namespace media_router |
| 100 | 100 |
| 101 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 101 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |