dbus: Property<>.value() should be const
[chromium-blink-merge.git] / remoting / protocol / socket_reader_base.h
blob3877f13dbf0ab3a9de7f09b74ba1c0a10430cd56
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_PROTOCOL_SOCKET_READER_BASE_H_
6 #define REMOTING_PROTOCOL_SOCKET_READER_BASE_H_
8 #include "base/memory/ref_counted.h"
9 #include "net/base/completion_callback.h"
11 namespace net {
12 class IOBuffer;
13 class Socket;
14 } // namespace net
16 namespace remoting {
18 class SocketReaderBase {
19 public:
20 SocketReaderBase();
21 virtual ~SocketReaderBase();
23 protected:
24 void Init(net::Socket* socket);
25 virtual void OnDataReceived(net::IOBuffer* buffer, int data_size) = 0;
27 private:
28 void DoRead();
29 void OnRead(int result);
30 void HandleReadResult(int result);
32 net::Socket* socket_;
33 bool closed_;
34 scoped_refptr<net::IOBuffer> read_buffer_;
37 } // namespace remoting
39 #endif // REMOTING_PROTOCOL_SOCKET_READER_BASE_H_