OLD | NEW |
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 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ |
6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ | 6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
18 #include "crypto/ec_private_key.h" | 18 #include "crypto/ec_private_key.h" |
19 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
21 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
22 #include "net/base/upload_progress.h" | 22 #include "net/base/upload_progress.h" |
23 #include "net/log/net_log.h" | 23 #include "net/log/net_log.h" |
| 24 #include "net/ssl/token_binding.h" |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 | 27 |
27 class ClientSocketHandle; | 28 class ClientSocketHandle; |
28 class DrainableIOBuffer; | 29 class DrainableIOBuffer; |
29 class GrowableIOBuffer; | 30 class GrowableIOBuffer; |
30 class HttpChunkedDecoder; | 31 class HttpChunkedDecoder; |
31 struct HttpRequestInfo; | 32 struct HttpRequestInfo; |
32 class HttpRequestHeaders; | 33 class HttpRequestHeaders; |
33 class HttpResponseInfo; | 34 class HttpResponseInfo; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 bool CanReuseConnection() const; | 99 bool CanReuseConnection() const; |
99 | 100 |
100 int64_t received_bytes() const { return received_bytes_; } | 101 int64_t received_bytes() const { return received_bytes_; } |
101 | 102 |
102 int64_t sent_bytes() const { return sent_bytes_; } | 103 int64_t sent_bytes() const { return sent_bytes_; } |
103 | 104 |
104 void GetSSLInfo(SSLInfo* ssl_info); | 105 void GetSSLInfo(SSLInfo* ssl_info); |
105 | 106 |
106 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 107 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
107 | 108 |
108 Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 109 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
109 std::vector<uint8_t>* out); | 110 TokenBindingType tb_type, |
| 111 std::vector<uint8_t>* out); |
110 | 112 |
111 // Encodes the given |payload| in the chunked format to |output|. | 113 // Encodes the given |payload| in the chunked format to |output|. |
112 // Returns the number of bytes written to |output|. |output_size| should | 114 // Returns the number of bytes written to |output|. |output_size| should |
113 // be large enough to store the encoded chunk, which is payload.size() + | 115 // be large enough to store the encoded chunk, which is payload.size() + |
114 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| | 116 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| |
115 // is not large enough. | 117 // is not large enough. |
116 // | 118 // |
117 // The output will look like: "HEX\r\n[payload]\r\n" | 119 // The output will look like: "HEX\r\n[payload]\r\n" |
118 // where HEX is a length in hexdecimal (without the "0x" prefix). | 120 // where HEX is a length in hexdecimal (without the "0x" prefix). |
119 static int EncodeChunk(const base::StringPiece& payload, | 121 static int EncodeChunk(const base::StringPiece& payload, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 int upload_error_; | 294 int upload_error_; |
293 | 295 |
294 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 296 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
295 | 297 |
296 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 298 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
297 }; | 299 }; |
298 | 300 |
299 } // namespace net | 301 } // namespace net |
300 | 302 |
301 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 303 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
OLD | NEW |