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

Unified Diff: chrome/browser/media/router/media_source.h

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/router/media_sinks_observer.h ('k') | chrome/browser/media/router/media_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « chrome/browser/media/router/media_sinks_observer.h ('k') | chrome/browser/media/router/media_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698