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

Side by Side Diff: chrome/browser/media/router/media_source.cc

Issue 2386633003: [Media Router] Convert MediaRouter to use GURL for presentation URLs. (Closed)
Patch Set: Respond to dcheng@ comment Created 4 years, 2 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 #include "url/gurl.h"
10
9 namespace media_router { 11 namespace media_router {
10 12
11 MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) { 13 MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) {
12 } 14 }
13 15
16 MediaSource::MediaSource(const GURL& presentation_url)
17 : id_(presentation_url.spec()) {}
18
14 MediaSource::~MediaSource() {} 19 MediaSource::~MediaSource() {}
15 20
16 MediaSource::Id MediaSource::id() const { 21 MediaSource::Id MediaSource::id() const {
17 return id_; 22 return id_;
18 } 23 }
19 24
20 bool MediaSource::operator==(const MediaSource& other) const { 25 bool MediaSource::operator==(const MediaSource& other) const {
21 return id_ == other.id(); 26 return id_ == other.id();
22 } 27 }
23 28
24 std::string MediaSource::ToString() const { 29 std::string MediaSource::ToString() const {
25 return "MediaSource[" + id_ + "]"; 30 return "MediaSource[" + id_ + "]";
26 } 31 }
27 32
28 } // namespace media_router 33 } // 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