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_router_base.h" | 5 #include "chrome/browser/media/router/media_router_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 148 |
149 void MediaRouterBase::Shutdown() { | 149 void MediaRouterBase::Shutdown() { |
150 // The observer calls virtual methods on MediaRouter; it must be destroyed | 150 // The observer calls virtual methods on MediaRouter; it must be destroyed |
151 // outside of the dtor | 151 // outside of the dtor |
152 internal_routes_observer_.reset(); | 152 internal_routes_observer_.reset(); |
153 } | 153 } |
154 | 154 |
155 void MediaRouterBase::DetachRouteController(const MediaRoute::Id& route_id, | 155 void MediaRouterBase::DetachRouteController(const MediaRoute::Id& route_id, |
156 MediaRouteController* controller) {} | 156 MediaRouteController* controller) {} |
157 | 157 |
158 void MediaRouterBase::RegisterRemotingSource( | |
159 int32_t tab_id, | |
160 CastRemotingConnector* remoting_source) { | |
161 auto it = remoting_sources_.find(tab_id); | |
162 if (it != remoting_sources_.end()) { | |
163 DCHECK(remoting_source == it->second); | |
164 return; | |
165 } | |
166 remoting_sources_.emplace(tab_id, std::move(remoting_source)); | |
imcheng
2017/07/05 18:53:08
The std::move isn't necessary?
xjz
2017/07/06 22:03:45
Done.
| |
167 } | |
168 | |
169 void MediaRouterBase::UnregisterRemotingSource(int32_t tab_id) { | |
170 auto it = remoting_sources_.find(tab_id); | |
171 DCHECK(it != remoting_sources_.end()); | |
172 remoting_sources_.erase(it); | |
173 } | |
174 | |
158 } // namespace media_router | 175 } // namespace media_router |
OLD | NEW |