Index: chrome/renderer/media/cast_session_delegate.h |
diff --git a/chrome/renderer/media/cast_session_delegate.h b/chrome/renderer/media/cast_session_delegate.h |
index d382287acde6e2bfdd48136587cfebb3cbb2acea..0af4e1124111298280e43d398a3dcd86e3fd99db 100644 |
--- a/chrome/renderer/media/cast_session_delegate.h |
+++ b/chrome/renderer/media/cast_session_delegate.h |
@@ -9,6 +9,7 @@ |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/threading/thread.h" |
#include "base/threading/thread_checker.h" |
#include "base/time/default_tick_clock.h" |
@@ -36,7 +37,7 @@ class CastTransportSender; |
// and network socket. |
// This class is created on the render thread and destroyed on the IO |
// thread. All methods are accessible only on the IO thread. |
-class CastSessionDelegate { |
+class CastSessionDelegate : public base::SupportsWeakPtr<CastSessionDelegate> { |
Ami GONE FROM CHROMIUM
2014/02/14 18:23:54
Why this SupportsWeakPtr?
mikhal1
2014/02/18 19:20:43
Done.
|
public: |
typedef base::Callback<void(const scoped_refptr<media::cast::FrameInput>&)> |
FrameInputAvailableCallback; |
@@ -55,20 +56,13 @@ class CastSessionDelegate { |
const FrameInputAvailableCallback& callback); |
protected: |
- // Callback with the result of the initialization. |
- // If this callback is called with STATUS_INITIALIZED it will report back |
- // to the sinks that it's ready to accept incoming audio / video frames. |
+ // Callback with the result of the initialization. If this callback is called |
+ // with STATUS_AUDIO_INITIALIZED and/or STATUS_VIDEO_INITIALIZED it will |
+ // report back to the sinks that it's ready to accept incoming audio / video |
+ // frames. |
void InitializationResult(media::cast::CastInitializationStatus result) const; |
private: |
- // Start encoding threads and initialize the CastEnvironment. |
- void Initialize(); |
- |
- // Configure CastSender. It is ready to accept audio / video frames after |
- // receiving a successful call to InitializationResult. |
- void StartSendingInternal(const FrameInputAvailableCallback& callback, |
- bool is_audio); |
- |
base::ThreadChecker thread_checker_; |
scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
scoped_ptr<media::cast::CastSender> cast_sender_; |
@@ -81,16 +75,14 @@ class CastSessionDelegate { |
base::Thread audio_encode_thread_; |
base::Thread video_encode_thread_; |
- // Configuration for audio and video. |
- scoped_ptr<media::cast::AudioSenderConfig> audio_config_; |
- scoped_ptr<media::cast::VideoSenderConfig> video_config_; |
- |
scoped_ptr<FrameInputAvailableCallback> audio_frame_input_available_callback_; |
scoped_ptr<FrameInputAvailableCallback> video_frame_input_available_callback_; |
// Proxy to the IO message loop. |
scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
+ base::WeakPtrFactory<CastSessionDelegate> weak_factory_; |
Ami GONE FROM CHROMIUM
2014/02/14 18:23:54
doco as bound to io_message_loop_proxy_.
mikhal1
2014/02/18 19:20:43
Done.
|
+ |
DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
}; |