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 c257599da0abc997db1b5bd771a95346cc2bdf88..a77091cc80343503334b58f93f44b5b6d80f4492 100644 |
--- a/extensions/browser/api/cast_channel/cast_channel_api.h |
+++ b/extensions/browser/api/cast_channel/cast_channel_api.h |
@@ -12,7 +12,6 @@ |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "base/threading/thread_checker.h" |
-#include "extensions/browser/api/api_resource_manager.h" |
#include "extensions/browser/api/async_api_function.h" |
#include "extensions/browser/api/cast_channel/cast_socket.h" |
#include "extensions/browser/browser_context_keyed_api_factory.h" |
@@ -34,6 +33,7 @@ struct Event; |
namespace api { |
namespace cast_channel { |
+class CastSocketService; |
class Logger; |
} // namespace cast_channel |
} // namespace api |
@@ -102,9 +102,6 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction { |
CastChannelAsyncApiFunction(); |
protected: |
- typedef ApiResourceManager<cast_channel::CastSocket>::ApiResourceData |
- SocketData; |
- |
~CastChannelAsyncApiFunction() override; |
// AsyncApiFunction: |
@@ -118,7 +115,7 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction { |
// Adds |socket| to |manager_| and returns the new channel_id. |manager_| |
// assumes ownership of |socket|. |
- int AddSocket(cast_channel::CastSocket* socket); |
+ int AddSocket(std::unique_ptr<cast_channel::CastSocket> socket); |
// Removes the CastSocket corresponding to |channel_id| from the resource |
// manager. |
@@ -140,8 +137,8 @@ class CastChannelAsyncApiFunction : public AsyncApiFunction { |
// Sets the function result from |channel_info|. |
void SetResultFromChannelInfo(const cast_channel::ChannelInfo& channel_info); |
- // The collection of CastSocket API resources. |
- scoped_refptr<SocketData> sockets_; |
+ // Manages creating and removing cast sockets. |
+ api::cast_channel::CastSocketService* cast_socket_service_; |
}; |
class CastChannelOpenFunction : public CastChannelAsyncApiFunction { |