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

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

Issue 5575005: Removed stream_writer.[cc|h] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/remoting
Patch Set: Created 10 years 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/jingle_connection_to_host.h ('k') | remoting/protocol/stream_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_STREAM_WRITER_H_
6 #define REMOTING_PROTOCOL_STREAM_WRITER_H_
7
8 #include "base/ref_counted.h"
9 #include "remoting/proto/internal.pb.h"
10
11 namespace net {
12 class Socket;
13 } // namespace net
14
15 namespace remoting {
16 namespace protocol {
17
18 class BufferedSocketWriter;
19
20 class StreamWriterBase {
21 public:
22 StreamWriterBase();
23 virtual ~StreamWriterBase();
24
25 // Initializes the writer. Must be called on the thread the |socket| belongs
26 // to.
27 void Init(net::Socket* socket);
28
29 // Return current buffer state. Can be called from any thread.
30 int GetBufferSize();
31 int GetPendingMessages();
32
33 // Stop writing and drop pending data. Must be called from the same thread as
34 // Init().
35 void Close();
36
37 protected:
38 net::Socket* socket_;
39 scoped_refptr<BufferedSocketWriter> buffered_writer_;
40 };
41
42 class EventStreamWriter : public StreamWriterBase {
43 public:
44 // Sends the |message| or returns false if called before Init().
45 // Can be called on any thread.
46 bool SendMessage(const EventMessage& message);
47 };
48
49 class ControlStreamWriter : public StreamWriterBase {
50 public:
51 // Sends the |message| or returns false if called before Init().
52 // Can be called on any thread.
53 bool SendMessage(const ControlMessage& message);
54 };
55
56 } // namespace protocol
57 } // namespace remoting
58
59 #endif // REMOTING_PROTOCOL_STREAM_WRITER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_connection_to_host.h ('k') | remoting/protocol/stream_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698