Chromium Code Reviews| 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..e4300d8ec337284c4ea9c9739d5ad39d702260d1 100644 |
| --- a/chrome/browser/media/router/media_source.h |
| +++ b/chrome/browser/media/router/media_source.h |
| @@ -29,6 +29,8 @@ class MediaSource { |
| // Returns true if two MediaSource objects use the same media ID. |
| bool Equals(const MediaSource& other) const; |
| + bool operator==(const MediaSource& other) const; |
|
mark a. foltz
2016/08/31 05:18:54
Why do we need both == and Equals?
takumif
2016/09/01 21:09:25
Got rid of Equals().
|
| + |
| // Returns true if a MediaSource is empty or uninitialized. |
| bool Empty() const; |
| @@ -42,6 +44,14 @@ class MediaSource { |
| } |
| }; |
| + // For storing in sets and in maps as keys. |
| + struct Compare { |
| + bool operator()(const MediaSource& source1, |
| + const MediaSource& source2) const { |
| + return source1.id() < source2.id(); |
| + } |
| + }; |
| + |
| private: |
| MediaSource::Id id_; |
| }; |