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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
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 |
| 115 if (is_validating()) { |
| 116 return QUIC_FAILURE; |
| 117 } |
| 118 |
114 client_request_delegate_ = delegate; | 119 client_request_delegate_ = delegate; |
115 client_request_headers_.reset(new SpdyHeaderBlock(request_headers.Clone())); | 120 client_request_headers_.reset(new SpdyHeaderBlock(request_headers.Clone())); |
116 if (!response_headers_) { | 121 if (!response_headers_) { |
117 return QUIC_PENDING; | 122 return QUIC_PENDING; |
118 } | 123 } |
119 return FinalValidation(); | 124 return FinalValidation(); |
120 } | 125 } |
121 | 126 |
122 void QuicClientPromisedInfo::Cancel() { | 127 void QuicClientPromisedInfo::Cancel() { |
123 // Don't fire OnRendezvousResult() for client initiated cancel. | 128 // Don't fire OnRendezvousResult() for client initiated cancel. |
124 client_request_delegate_ = nullptr; | 129 client_request_delegate_ = nullptr; |
125 Reset(QUIC_STREAM_CANCELLED); | 130 Reset(QUIC_STREAM_CANCELLED); |
126 } | 131 } |
127 | 132 |
128 } // namespace net | 133 } // namespace net |
OLD | NEW |