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

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

Issue 2891023002: [cast_channel] Make CastSocket not inherit from ApiResource (Closed)
Patch Set: resolve code review comments from Derek Created 3 years, 7 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_socket.h
diff --git a/extensions/browser/api/cast_channel/cast_socket.h b/extensions/browser/api/cast_channel/cast_socket.h
index cfff93f301621f94a7afb7b4ac455d72e5048abf..4ee3683d314dcfb20a54ad56cbf528aa116dbace 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,13 +56,9 @@ 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 {}
-
- // Used by BrowserContextKeyedAPIFactory.
- static const char* service_name() { return "CastSocketImplManager"; }
+ virtual ~CastSocket() {}
// Connects the channel to the peer. If successful, the channel will be in
// READY_STATE_OPEN. DO NOT delete the CastSocket object in |callback|.
@@ -88,10 +82,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.
@@ -121,12 +115,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
@@ -186,9 +174,6 @@ class CastSocketImpl : public CastSocket {
bool keep_alive() const override;
bool audio_only() const override;
- // Required by ApiResourceManager.
- static const char* service_name() { return "CastSocketManager"; }
-
protected:
// CastTransport::Delegate methods for receiving handshake messages.
class AuthTransportDelegate : public CastTransport::Delegate {
@@ -229,7 +214,6 @@ class CastSocketImpl : public CastSocket {
FRIEND_TEST_ALL_PREFIXES(CastSocketTest,
TestConnectChallengeVerificationFails);
friend class AuthTransportDelegate;
- friend class ApiResourceManager<CastSocketImpl>;
friend class CastSocketTest;
friend class TestCastSocket;
@@ -305,7 +289,6 @@ class CastSocketImpl : public CastSocket {
base::ThreadChecker thread_checker_;
- const std::string owner_extension_id_;
// The id of the channel.
int channel_id_;
// The IP endpoint that the the channel is connected to.
« no previous file with comments | « extensions/browser/api/cast_channel/cast_channel_api.cc ('k') | extensions/browser/api/cast_channel/cast_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698