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

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

Issue 2337253004: Update Token Binding code to the latest drafts (Closed)
Patch Set: Fix compilation error in unit_tests Created 4 years, 3 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
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 // HttpStream provides an abstraction for a basic http streams, SPDY, and QUIC. 5 // HttpStream provides an abstraction for a basic http streams, SPDY, and QUIC.
6 // The HttpStream subtype is expected to manage the underlying transport 6 // The HttpStream subtype is expected to manage the underlying transport
7 // appropriately. For example, a basic http stream will return the transport 7 // appropriately. For example, a basic http stream will return the transport
8 // socket to the pool for reuse. SPDY streams on the other hand leave the 8 // socket to the pool for reuse. SPDY streams on the other hand leave the
9 // transport socket management to the SpdySession. 9 // transport socket management to the SpdySession.
10 10
11 #ifndef NET_HTTP_HTTP_STREAM_H_ 11 #ifndef NET_HTTP_HTTP_STREAM_H_
12 #define NET_HTTP_HTTP_STREAM_H_ 12 #define NET_HTTP_HTTP_STREAM_H_
13 13
14 #include <stdint.h> 14 #include <stdint.h>
15 15
16 #include <memory> 16 #include <memory>
17 #include <vector> 17 #include <vector>
18 18
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "net/base/completion_callback.h" 20 #include "net/base/completion_callback.h"
21 #include "net/base/net_error_details.h" 21 #include "net/base/net_error_details.h"
22 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
23 #include "net/base/net_export.h" 23 #include "net/base/net_export.h"
24 #include "net/base/request_priority.h" 24 #include "net/base/request_priority.h"
25 #include "net/base/upload_progress.h" 25 #include "net/base/upload_progress.h"
26 #include "net/ssl/token_binding.h"
26 27
27 namespace crypto { 28 namespace crypto {
28 class ECPrivateKey; 29 class ECPrivateKey;
29 } 30 }
30 31
31 namespace net { 32 namespace net {
32 33
33 class BoundNetLog; 34 class BoundNetLog;
34 class HttpNetworkSession; 35 class HttpNetworkSession;
35 class HttpRequestHeaders; 36 class HttpRequestHeaders;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Get the SSLCertRequestInfo associated with this stream's connection. 152 // Get the SSLCertRequestInfo associated with this stream's connection.
152 // This should only be called for streams over SSL sockets, otherwise the 153 // This should only be called for streams over SSL sockets, otherwise the
153 // behavior is undefined. 154 // behavior is undefined.
154 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; 155 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0;
155 156
156 // Gets the remote endpoint of the socket that the HTTP stream is using, if 157 // Gets the remote endpoint of the socket that the HTTP stream is using, if
157 // any. Returns true and fills in |endpoint| if it is available; returns false 158 // any. Returns true and fills in |endpoint| if it is available; returns false
158 // and does not modify |endpoint| if it is unavailable. 159 // and does not modify |endpoint| if it is unavailable.
159 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; 160 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0;
160 161
161 // Signs the EKM value for Token Binding from the TLS layer using |*key| and 162 // Generates the signature used in Token Binding using |*key| and for a Token
162 // puts the result in |*out|. Returns OK or ERR_FAILED. 163 // Binding of type |tb_type|, putting the signature in |*out|. Returns OK or
163 virtual Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, 164 // ERR_FAILED.
164 std::vector<uint8_t>* out) = 0; 165 virtual Error GetTokenBindingSignature(crypto::ECPrivateKey* key,
166 TokenBindingType tb_type,
167 std::vector<uint8_t>* out) = 0;
165 168
166 // In the case of an HTTP error or redirect, flush the response body (usually 169 // In the case of an HTTP error or redirect, flush the response body (usually
167 // a simple error or "this page has moved") so that we can re-use the 170 // a simple error or "this page has moved") so that we can re-use the
168 // underlying connection. This stream is responsible for deleting itself when 171 // underlying connection. This stream is responsible for deleting itself when
169 // draining is complete. 172 // draining is complete.
170 virtual void Drain(HttpNetworkSession* session) = 0; 173 virtual void Drain(HttpNetworkSession* session) = 0;
171 174
172 // Get the network error details this stream is encountering. 175 // Get the network error details this stream is encountering.
173 // Fills in |details| if it is available; leaves |details| unchanged if it 176 // Fills in |details| if it is available; leaves |details| unchanged if it
174 // is unavailable. 177 // is unavailable.
(...skipping 12 matching lines...) Expand all
187 // subclass does not support renewing the stream, NULL is returned. 190 // subclass does not support renewing the stream, NULL is returned.
188 virtual HttpStream* RenewStreamForAuth() = 0; 191 virtual HttpStream* RenewStreamForAuth() = 0;
189 192
190 private: 193 private:
191 DISALLOW_COPY_AND_ASSIGN(HttpStream); 194 DISALLOW_COPY_AND_ASSIGN(HttpStream);
192 }; 195 };
193 196
194 } // namespace net 197 } // namespace net
195 198
196 #endif // NET_HTTP_HTTP_STREAM_H_ 199 #endif // NET_HTTP_HTTP_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698