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

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

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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_auth_unittest.cc ('k') | net/http/http_basic_state.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 2013 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 // A class that stores the common state between HttpBasicStream and
6 // WebSocketBasicHandshakeStream.
7
8 #ifndef NET_HTTP_HTTP_BASIC_STATE_H_
9 #define NET_HTTP_HTTP_BASIC_STATE_H_
10
11 #include <string>
12
13 #include "base/basictypes.h"
14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "net/base/completion_callback.h"
17 #include "net/base/net_export.h"
18 #include "net/base/request_priority.h"
19
20 namespace net {
21
22 class BoundNetLog;
23 class ClientSocketHandle;
24 class GrowableIOBuffer;
25 class HttpStreamParser;
26 struct HttpRequestInfo;
27
28 class NET_EXPORT_PRIVATE HttpBasicState {
29 public:
30 HttpBasicState(ClientSocketHandle* connection, bool using_proxy);
31 ~HttpBasicState();
32
33 // Initialize() must be called before using any of the other methods.
34 int Initialize(const HttpRequestInfo* request_info,
35 RequestPriority priority,
36 const BoundNetLog& net_log,
37 const CompletionCallback& callback);
38
39 HttpStreamParser* parser() const { return parser_.get(); }
40
41 bool using_proxy() const { return using_proxy_; }
42
43 // Deletes |parser_| and sets it to NULL.
44 void DeleteParser();
45
46 ClientSocketHandle* connection() const { return connection_.get(); }
47
48 scoped_ptr<ClientSocketHandle> ReleaseConnection();
49
50 scoped_refptr<GrowableIOBuffer> read_buf() const;
51
52 // Generates a string of the form "METHOD PATH HTTP/1.1\r\n", based on the
53 // values of request_info_ and using_proxy_.
54 std::string GenerateRequestLine() const;
55
56 private:
57 scoped_refptr<GrowableIOBuffer> read_buf_;
58
59 scoped_ptr<HttpStreamParser> parser_;
60
61 scoped_ptr<ClientSocketHandle> connection_;
62
63 const bool using_proxy_;
64
65 const HttpRequestInfo* request_info_;
66
67 DISALLOW_COPY_AND_ASSIGN(HttpBasicState);
68 };
69
70 } // namespace net
71
72 #endif // NET_HTTP_HTTP_BASIC_STATE_H_
OLDNEW
« no previous file with comments | « net/http/http_auth_unittest.cc ('k') | net/http/http_basic_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698