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

Unified Diff: media/cast/net/cast_transport_sender.h

Issue 1515023002: Simplify interface for media/cast: CastTransportSenderImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | media/cast/net/cast_transport_sender_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/cast_transport_sender.h
diff --git a/media/cast/net/cast_transport_sender.h b/media/cast/net/cast_transport_sender.h
index b20c9df0488a06dc0ae5f4529abde83ae0431961..576f4197e719ad305c4fa4001b4b81b25a3f4a7c 100644
--- a/media/cast/net/cast_transport_sender.h
+++ b/media/cast/net/cast_transport_sender.h
@@ -21,6 +21,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/tick_clock.h"
@@ -53,19 +54,29 @@ typedef base::Callback<void(scoped_ptr<std::vector<FrameEvent>>,
scoped_ptr<std::vector<PacketEvent>>)>
BulkRawEventsCallback;
+class CastTransportSenderInfo {
+ public:
+ CastTransportSenderInfo(){};
+
+ virtual void NotifyStatus(CastTransportStatus status) = 0;
+ virtual void SendRawEvents(scoped_ptr<std::vector<FrameEvent>>,
+ scoped_ptr<std::vector<PacketEvent>>) = 0;
+ // Return true if the callback is provided and false otherwise.
+ virtual bool RecievedPackets(scoped_ptr<Packet> packet) = 0;
+ virtual net::NetLog* GetNetLog() = 0;
+ virtual net::IPEndPoint GetLocalEndPoint() = 0;
+ virtual net::IPEndPoint GetRemoteEndPoint() = 0;
+ // Return base::TimeDelta() if no raw events callback is provided.
+ virtual base::TimeDelta GetRawEventsCallBackInterval() = 0;
+ virtual scoped_ptr<base::DictionaryValue> GetOptions() = 0;
+};
+
// The application should only trigger this class from the transport thread.
class CastTransportSender : public base::NonThreadSafe {
public:
static scoped_ptr<CastTransportSender> Create(
- net::NetLog* net_log,
+ base::WeakPtr<CastTransportSenderInfo> cast_transport_sender_info,
base::TickClock* clock,
Irfan 2015/12/11 18:56:04 Perhaps the UDP transport fields can be combined (
miu 2015/12/12 01:30:45 Agreed. Thinking about this, a structure I'd prop
xjz 2015/12/15 18:40:13 Thanks, Yuri! I'll take your suggestion.
- const net::IPEndPoint& local_end_point,
- const net::IPEndPoint& remote_end_point,
- scoped_ptr<base::DictionaryValue> options,
- const CastTransportStatusCallback& status_callback,
- const BulkRawEventsCallback& raw_events_callback,
Irfan 2015/12/11 17:33:25 my feeling here is that only the callbacks should
xjz 2015/12/15 18:40:13 Yuri suggested this too. Changed.
- base::TimeDelta raw_events_callback_interval,
- const PacketReceiverCallback& packet_callback,
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner);
virtual ~CastTransportSender() {}
« no previous file with comments | « no previous file | media/cast/net/cast_transport_sender_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698