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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_api.h

Issue 2942993003: [cast_channel] Make CastMessageHandler a CastSocket::Observer instead of CastTransport::Delegate (Closed)
Patch Set: resolve code review comments from Derek and Mark 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
Index: extensions/browser/api/cast_channel/cast_channel_api.h
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.h b/extensions/browser/api/cast_channel/cast_channel_api.h
index baecc333a8db04baa8a3b5176afba35fbf722386..4453a791fab98561da5556b83248c82a5092a864 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.h
+++ b/extensions/browser/api/cast_channel/cast_channel_api.h
@@ -134,26 +134,24 @@ class CastChannelOpenFunction : public CastChannelAsyncApiFunction {
// Parameter #0 is a scoped pointer to the event payload.
using EventDispatchCallback = base::Callback<void(std::unique_ptr<Event>)>;
- // Receives incoming messages and errors and provides additional API and
- // origin socket context.
- class CastMessageHandler : public cast_channel::CastTransport::Delegate {
+ // Receives incoming messages and errors and provides additional API context.
+ class CastMessageHandler : public cast_channel::CastSocket::Observer {
public:
CastMessageHandler(const EventDispatchCallback& ui_dispatch_cb,
- cast_channel::CastSocket* socket,
scoped_refptr<cast_channel::Logger> logger);
~CastMessageHandler() override;
- // CastTransport::Delegate implementation.
- void OnError(cast_channel::ChannelError error_state) override;
- void OnMessage(const cast_channel::CastMessage& message) override;
- void Start() override;
+ // CastSocket::Observer implementation.
+ void OnError(const cast_channel::CastSocket& socket,
+ cast_channel::ChannelError error_state) override;
+ void OnMessage(const cast_channel::CastSocket& socket,
+ const cast_channel::CastMessage& message) override;
private:
// Callback for sending events to the extension.
// Should be bound to a weak pointer, to prevent any use-after-free
// conditions.
EventDispatchCallback const ui_dispatch_cb_;
- cast_channel::CastSocket* const socket_;
// Logger object for reporting error details.
scoped_refptr<cast_channel::Logger> logger_;

Powered by Google App Engine
This is Rietveld 408576698