| Index: chrome/browser/media/router/media_source.h
|
| diff --git a/chrome/browser/media/router/media_source.h b/chrome/browser/media/router/media_source.h
|
| index 288cb27b7791bdfdca6d04ce345df9aeb64ce604..f95f154c8e386a06294a0b86dbffff3d7c2afdd9 100644
|
| --- a/chrome/browser/media/router/media_source.h
|
| +++ b/chrome/browser/media/router/media_source.h
|
| @@ -26,6 +26,12 @@ class MediaSource {
|
| // Gets the ID of the media source.
|
| MediaSource::Id id() const;
|
|
|
| + // Gets the origin of the media source.
|
| + std::string origin() const;
|
| +
|
| + // Sets the origin of the media source.
|
| + void set_origin(std::string origin);
|
| +
|
| // Returns true if two MediaSource objects use the same media ID.
|
| bool Equals(const MediaSource& other) const;
|
|
|
| @@ -35,17 +41,23 @@ class MediaSource {
|
| // Used for logging.
|
| std::string ToString() const;
|
|
|
| - // Hash operator for hash containers.
|
| - struct Hash {
|
| - size_t operator()(const MediaSource& source) const {
|
| - return base::Hash(source.id());
|
| - }
|
| - };
|
| + bool operator==(const MediaSource& other) const;
|
| + bool operator<(const MediaSource& other) const;
|
|
|
| private:
|
| MediaSource::Id id_;
|
| + std::string origin_;
|
| };
|
|
|
| } // namespace media_router
|
|
|
| +namespace std {
|
| +template <> struct hash<media_router::MediaSource> {
|
| + size_t operator () (const media_router::MediaSource &m) const {
|
| + return base::HashInts32(base::Hash(m.id()),
|
| + base::Hash(m.origin()));
|
| + }
|
| +};
|
| +}
|
| +
|
| #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_
|
|
|