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

Unified Diff: chrome/renderer/media/cast_session_delegate.h

Issue 163553006: Cast: Refactoring Cast API's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/renderer/media/cast_session_delegate.cc » ('j') | media/cast/cast_sender.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | chrome/renderer/media/cast_session_delegate.cc » ('j') | media/cast/cast_sender.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698