Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1791)

Unified Diff: chrome/browser/media/router/media_source.cc

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/router/media_source.h ('k') | chrome/browser/media/router/media_source_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/browser/media/router/media_source.h ('k') | chrome/browser/media/router/media_source_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698