OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 5 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Called by |QuicSpdyClientStream| on receipt of response headers, | 59 // Called by |QuicSpdyClientStream| on receipt of response headers, |
60 // needed to detect promised server push streams, as part of | 60 // needed to detect promised server push streams, as part of |
61 // client-request to push-stream rendezvous. | 61 // client-request to push-stream rendezvous. |
62 void OnInitialHeadersComplete(QuicStreamId stream_id, | 62 void OnInitialHeadersComplete(QuicStreamId stream_id, |
63 const SpdyHeaderBlock& response_headers); | 63 const SpdyHeaderBlock& response_headers); |
64 | 64 |
65 // Called by |QuicSpdyClientStream| on receipt of PUSH_PROMISE, does | 65 // Called by |QuicSpdyClientStream| on receipt of PUSH_PROMISE, does |
66 // some session level validation and creates the | 66 // some session level validation and creates the |
67 // |QuicClientPromisedInfo| inserting into maps by (promised) id and | 67 // |QuicClientPromisedInfo| inserting into maps by (promised) id and |
68 // url. | 68 // url. Returns true if a new push promise is accepted. Reset the promised and |
69 virtual void HandlePromised(QuicStreamId associated_id, | 69 // returns false otherwiese. |
| 70 virtual bool HandlePromised(QuicStreamId associated_id, |
70 QuicStreamId promised_id, | 71 QuicStreamId promised_id, |
71 const SpdyHeaderBlock& headers); | 72 const SpdyHeaderBlock& headers); |
72 | 73 |
73 // For cross-origin server push, this should verify the server is | 74 // For cross-origin server push, this should verify the server is |
74 // authoritative per [RFC2818], Section 3. Roughly, subjectAltName | 75 // authoritative per [RFC2818], Section 3. Roughly, subjectAltName |
75 // std::list in the certificate should contain a matching DNS name, or IP | 76 // std::list in the certificate should contain a matching DNS name, or IP |
76 // address. |hostname| is derived from the ":authority" header field of | 77 // address. |hostname| is derived from the ":authority" header field of |
77 // the PUSH_PROMISE frame, port if present there will be dropped. | 78 // the PUSH_PROMISE frame, port if present there will be dropped. |
78 virtual bool IsAuthorized(const std::string& hostname) = 0; | 79 virtual bool IsAuthorized(const std::string& hostname) = 0; |
79 | 80 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 QuicClientPushPromiseIndex* push_promise_index_; | 129 QuicClientPushPromiseIndex* push_promise_index_; |
129 QuicPromisedByIdMap promised_by_id_; | 130 QuicPromisedByIdMap promised_by_id_; |
130 QuicStreamId largest_promised_stream_id_; | 131 QuicStreamId largest_promised_stream_id_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); | 133 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); |
133 }; | 134 }; |
134 | 135 |
135 } // namespace net | 136 } // namespace net |
136 | 137 |
137 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 138 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
OLD | NEW |