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

Unified Diff: remoting/protocol/client_video_dispatcher.cc

Issue 1654513003: Simplify message parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_done
Patch Set: Created 4 years, 11 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 | « remoting/protocol/client_video_dispatcher.h ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/client_video_dispatcher.cc
diff --git a/remoting/protocol/client_video_dispatcher.cc b/remoting/protocol/client_video_dispatcher.cc
index e913700f884ea0ab5c284c72dff771488cd7262d..f82b7bd74f77762fb7ac49af9ea7f965bd3f8e8f 100644
--- a/remoting/protocol/client_video_dispatcher.cc
+++ b/remoting/protocol/client_video_dispatcher.cc
@@ -28,15 +28,16 @@ struct ClientVideoDispatcher::PendingFrame {
ClientVideoDispatcher::ClientVideoDispatcher(VideoStub* video_stub)
: ChannelDispatcherBase(kVideoChannelName),
video_stub_(video_stub),
- parser_(base::Bind(&ClientVideoDispatcher::ProcessVideoPacket,
- base::Unretained(this)),
- reader()),
weak_factory_(this) {}
-
ClientVideoDispatcher::~ClientVideoDispatcher() {}
-void ClientVideoDispatcher::ProcessVideoPacket(
- scoped_ptr<VideoPacket> video_packet) {
+void ClientVideoDispatcher::OnIncomingMessage(
+ scoped_ptr<CompoundBuffer> message) {
+ scoped_ptr<VideoPacket> video_packet =
+ ParseMessage<VideoPacket>(message.get());
+ if (!video_packet)
+ return;
+
int frame_id = video_packet->frame_id();
if (!video_packet->has_frame_id()) {
« no previous file with comments | « remoting/protocol/client_video_dispatcher.h ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698