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 <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.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 "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
| 20 #include "net/base/net_errors.h" |
19 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
20 #include "net/base/upload_progress.h" | 22 #include "net/base/upload_progress.h" |
21 #include "net/log/net_log.h" | 23 #include "net/log/net_log.h" |
22 | 24 |
23 namespace net { | 25 namespace net { |
24 | 26 |
25 class ClientSocketHandle; | 27 class ClientSocketHandle; |
26 class DrainableIOBuffer; | 28 class DrainableIOBuffer; |
27 class GrowableIOBuffer; | 29 class GrowableIOBuffer; |
28 class HttpChunkedDecoder; | 30 class HttpChunkedDecoder; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 bool CanReuseConnection() const; | 90 bool CanReuseConnection() const; |
89 | 91 |
90 int64_t received_bytes() const { return received_bytes_; } | 92 int64_t received_bytes() const { return received_bytes_; } |
91 | 93 |
92 int64_t sent_bytes() const { return sent_bytes_; } | 94 int64_t sent_bytes() const { return sent_bytes_; } |
93 | 95 |
94 void GetSSLInfo(SSLInfo* ssl_info); | 96 void GetSSLInfo(SSLInfo* ssl_info); |
95 | 97 |
96 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 98 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
97 | 99 |
| 100 Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, |
| 101 std::vector<uint8_t>* out); |
| 102 |
98 // Encodes the given |payload| in the chunked format to |output|. | 103 // Encodes the given |payload| in the chunked format to |output|. |
99 // Returns the number of bytes written to |output|. |output_size| should | 104 // Returns the number of bytes written to |output|. |output_size| should |
100 // be large enough to store the encoded chunk, which is payload.size() + | 105 // be large enough to store the encoded chunk, which is payload.size() + |
101 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| | 106 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| |
102 // is not large enough. | 107 // is not large enough. |
103 // | 108 // |
104 // The output will look like: "HEX\r\n[payload]\r\n" | 109 // The output will look like: "HEX\r\n[payload]\r\n" |
105 // where HEX is a length in hexdecimal (without the "0x" prefix). | 110 // where HEX is a length in hexdecimal (without the "0x" prefix). |
106 static int EncodeChunk(const base::StringPiece& payload, | 111 static int EncodeChunk(const base::StringPiece& payload, |
107 char* output, | 112 char* output, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 int upload_error_; | 273 int upload_error_; |
269 | 274 |
270 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 275 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
271 | 276 |
272 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 277 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
273 }; | 278 }; |
274 | 279 |
275 } // namespace net | 280 } // namespace net |
276 | 281 |
277 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 282 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
OLD | NEW |