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

Side by Side Diff: net/spdy/spdy_http_stream.cc

Issue 2144933005: Move some SpdyHeaderBlock instances from heap to stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/spdy/bidirectional_stream_spdy_impl.cc ('k') | net/spdy/spdy_proxy_client_socket.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/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (stream_->type() == SPDY_PUSH_STREAM) { 267 if (stream_->type() == SPDY_PUSH_STREAM) {
268 // Pushed streams do not send any data, and should always be 268 // Pushed streams do not send any data, and should always be
269 // idle. However, we still want to return ERR_IO_PENDING to mimic 269 // idle. However, we still want to return ERR_IO_PENDING to mimic
270 // non-push behavior. The callback will be called when the 270 // non-push behavior. The callback will be called when the
271 // response is received. 271 // response is received.
272 CHECK(response_callback_.is_null()); 272 CHECK(response_callback_.is_null());
273 response_callback_ = callback; 273 response_callback_ = callback;
274 return ERR_IO_PENDING; 274 return ERR_IO_PENDING;
275 } 275 }
276 276
277 std::unique_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock); 277 SpdyHeaderBlock headers;
278 CreateSpdyHeadersFromHttpRequest(*request_info_, request_headers, direct_, 278 CreateSpdyHeadersFromHttpRequest(*request_info_, request_headers, direct_,
279 headers.get()); 279 &headers);
280 stream_->net_log().AddEvent( 280 stream_->net_log().AddEvent(
281 NetLog::TYPE_HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS, 281 NetLog::TYPE_HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS,
282 base::Bind(&SpdyHeaderBlockNetLogCallback, headers.get())); 282 base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
283 result = stream_->SendRequestHeaders( 283 result = stream_->SendRequestHeaders(
284 std::move(headers), 284 std::move(headers),
285 HasUploadData() ? MORE_DATA_TO_SEND : NO_MORE_DATA_TO_SEND); 285 HasUploadData() ? MORE_DATA_TO_SEND : NO_MORE_DATA_TO_SEND);
286 286
287 if (result == ERR_IO_PENDING) { 287 if (result == ERR_IO_PENDING) {
288 CHECK(request_callback_.is_null()); 288 CHECK(request_callback_.is_null());
289 request_callback_ = callback; 289 request_callback_ = callback;
290 } 290 }
291 return result; 291 return result;
292 } 292 }
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; 604 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2;
605 return; 605 return;
606 } 606 }
607 607
608 void SpdyHttpStream::SetPriority(RequestPriority priority) { 608 void SpdyHttpStream::SetPriority(RequestPriority priority) {
609 // TODO(akalin): Plumb this through to |stream_request_| and 609 // TODO(akalin): Plumb this through to |stream_request_| and
610 // |stream_|. 610 // |stream_|.
611 } 611 }
612 612
613 } // namespace net 613 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/bidirectional_stream_spdy_impl.cc ('k') | net/spdy/spdy_proxy_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698