| 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/log/net_log.h" | 22 #include "net/log/net_log.h" |
| 23 #include "net/ssl/token_binding.h" |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 | 26 |
| 26 class ClientSocketHandle; | 27 class ClientSocketHandle; |
| 27 class DrainableIOBuffer; | 28 class DrainableIOBuffer; |
| 28 class GrowableIOBuffer; | 29 class GrowableIOBuffer; |
| 29 class HttpChunkedDecoder; | 30 class HttpChunkedDecoder; |
| 30 struct HttpRequestInfo; | 31 struct HttpRequestInfo; |
| 31 class HttpRequestHeaders; | 32 class HttpRequestHeaders; |
| 32 class HttpResponseInfo; | 33 class HttpResponseInfo; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 bool CanReuseConnection() const; | 94 bool CanReuseConnection() const; |
| 94 | 95 |
| 95 int64_t received_bytes() const { return received_bytes_; } | 96 int64_t received_bytes() const { return received_bytes_; } |
| 96 | 97 |
| 97 int64_t sent_bytes() const { return sent_bytes_; } | 98 int64_t sent_bytes() const { return sent_bytes_; } |
| 98 | 99 |
| 99 void GetSSLInfo(SSLInfo* ssl_info); | 100 void GetSSLInfo(SSLInfo* ssl_info); |
| 100 | 101 |
| 101 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 102 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 102 | 103 |
| 103 Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 104 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 104 std::vector<uint8_t>* out); | 105 TokenBindingType tb_type, |
| 106 std::vector<uint8_t>* out); |
| 105 | 107 |
| 106 // Encodes the given |payload| in the chunked format to |output|. | 108 // Encodes the given |payload| in the chunked format to |output|. |
| 107 // Returns the number of bytes written to |output|. |output_size| should | 109 // Returns the number of bytes written to |output|. |output_size| should |
| 108 // be large enough to store the encoded chunk, which is payload.size() + | 110 // be large enough to store the encoded chunk, which is payload.size() + |
| 109 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| | 111 // kChunkHeaderFooterSize. Returns ERR_INVALID_ARGUMENT if |output_size| |
| 110 // is not large enough. | 112 // is not large enough. |
| 111 // | 113 // |
| 112 // The output will look like: "HEX\r\n[payload]\r\n" | 114 // The output will look like: "HEX\r\n[payload]\r\n" |
| 113 // where HEX is a length in hexdecimal (without the "0x" prefix). | 115 // where HEX is a length in hexdecimal (without the "0x" prefix). |
| 114 static int EncodeChunk(const base::StringPiece& payload, | 116 static int EncodeChunk(const base::StringPiece& payload, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 int upload_error_; | 289 int upload_error_; |
| 288 | 290 |
| 289 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 291 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
| 290 | 292 |
| 291 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 293 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
| 292 }; | 294 }; |
| 293 | 295 |
| 294 } // namespace net | 296 } // namespace net |
| 295 | 297 |
| 296 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 298 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
| OLD | NEW |