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

Side by Side Diff: net/quic/quic_spdy_server_stream.cc

Issue 504953003: Remove implicit conversions from scoped_refptr to T* in net/quic/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_in_memory_cache.h ('k') | net/quic/quic_stream_factory_test.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 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 #include "net/quic/quic_spdy_server_stream.h" 5 #include "net/quic/quic_spdy_server_stream.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/quic_in_memory_cache.h" 9 #include "net/quic/quic_in_memory_cache.h"
10 #include "net/quic/quic_session.h" 10 #include "net/quic/quic_session.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 DVLOG(1) << "Sending response for stream " << id(); 131 DVLOG(1) << "Sending response for stream " << id();
132 SendHeadersAndBody(response->headers(), response->body()); 132 SendHeadersAndBody(response->headers(), response->body());
133 } 133 }
134 134
135 void QuicSpdyServerStream::SendErrorResponse() { 135 void QuicSpdyServerStream::SendErrorResponse() {
136 DVLOG(1) << "Sending error response for stream " << id(); 136 DVLOG(1) << "Sending error response for stream " << id();
137 scoped_refptr<HttpResponseHeaders> headers 137 scoped_refptr<HttpResponseHeaders> headers
138 = new HttpResponseHeaders(string("HTTP/1.1 500 Server Error") + '\0' + 138 = new HttpResponseHeaders(string("HTTP/1.1 500 Server Error") + '\0' +
139 "content-length: 3" + '\0' + '\0'); 139 "content-length: 3" + '\0' + '\0');
140 SendHeadersAndBody(*headers, "bad"); 140 SendHeadersAndBody(*headers.get(), "bad");
141 } 141 }
142 142
143 void QuicSpdyServerStream::SendHeadersAndBody( 143 void QuicSpdyServerStream::SendHeadersAndBody(
144 const HttpResponseHeaders& response_headers, 144 const HttpResponseHeaders& response_headers,
145 StringPiece body) { 145 StringPiece body) {
146 // We only support SPDY and HTTP, and neither handles bidirectional streaming. 146 // We only support SPDY and HTTP, and neither handles bidirectional streaming.
147 if (!read_side_closed()) { 147 if (!read_side_closed()) {
148 CloseReadSide(); 148 CloseReadSide();
149 } 149 }
150 150
151 SpdyHeaderBlock header_block; 151 SpdyHeaderBlock header_block;
152 CreateSpdyHeadersFromHttpResponse(response_headers, 152 CreateSpdyHeadersFromHttpResponse(response_headers,
153 kDefaultSpdyMajorVersion, 153 kDefaultSpdyMajorVersion,
154 &header_block); 154 &header_block);
155 155
156 WriteHeaders(header_block, body.empty(), NULL); 156 WriteHeaders(header_block, body.empty(), NULL);
157 157
158 if (!body.empty()) { 158 if (!body.empty()) {
159 WriteOrBufferData(body, true, NULL); 159 WriteOrBufferData(body, true, NULL);
160 } 160 }
161 } 161 }
162 162
163 } // namespace net 163 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_in_memory_cache.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698