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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/media/router/media_source.h" 5 #include "chrome/browser/media/router/media_source.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 namespace media_router { 9 namespace media_router {
10 10
11 MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) { 11 MediaSource::MediaSource(const MediaSource::Id& source_id) :
12 id_(source_id), origin_("") {
12 } 13 }
13 14
14 MediaSource::MediaSource() { 15 MediaSource::MediaSource() {
15 } 16 }
16 17
17 MediaSource::~MediaSource() {} 18 MediaSource::~MediaSource() {}
18 19
19 MediaSource::Id MediaSource::id() const { 20 MediaSource::Id MediaSource::id() const {
20 return id_; 21 return id_;
21 } 22 }
22 23
24 std::string MediaSource::origin() const {
25 return origin_;
26 }
27
28 void MediaSource::set_origin(std::string origin) {
29 origin_ = origin;
30 }
31
32 bool MediaSource::operator==(const MediaSource& other) const {
33 return Equals(other);
34 }
35
36 bool MediaSource::operator<(const MediaSource& other) const {
37 if (id_ == other.id()) {
38 return origin_ < other.origin();
39 } else {
40 return id_ < other.id();
41 }
42 }
43
23 bool MediaSource::Equals(const MediaSource& other) const { 44 bool MediaSource::Equals(const MediaSource& other) const {
24 return id_ == other.id(); 45 return id_ == other.id() && origin_ == other.origin();
25 } 46 }
26 47
27 bool MediaSource::Empty() const { 48 bool MediaSource::Empty() const {
28 return id_.empty(); 49 return id_.empty();
29 } 50 }
30 51
31 std::string MediaSource::ToString() const { 52 std::string MediaSource::ToString() const {
32 return "MediaSource[" + id_ + "]"; 53 return "MediaSource[" + id_ + "]";
33 } 54 }
34 55
35 } // namespace media_router 56 } // namespace media_router
OLDNEW
« 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