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_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <ostream> | 10 #include <ostream> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/hash.h" | 13 #include "base/hash.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 // TODO(mfoltz): Right now this is a wrapper for std::string. Factor methods | 16 // TODO(mfoltz): Right now this is a wrapper for std::string. Factor methods |
17 // from media_source_helper here so this object becomes useful; and don't just | 17 // from media_source_helper here so this object becomes useful; and don't just |
18 // pass it around by Id. | 18 // pass it around by Id. |
19 namespace media_router { | 19 namespace media_router { |
20 | 20 |
21 class MediaSource { | 21 class MediaSource { |
22 public: | 22 public: |
23 using Id = std::string; | 23 using Id = std::string; |
24 | 24 |
25 explicit MediaSource(const MediaSource::Id& id); | 25 explicit MediaSource(const MediaSource::Id& id); |
26 explicit MediaSource(const GURL& presentation_url); | 26 explicit MediaSource(const GURL& presentation_url); |
| 27 MediaSource(); |
27 ~MediaSource(); | 28 ~MediaSource(); |
28 | 29 |
29 // Gets the ID of the media source. | 30 // Gets the ID of the media source. |
30 MediaSource::Id id() const; | 31 MediaSource::Id id() const; |
31 | 32 |
32 // If MediaSource is created from a URL, return the URL; otherwise return an | 33 // If MediaSource is created from a URL, return the URL; otherwise return an |
33 // empty GURL. | 34 // empty GURL. |
34 GURL url() const; | 35 GURL url() const; |
35 | 36 |
36 // Returns true if two MediaSource objects use the same media ID. | 37 // Returns true if two MediaSource objects use the same media ID. |
(...skipping 10 matching lines...) Expand all Loading... |
47 }; | 48 }; |
48 | 49 |
49 private: | 50 private: |
50 MediaSource::Id id_; | 51 MediaSource::Id id_; |
51 GURL url_; | 52 GURL url_; |
52 }; | 53 }; |
53 | 54 |
54 } // namespace media_router | 55 } // namespace media_router |
55 | 56 |
56 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ | 57 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ |
OLD | NEW |