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_SINK_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/media/router/media_route_id.h" | 10 #include "chrome/browser/media/router/media_route_id.h" |
11 | 11 |
12 namespace media_router { | 12 namespace media_router { |
13 | 13 |
14 using MediaSinkId = std::string; | 14 using MediaSinkId = std::string; |
15 | 15 |
16 // Represents a sink to which media can be routed. | 16 // Represents a sink to which media can be routed. |
17 class MediaSink { | 17 class MediaSink { |
18 public: | 18 public: |
19 // |sink_id|: Unique identifier for the MediaSink. | 19 // |sink_id|: Unique identifier for the MediaSink. |
20 // |name|: Descriptive name of the MediaSink. | 20 // |name|: Descriptive name of the MediaSink. |
21 // Optional, can use an empty string if no sink name is available. | |
21 MediaSink(const MediaSinkId& sink_id, | 22 MediaSink(const MediaSinkId& sink_id, |
22 const std::string& name); | 23 const std::string& name); |
24 | |
25 // Constructs an empty MediaSink. | |
26 MediaSink(); | |
xhwang
2015/04/06 20:51:31
What's the use case of an empty MediaSink?
imcheng
2015/04/06 21:54:20
Removed for now.
| |
27 | |
23 ~MediaSink(); | 28 ~MediaSink(); |
24 | 29 |
25 const MediaSinkId& sink_id() const { return sink_id_; } | 30 const MediaSinkId& id() const { return sink_id_; } |
26 const std::string& name() const { return name_; } | 31 const std::string& name() const { return name_; } |
27 | 32 |
28 bool Equals(const MediaSink& other) const; | 33 bool Equals(const MediaSink& other) const; |
34 bool Empty() const; | |
29 | 35 |
30 private: | 36 private: |
31 const MediaSinkId sink_id_; | 37 MediaSinkId sink_id_; |
32 const std::string name_; | 38 std::string name_; |
xhwang
2015/04/06 20:51:31
Here and for all other classes, consider DISALLOW_
xhwang
2015/04/06 20:51:31
Why drop the "const", is MediaSink() mutable now?
xhwang
2015/04/06 20:51:31
These are both strings. What's the difference?
imcheng
2015/04/06 21:54:20
From the API perspective MediaSink is still immuta
imcheng
2015/04/06 21:54:20
The ID is internal to the system and is what the c
imcheng
2015/04/06 21:54:20
These need to be copyable because they are put int
| |
33 }; | 39 }; |
34 | 40 |
35 } // namespace media_router | 41 } // namespace media_router |
36 | 42 |
37 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ | 43 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
OLD | NEW |