| Index: chrome/browser/media/router/media_source.cc
|
| diff --git a/chrome/browser/media/router/media_source.cc b/chrome/browser/media/router/media_source.cc
|
| index 87b4d78788759bd58db0d1b8e166dc5903e0011a..a5d56360136315775f1275be35e4f4eb5e23d3bd 100644
|
| --- a/chrome/browser/media/router/media_source.cc
|
| +++ b/chrome/browser/media/router/media_source.cc
|
| @@ -8,7 +8,8 @@
|
|
|
| namespace media_router {
|
|
|
| -MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) {
|
| +MediaSource::MediaSource(const MediaSource::Id& source_id) :
|
| + id_(source_id), origin_("") {
|
| }
|
|
|
| MediaSource::MediaSource() {
|
| @@ -20,8 +21,28 @@ MediaSource::Id MediaSource::id() const {
|
| return id_;
|
| }
|
|
|
| +std::string MediaSource::origin() const {
|
| + return origin_;
|
| +}
|
| +
|
| +void MediaSource::set_origin(std::string origin) {
|
| + origin_ = origin;
|
| +}
|
| +
|
| +bool MediaSource::operator==(const MediaSource& other) const {
|
| + return Equals(other);
|
| +}
|
| +
|
| +bool MediaSource::operator<(const MediaSource& other) const {
|
| + if (id_ == other.id()) {
|
| + return origin_ < other.origin();
|
| + } else {
|
| + return id_ < other.id();
|
| + }
|
| +}
|
| +
|
| bool MediaSource::Equals(const MediaSource& other) const {
|
| - return id_ == other.id();
|
| + return id_ == other.id() && origin_ == other.origin();
|
| }
|
|
|
| bool MediaSource::Empty() const {
|
|
|