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

Side by Side Diff: net/tools/quic/quic_spdy_client_stream.cc

Issue 1901733002: Minor changes to allow better testing of server push (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119886961
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "net/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/quic_alarm.h" 10 #include "net/quic/quic_alarm.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 decompressed_headers().length(), &content_length, 83 decompressed_headers().length(), &content_length,
84 &promise_headers)) { 84 &promise_headers)) {
85 DLOG(ERROR) << "Failed to parse promise headers: " 85 DLOG(ERROR) << "Failed to parse promise headers: "
86 << decompressed_headers(); 86 << decompressed_headers();
87 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 87 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
88 return; 88 return;
89 } 89 }
90 MarkHeadersConsumed(decompressed_headers().length()); 90 MarkHeadersConsumed(decompressed_headers().length());
91 91
92 session_->HandlePromised(id(), promised_id, promise_headers); 92 session_->HandlePromised(id(), promised_id, promise_headers);
93 if (visitor() != nullptr) {
94 visitor()->OnPromiseHeadersComplete(promised_id, frame_len);
95 }
93 } 96 }
94 97
95 void QuicSpdyClientStream::OnDataAvailable() { 98 void QuicSpdyClientStream::OnDataAvailable() {
96 if (FLAGS_quic_supports_push_promise) { 99 if (FLAGS_quic_supports_push_promise) {
97 // For push streams, visitor will not be set until the rendezvous 100 // For push streams, visitor will not be set until the rendezvous
98 // between server promise and client request is complete. 101 // between server promise and client request is complete.
99 if (visitor() == nullptr) 102 if (visitor() == nullptr)
100 return; 103 return;
101 } 104 }
102 105
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 bytes_sent += header_bytes_written_; 138 bytes_sent += header_bytes_written_;
136 139
137 if (!body.empty()) { 140 if (!body.empty()) {
138 WriteOrBufferData(body, fin, nullptr); 141 WriteOrBufferData(body, fin, nullptr);
139 } 142 }
140 143
141 return bytes_sent; 144 return bytes_sent;
142 } 145 }
143 146
144 } // namespace net 147 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698