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 #include "chrome/browser/media/router/media_route.h" | 5 #include "chrome/browser/media/router/media_route.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/media/router/media_source.h" | 8 #include "chrome/browser/media/router/media_source.h" |
9 | 9 |
10 namespace media_router { | 10 namespace media_router { |
(...skipping 13 matching lines...) Expand all Loading... |
24 custom_controller_path_(custom_controller_path), | 24 custom_controller_path_(custom_controller_path), |
25 for_display_(for_display) {} | 25 for_display_(for_display) {} |
26 | 26 |
27 MediaRoute::~MediaRoute() { | 27 MediaRoute::~MediaRoute() { |
28 } | 28 } |
29 | 29 |
30 bool MediaRoute::Equals(const MediaRoute& other) const { | 30 bool MediaRoute::Equals(const MediaRoute& other) const { |
31 return media_route_id_ == other.media_route_id_; | 31 return media_route_id_ == other.media_route_id_; |
32 } | 32 } |
33 | 33 |
34 MediaRouteIdToPresentationSessionMapping:: | |
35 MediaRouteIdToPresentationSessionMapping() { | |
36 } | |
37 | |
38 MediaRouteIdToPresentationSessionMapping:: | |
39 ~MediaRouteIdToPresentationSessionMapping() { | |
40 } | |
41 | |
42 void MediaRouteIdToPresentationSessionMapping::Add( | |
43 const MediaRoute::Id& route_id, | |
44 const content::PresentationSessionInfo& session_info) { | |
45 route_id_to_presentation_.insert(std::make_pair(route_id, session_info)); | |
46 } | |
47 | |
48 void MediaRouteIdToPresentationSessionMapping::Remove( | |
49 const MediaRoute::Id& route_id) { | |
50 route_id_to_presentation_.erase(route_id); | |
51 } | |
52 | |
53 void MediaRouteIdToPresentationSessionMapping::Clear() { | |
54 route_id_to_presentation_.clear(); | |
55 } | |
56 | |
57 const content::PresentationSessionInfo* | |
58 MediaRouteIdToPresentationSessionMapping::Get( | |
59 const MediaRoute::Id& route_id) const { | |
60 auto it = route_id_to_presentation_.find(route_id); | |
61 return it == route_id_to_presentation_.end() ? nullptr : &it->second; | |
62 } | |
63 | |
64 } // namespace media_router | 34 } // namespace media_router |
OLD | NEW |