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

Side by Side Diff: net/quic/core/quic_client_promised_info.cc

Issue 2497083002: Server push cancellation: clean up the code to make sure shared code is in sync with internal code. (Closed)
Patch Set: Created 4 years, 1 month 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) 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
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
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session_test.cc ('k') | net/quic/core/quic_client_promised_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698