OLD | NEW |
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 Loading... |
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 |
OLD | NEW |