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

Side by Side Diff: remoting/protocol/client_video_dispatcher.cc

Issue 1649063003: Add MessagePipe interface. Use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_parser
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/client_video_dispatcher.h" 5 #include "remoting/protocol/client_video_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
11 #include "net/socket/stream_socket.h" 11 #include "net/socket/stream_socket.h"
12 #include "remoting/base/constants.h" 12 #include "remoting/base/constants.h"
13 #include "remoting/proto/video.pb.h" 13 #include "remoting/proto/video.pb.h"
14 #include "remoting/protocol/message_pipe.h"
14 #include "remoting/protocol/message_serialization.h" 15 #include "remoting/protocol/message_serialization.h"
15 #include "remoting/protocol/video_stub.h" 16 #include "remoting/protocol/video_stub.h"
16 17
17 namespace remoting { 18 namespace remoting {
18 namespace protocol { 19 namespace protocol {
19 20
20 struct ClientVideoDispatcher::PendingFrame { 21 struct ClientVideoDispatcher::PendingFrame {
21 PendingFrame(int frame_id) 22 PendingFrame(int frame_id)
22 : frame_id(frame_id), 23 : frame_id(frame_id),
23 done(false) {} 24 done(false) {}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 PendingFramesList::iterator pending_frame) { 60 PendingFramesList::iterator pending_frame) {
60 // Mark the frame as done. 61 // Mark the frame as done.
61 DCHECK(!pending_frame->done); 62 DCHECK(!pending_frame->done);
62 pending_frame->done = true; 63 pending_frame->done = true;
63 64
64 // Send VideoAck for all packets in the head of the queue that have finished 65 // Send VideoAck for all packets in the head of the queue that have finished
65 // rendering. 66 // rendering.
66 while (!pending_frames_.empty() && pending_frames_.front().done) { 67 while (!pending_frames_.empty() && pending_frames_.front().done) {
67 VideoAck ack_message; 68 VideoAck ack_message;
68 ack_message.set_frame_id(pending_frames_.front().frame_id); 69 ack_message.set_frame_id(pending_frames_.front().frame_id);
69 writer()->Write(SerializeAndFrameMessage(ack_message), base::Closure()); 70 message_pipe()->Send(&ack_message, base::Closure());
70 pending_frames_.pop_front(); 71 pending_frames_.pop_front();
71 } 72 }
72 } 73 }
73 74
74 } // namespace protocol 75 } // namespace protocol
75 } // namespace remoting 76 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698