| 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 d90497f2aef1dacda374321e798eaca9f4260179..00c3ebc79f76ff9a2e16a09c0bff244b8410ba0c 100644
|
| --- a/chrome/browser/media/router/media_source.h
|
| +++ b/chrome/browser/media/router/media_source.h
|
| @@ -5,20 +5,42 @@
|
| #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_
|
| #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_
|
|
|
| +#include <ostream>
|
| #include <string>
|
|
|
| +#include "base/hash.h"
|
| +
|
| namespace media_router {
|
|
|
| +using MediaSourceId = std::string;
|
| +
|
| class MediaSource {
|
| public:
|
| - explicit MediaSource(const std::string& id);
|
| + explicit MediaSource(const MediaSourceId& id);
|
| + MediaSource();
|
| ~MediaSource();
|
|
|
| // Gets the ID of the media source.
|
| - std::string id() const;
|
| + MediaSourceId id() const;
|
| +
|
| + // Returns true if two MediaSource objects use the same media ID.
|
| + bool Equals(const MediaSource& other) const;
|
| +
|
| + // Returns true if a MediaSource is empty or uninitialized.
|
| + bool Empty() const;
|
| +
|
| + // 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());
|
| + }
|
| + };
|
|
|
| private:
|
| - std::string id_;
|
| + MediaSourceId id_;
|
| };
|
|
|
| } // namespace media_router
|
|
|