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

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

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/protobuf_video_reader.h" 5 #include "remoting/protocol/protobuf_video_reader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "net/socket/stream_socket.h" 9 #include "net/socket/stream_socket.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void ProtobufVideoReader::OnChannelReady(net::StreamSocket* socket) { 35 void ProtobufVideoReader::OnChannelReady(net::StreamSocket* socket) {
36 if (!socket) { 36 if (!socket) {
37 initialized_callback_.Run(false); 37 initialized_callback_.Run(false);
38 return; 38 return;
39 } 39 }
40 40
41 DCHECK(!channel_.get()); 41 DCHECK(!channel_.get());
42 channel_.reset(socket); 42 channel_.reset(socket);
43 reader_.Init(socket, NewCallback(this, &ProtobufVideoReader::OnNewData)); 43 reader_.Init(socket, base::Bind(&ProtobufVideoReader::OnNewData,
44 base::Unretained(this)));
44 initialized_callback_.Run(true); 45 initialized_callback_.Run(true);
45 } 46 }
46 47
47 void ProtobufVideoReader::OnNewData(VideoPacket* packet, Task* done_task) { 48 void ProtobufVideoReader::OnNewData(VideoPacket* packet,
49 const base::Closure& done_task) {
48 video_stub_->ProcessVideoPacket(packet, done_task); 50 video_stub_->ProcessVideoPacket(packet, done_task);
49 } 51 }
50 52
51 } // namespace protocol 53 } // namespace protocol
52 } // namespace remoting 54 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/protobuf_video_reader.h ('k') | remoting/protocol/protobuf_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698