OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #include "net/quic/core/quic_client_promised_info.h" | 5 #include "net/quic/core/quic_client_promised_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/core/spdy_utils.h" | 8 #include "net/quic/core/spdy_utils.h" |
9 | 9 |
10 using net::SpdyHeaderBlock; | 10 using net::SpdyHeaderBlock; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 QuicAsyncStatus QuicClientPromisedInfo::HandleClientRequest( | 106 QuicAsyncStatus QuicClientPromisedInfo::HandleClientRequest( |
107 const SpdyHeaderBlock& request_headers, | 107 const SpdyHeaderBlock& request_headers, |
108 QuicClientPushPromiseIndex::Delegate* delegate) { | 108 QuicClientPushPromiseIndex::Delegate* delegate) { |
109 if (session_->IsClosedStream(id_)) { | 109 if (session_->IsClosedStream(id_)) { |
110 // There was a RST on the response stream. | 110 // There was a RST on the response stream. |
111 session_->DeletePromised(this); | 111 session_->DeletePromised(this); |
112 return QUIC_FAILURE; | 112 return QUIC_FAILURE; |
113 } | 113 } |
114 | 114 |
115 if (is_validating()) { | 115 if (is_validating()) { |
| 116 // The push promise has already been matched to another request though |
| 117 // pending for validation. Returns QUIC_FAILURE to the caller as it couldn't |
| 118 // match a new request any more. This will not affect the validation of the |
| 119 // other request. |
116 return QUIC_FAILURE; | 120 return QUIC_FAILURE; |
117 } | 121 } |
118 | 122 |
119 client_request_delegate_ = delegate; | 123 client_request_delegate_ = delegate; |
120 client_request_headers_.reset(new SpdyHeaderBlock(request_headers.Clone())); | 124 client_request_headers_.reset(new SpdyHeaderBlock(request_headers.Clone())); |
121 if (!response_headers_) { | 125 if (!response_headers_) { |
122 return QUIC_PENDING; | 126 return QUIC_PENDING; |
123 } | 127 } |
124 return FinalValidation(); | 128 return FinalValidation(); |
125 } | 129 } |
126 | 130 |
127 void QuicClientPromisedInfo::Cancel() { | 131 void QuicClientPromisedInfo::Cancel() { |
128 // Don't fire OnRendezvousResult() for client initiated cancel. | 132 // Don't fire OnRendezvousResult() for client initiated cancel. |
129 client_request_delegate_ = nullptr; | 133 client_request_delegate_ = nullptr; |
130 Reset(QUIC_STREAM_CANCELLED); | 134 Reset(QUIC_STREAM_CANCELLED); |
131 } | 135 } |
132 | 136 |
133 } // namespace net | 137 } // namespace net |
OLD | NEW |