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

Side by Side Diff: net/http/http_basic_stream.h

Issue 119346: Introduce HttpStream and HttpBasicStream. (Closed)
Patch Set: Add comments to HttpBasicStream. Switch declaration order of Read/Write. Created 11 years, 6 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
« no previous file with comments | « no previous file | net/http/http_network_transaction.h » ('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) 2009 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 // HttpBasicStream is a simple implementation of HttpStream. It assumes it is
6 // not sharing a sharing with any other HttpStreams, therefore it just reads and
7 // writes directly to the Http Stream.
8
9 #ifndef NET_HTTP_HTTP_BASIC_STREAM_H_
10 #define NET_HTTP_HTTP_BASIC_STREAM_H_
11
12 #include "base/basictypes.h"
13 #include "net/base/client_socket_handle.h"
14 #include "net/http/http_stream.h"
15
16 namespace net {
17
18 class HttpBasicStream : public HttpStream {
19 public:
20 explicit HttpBasicStream(ClientSocketHandle* handle) : handle_(handle) {}
21 virtual ~HttpBasicStream() {}
22
23 // HttpStream methods:
24 virtual int Read(IOBuffer* buf,
25 int buf_len,
26 CompletionCallback* callback) {
27 return handle_->socket()->Read(buf, buf_len, callback);
28 }
29
30 virtual int Write(IOBuffer* buf,
31 int buf_len,
32 CompletionCallback* callback) {
33 return handle_->socket()->Write(buf, buf_len, callback);
34 }
35
36 private:
37 ClientSocketHandle* const handle_;
38
39 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream);
40 };
41
42 } // namespace net
43
44 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698