Index: chrome/renderer/media/cast_session.h |
diff --git a/chrome/renderer/media/cast_session.h b/chrome/renderer/media/cast_session.h |
index dcf7945519be948d6aeb04d9ff64506eb8230787..1b4069298f7418650b724f87c150d45617c479bc 100644 |
--- a/chrome/renderer/media/cast_session.h |
+++ b/chrome/renderer/media/cast_session.h |
@@ -8,11 +8,16 @@ |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "net/base/ip_endpoint.h" |
namespace base { |
class MessageLoopProxy; |
} // namespace base |
+namespace content{ |
+class P2PSocketClient; |
+}; |
+ |
class CastSessionDelegate; |
// This class represents a Cast session and allows the session to be |
@@ -22,6 +27,24 @@ class CastSession : public base::RefCounted<CastSession> { |
public: |
CastSession(); |
+ class SocketFactory { |
+ public: |
+ virtual ~SocketFactory(); |
+ |
+ // Called on IO thread. |
+ virtual content::P2PSocketClient* create() = 0; |
Alpha Left Google
2013/11/09 00:30:18
Return type should be scoped_ptr<T>.
hubbe
2013/11/26 20:24:29
scoped_refptr<>
|
+ }; |
+ |
+ // Send the socket factory to the delegate, where create will be |
+ // called. The delegate will then delete the socket factory on the |
+ // IO thread. We do it this way because the P2P socket needs to |
+ // be created on the same thread that the callbacks will be called on. |
+ // The |remote_endpoint| is the address will be used when calling |
+ // SendWithDscp on the P2PSocketClient. |
+ // Takes ownership of socket_factory. |
+ void SetSocketFactory(SocketFactory* socket_factory, |
Alpha Left Google
2013/11/09 00:30:18
Use scoped_ptr<> for type of socket_factory. This
hubbe
2013/11/26 20:24:29
Done.
|
+ const net::IPEndPoint& remote_address); |
+ |
private: |
friend class base::RefCounted<CastSession>; |
virtual ~CastSession(); |