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

Side by Side Diff: net/socket/buffered_write_stream_socket.h

Issue 9433015: Add a force pipelining option to load flags. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix build on other platforms Created 8 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 NET_SOCKET_BUFFERED_WRITE_STREAM_SOCKET_H_
6 #define NET_SOCKET_BUFFERED_WRITE_STREAM_SOCKET_H_
7 #pragma once
8
9 #include "base/memory/weak_ptr.h"
10 #include "net/base/net_log.h"
11 #include "net/socket/stream_socket.h"
12
13 namespace base {
14 class TimeDelta;
15 }
16
17 namespace net {
18
19 class AddressList;
20 class GrowableIOBuffer;
21 class IPEndPoint;
22
23 class NET_EXPORT_PRIVATE BufferedWriteStreamSocket : public StreamSocket {
24 public:
25 BufferedWriteStreamSocket(StreamSocket* socket_to_wrap);
26 virtual ~BufferedWriteStreamSocket();
27
28 // Socket interface
29 virtual int Read(IOBuffer* buf, int buf_len,
30 const CompletionCallback& callback) OVERRIDE;
31 virtual int Write(IOBuffer* buf, int buf_len,
32 const CompletionCallback& callback) OVERRIDE;
33 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
34 virtual bool SetSendBufferSize(int32 size) OVERRIDE;
35
36 // StreamSocket interface
37 virtual int Connect(const CompletionCallback& callback) OVERRIDE;
38 virtual void Disconnect() OVERRIDE;
39 virtual bool IsConnected() const OVERRIDE;
40 virtual bool IsConnectedAndIdle() const OVERRIDE;
41 virtual int GetPeerAddress(AddressList* address) const OVERRIDE;
42 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
43 virtual const BoundNetLog& NetLog() const OVERRIDE;
44 virtual void SetSubresourceSpeculation() OVERRIDE;
45 virtual void SetOmniboxSpeculation() OVERRIDE;
46 virtual bool WasEverUsed() const OVERRIDE;
47 virtual bool UsingTCPFastOpen() const OVERRIDE;
48 virtual int64 NumBytesRead() const OVERRIDE;
49 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
50
51 private:
52 void DoDelayedWrite();
53 void OnIOComplete(int result);
54
55 scoped_ptr<StreamSocket> wrapped_socket_;
56 scoped_refptr<GrowableIOBuffer> io_buffer_;
57 base::WeakPtrFactory<BufferedWriteStreamSocket> weak_factory_;
58 bool pending_callback_;
59 int error_;
60 };
61
62 } // namespace net
63
64 #endif // NET_SOCKET_STREAM_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698