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

Side by Side Diff: remoting/protocol/protobuf_video_writer.h

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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
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 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 5 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "remoting/protocol/video_writer.h" 13 #include "remoting/protocol/video_writer.h"
14 14
15 namespace base {
16 class MessageLoopProxy;
17 } // namespace base
18
15 namespace net { 19 namespace net {
16 class StreamSocket; 20 class StreamSocket;
17 } // namespace net 21 } // namespace net
18 22
19 namespace remoting { 23 namespace remoting {
20 namespace protocol { 24 namespace protocol {
21 25
22 class BufferedSocketWriter; 26 class BufferedSocketWriter;
23 class Session; 27 class Session;
24 28
25 class ProtobufVideoWriter : public VideoWriter { 29 class ProtobufVideoWriter : public VideoWriter {
26 public: 30 public:
27 ProtobufVideoWriter(); 31 ProtobufVideoWriter(base::MessageLoopProxy* message_loop);
28 virtual ~ProtobufVideoWriter(); 32 virtual ~ProtobufVideoWriter();
29 33
30 // VideoWriter interface. 34 // VideoWriter interface.
31 virtual void Init(protocol::Session* session, 35 virtual void Init(protocol::Session* session,
32 const InitializedCallback& callback) OVERRIDE; 36 const InitializedCallback& callback) OVERRIDE;
33 virtual void Close() OVERRIDE; 37 virtual void Close() OVERRIDE;
34 38
35 // VideoStub interface. 39 // VideoStub interface.
36 virtual void ProcessVideoPacket(const VideoPacket* packet, 40 virtual void ProcessVideoPacket(const VideoPacket* packet,
37 Task* done) OVERRIDE; 41 Task* done) OVERRIDE;
38 virtual int GetPendingPackets() OVERRIDE; 42 virtual int GetPendingPackets() OVERRIDE;
39 43
40 private: 44 private:
41 void OnChannelReady(net::StreamSocket* socket); 45 void OnChannelReady(net::StreamSocket* socket);
42 46
43 InitializedCallback initialized_callback_; 47 InitializedCallback initialized_callback_;
44 48
45 // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it. 49 // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it.
46 scoped_ptr<net::StreamSocket> channel_; 50 scoped_ptr<net::StreamSocket> channel_;
47 51
48 scoped_refptr<BufferedSocketWriter> buffered_writer_; 52 scoped_refptr<BufferedSocketWriter> buffered_writer_;
49 53
50 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter); 54 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter);
51 }; 55 };
52 56
53 } // namespace protocol 57 } // namespace protocol
54 } // namespace remoting 58 } // namespace remoting
55 59
56 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 60 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/message_reader_unittest.cc ('k') | remoting/protocol/protobuf_video_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698