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

Unified Diff: components/cast_channel/cast_socket_service.cc

Issue 2942993003: [cast_channel] Make CastMessageHandler a CastSocket::Observer instead of CastTransport::Delegate (Closed)
Patch Set: resolve code review comments from Derek Created 3 years, 6 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 | « components/cast_channel/cast_socket_service.h ('k') | components/cast_channel/cast_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cast_channel/cast_socket_service.cc
diff --git a/components/cast_channel/cast_socket_service.cc b/components/cast_channel/cast_socket_service.cc
index f58c9858e9212121ed2ad48758d411773747d708..5da94186046d554d355e2ac58d9ec0173cf5058f 100644
--- a/components/cast_channel/cast_socket_service.cc
+++ b/components/cast_channel/cast_socket_service.cc
@@ -52,6 +52,19 @@ CastSocket* CastSocketService::GetSocket(int channel_id) const {
return socket_it == sockets_.end() ? nullptr : socket_it->second.get();
}
+CastSocket::Observer* CastSocketService::GetObserver(const std::string& id) {
+ auto it = socket_observer_map_.find(id);
+ return it == socket_observer_map_.end() ? nullptr : it->second.get();
+}
+
+CastSocket::Observer* CastSocketService::AddObserver(
+ const std::string& id,
+ std::unique_ptr<CastSocket::Observer> observer) {
+ CastSocket::Observer* observer_ptr = observer.get();
+ socket_observer_map_.insert(std::make_pair(id, std::move(observer)));
+ return observer_ptr;
+}
+
void CastSocketService::ShutdownOnUIThread() {}
} // namespace cast_channel
« no previous file with comments | « components/cast_channel/cast_socket_service.h ('k') | components/cast_channel/cast_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698