| 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/small_map.h" | 10 #include "base/containers/small_map.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 private: | 76 private: |
| 77 MediaRoute::Id media_route_id_; | 77 MediaRoute::Id media_route_id_; |
| 78 MediaSource media_source_; | 78 MediaSource media_source_; |
| 79 MediaSink::Id media_sink_id_; | 79 MediaSink::Id media_sink_id_; |
| 80 std::string description_; | 80 std::string description_; |
| 81 bool is_local_; | 81 bool is_local_; |
| 82 std::string custom_controller_path_; | 82 std::string custom_controller_path_; |
| 83 bool for_display_; | 83 bool for_display_; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class MediaRouteIdToPresentationSessionMapping { | |
| 87 public: | |
| 88 MediaRouteIdToPresentationSessionMapping(); | |
| 89 ~MediaRouteIdToPresentationSessionMapping(); | |
| 90 | |
| 91 void Add(const MediaRoute::Id& route_id, | |
| 92 const content::PresentationSessionInfo& session_info); | |
| 93 void Remove(const MediaRoute::Id& route_id); | |
| 94 void Clear(); | |
| 95 | |
| 96 // Gets the PresentationSessionInfo corresponding to |route_id| or nullptr | |
| 97 // if it does not exist. Caller should not hold on to the returned pointer. | |
| 98 const content::PresentationSessionInfo* Get( | |
| 99 const MediaRoute::Id& route_id) const; | |
| 100 | |
| 101 private: | |
| 102 base::SmallMap<std::map<MediaRoute::Id, content::PresentationSessionInfo>> | |
| 103 route_id_to_presentation_; | |
| 104 | |
| 105 DISALLOW_COPY_AND_ASSIGN(MediaRouteIdToPresentationSessionMapping); | |
| 106 }; | |
| 107 | |
| 108 } // namespace media_router | 86 } // namespace media_router |
| 109 | 87 |
| 110 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 88 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| OLD | NEW |