Chromium Code Reviews| Index: extensions/browser/api/cast_channel/cast_socket.h |
| diff --git a/extensions/browser/api/cast_channel/cast_socket.h b/extensions/browser/api/cast_channel/cast_socket.h |
| index cfff93f301621f94a7afb7b4ac455d72e5048abf..292f4b3d92b1199ed7d15b719088eb4e312cceaa 100644 |
| --- a/extensions/browser/api/cast_channel/cast_socket.h |
| +++ b/extensions/browser/api/cast_channel/cast_socket.h |
| @@ -16,8 +16,6 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/threading/thread_checker.h" |
| #include "base/timer/timer.h" |
| -#include "extensions/browser/api/api_resource.h" |
| -#include "extensions/browser/api/api_resource_manager.h" |
| #include "extensions/browser/api/cast_channel/cast_auth_util.h" |
| #include "extensions/browser/api/cast_channel/cast_socket.h" |
| #include "extensions/browser/api/cast_channel/cast_transport.h" |
| @@ -58,10 +56,10 @@ enum CastDeviceCapability { |
| }; |
| // Public interface of the CastSocket class. |
| -class CastSocket : public ApiResource { |
| +class CastSocket { |
| public: |
| - explicit CastSocket(const std::string& owner_extension_id); |
| - ~CastSocket() override {} |
| + explicit CastSocket(); |
|
imcheng
2017/05/24 20:24:32
Remove this constructor since CastSocket is to be
zhaobin
2017/05/24 22:15:07
Done.
|
| + virtual ~CastSocket() {} |
| // Used by BrowserContextKeyedAPIFactory. |
| static const char* service_name() { return "CastSocketImplManager"; } |
|
imcheng
2017/05/24 20:24:32
Can this be removed?
zhaobin
2017/05/24 22:15:07
Done.
|
| @@ -88,10 +86,10 @@ class CastSocket : public ApiResource { |
| // The IP endpoint for the destination of the channel. |
| virtual const net::IPEndPoint& ip_endpoint() const = 0; |
| - // Channel id generated by the ApiResourceManager. |
| + // Channel id generated by the CastChannelService. |
| virtual int id() const = 0; |
| - // Sets the channel id generated by ApiResourceManager. |
| + // Sets the channel id generated by CastChannelService. |
| virtual void set_id(int id) = 0; |
| // The authentication level requested for the channel. |
| @@ -111,6 +109,8 @@ class CastSocket : public ApiResource { |
| // certificate during channel authentication. |
| virtual bool audio_only() const = 0; |
| + virtual const std::string& owner_extension_id() const = 0; |
| + |
| // Marks a socket as invalid due to an error, and sends an OnError |
| // event to |delegate_|. |
| // The OnError event receipient is responsible for closing the socket in the |
| @@ -121,12 +121,6 @@ class CastSocket : public ApiResource { |
| // Returns a pointer to the socket's message transport layer. Can be used to |
| // send and receive CastMessages over the socket. |
| virtual CastTransport* transport() const = 0; |
| - |
| - // Tells the ApiResourceManager to retain CastSocket objects even |
| - // if their corresponding extension is suspended. |
| - // (CastSockets are still deleted if the extension is removed entirely from |
| - // the browser.) |
| - bool IsPersistent() const override; |
| }; |
| // This class implements a channel between Chrome and a Cast device using a TCP |
| @@ -185,6 +179,7 @@ class CastSocketImpl : public CastSocket { |
| ChannelError error_state() const override; |
| bool keep_alive() const override; |
| bool audio_only() const override; |
| + const std::string& owner_extension_id() const override; |
| // Required by ApiResourceManager. |
| static const char* service_name() { return "CastSocketManager"; } |
|
imcheng
2017/05/24 20:24:32
Can this be removed?
zhaobin
2017/05/24 22:15:07
Done.
|
| @@ -229,7 +224,6 @@ class CastSocketImpl : public CastSocket { |
| FRIEND_TEST_ALL_PREFIXES(CastSocketTest, |
| TestConnectChallengeVerificationFails); |
| friend class AuthTransportDelegate; |
| - friend class ApiResourceManager<CastSocketImpl>; |
| friend class CastSocketTest; |
| friend class TestCastSocket; |