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

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

Issue 2255883002: Pass ClientSocketHandle ownership around in unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « net/http/http_basic_state_unittest.cc ('k') | net/http/http_basic_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 // HttpBasicStream is a simple implementation of HttpStream. It assumes it is 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 6 // not sharing a sharing with any other HttpStreams, therefore it just reads and
7 // writes directly to the Http Stream. 7 // writes directly to the Http Stream.
8 8
9 #ifndef NET_HTTP_HTTP_BASIC_STREAM_H_ 9 #ifndef NET_HTTP_HTTP_BASIC_STREAM_H_
10 #define NET_HTTP_HTTP_BASIC_STREAM_H_ 10 #define NET_HTTP_HTTP_BASIC_STREAM_H_
11 11
12 #include <stdint.h> 12 #include <stdint.h>
13 13
14 #include <memory>
14 #include <string> 15 #include <string>
15 16
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "net/base/net_export.h" 18 #include "net/base/net_export.h"
18 #include "net/http/http_basic_state.h" 19 #include "net/http/http_basic_state.h"
19 #include "net/http/http_stream.h" 20 #include "net/http/http_stream.h"
20 21
21 namespace net { 22 namespace net {
22 23
23 class BoundNetLog; 24 class BoundNetLog;
24 class ClientSocketHandle; 25 class ClientSocketHandle;
25 class HttpResponseInfo; 26 class HttpResponseInfo;
26 struct HttpRequestInfo; 27 struct HttpRequestInfo;
27 class HttpRequestHeaders; 28 class HttpRequestHeaders;
28 class HttpStreamParser; 29 class HttpStreamParser;
29 class IOBuffer; 30 class IOBuffer;
30 31
31 class NET_EXPORT_PRIVATE HttpBasicStream : public HttpStream { 32 class NET_EXPORT_PRIVATE HttpBasicStream : public HttpStream {
32 public: 33 public:
33 // Constructs a new HttpBasicStream. InitializeStream must be called to 34 // Constructs a new HttpBasicStream. InitializeStream must be called to
34 // initialize it correctly. 35 // initialize it correctly.
35 HttpBasicStream(ClientSocketHandle* connection, bool using_proxy); 36 HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection,
37 bool using_proxy);
36 ~HttpBasicStream() override; 38 ~HttpBasicStream() override;
37 39
38 // HttpStream methods: 40 // HttpStream methods:
39 int InitializeStream(const HttpRequestInfo* request_info, 41 int InitializeStream(const HttpRequestInfo* request_info,
40 RequestPriority priority, 42 RequestPriority priority,
41 const BoundNetLog& net_log, 43 const BoundNetLog& net_log,
42 const CompletionCallback& callback) override; 44 const CompletionCallback& callback) override;
43 45
44 int SendRequest(const HttpRequestHeaders& headers, 46 int SendRequest(const HttpRequestHeaders& headers,
45 HttpResponseInfo* response, 47 HttpResponseInfo* response,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 HttpStreamParser* parser() const { return state_.parser(); } 92 HttpStreamParser* parser() const { return state_.parser(); }
91 93
92 HttpBasicState state_; 94 HttpBasicState state_;
93 95
94 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); 96 DISALLOW_COPY_AND_ASSIGN(HttpBasicStream);
95 }; 97 };
96 98
97 } // namespace net 99 } // namespace net
98 100
99 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_ 101 #endif // NET_HTTP_HTTP_BASIC_STREAM_H_
OLDNEW
« no previous file with comments | « net/http/http_basic_state_unittest.cc ('k') | net/http/http_basic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698