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

Side by Side Diff: net/spdy/spdy_proxy_client_socket.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/spdy_http_stream.cc ('k') | net/spdy/spdy_session_pool_unittest.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_proxy_client_socket.h" 5 #include "net/spdy/spdy_proxy_client_socket.h"
6 6
7 #include <algorithm> // min 7 #include <algorithm> // min
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 std::string request_line; 358 std::string request_line;
359 BuildTunnelRequest(endpoint_, authorization_headers, user_agent_, 359 BuildTunnelRequest(endpoint_, authorization_headers, user_agent_,
360 &request_line, &request_.extra_headers); 360 &request_line, &request_.extra_headers);
361 361
362 net_log_.AddEvent( 362 net_log_.AddEvent(
363 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, 363 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS,
364 base::Bind(&HttpRequestHeaders::NetLogCallback, 364 base::Bind(&HttpRequestHeaders::NetLogCallback,
365 base::Unretained(&request_.extra_headers), &request_line)); 365 base::Unretained(&request_.extra_headers), &request_line));
366 366
367 std::unique_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock()); 367 SpdyHeaderBlock headers;
368 CreateSpdyHeadersFromHttpRequest(request_, request_.extra_headers, true, 368 CreateSpdyHeadersFromHttpRequest(request_, request_.extra_headers, true,
369 headers.get()); 369 &headers);
370 370
371 return spdy_stream_->SendRequestHeaders(std::move(headers), 371 return spdy_stream_->SendRequestHeaders(std::move(headers),
372 MORE_DATA_TO_SEND); 372 MORE_DATA_TO_SEND);
373 } 373 }
374 374
375 int SpdyProxyClientSocket::DoSendRequestComplete(int result) { 375 int SpdyProxyClientSocket::DoSendRequestComplete(int result) {
376 if (result < 0) 376 if (result < 0)
377 return result; 377 return result;
378 378
379 // Wait for SYN_REPLY frame from the server 379 // Wait for SYN_REPLY frame from the server
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } else if (!read_callback_.is_null()) { 524 } else if (!read_callback_.is_null()) {
525 // If we have a read_callback_, the we need to make sure we call it back. 525 // If we have a read_callback_, the we need to make sure we call it back.
526 OnDataReceived(std::unique_ptr<SpdyBuffer>()); 526 OnDataReceived(std::unique_ptr<SpdyBuffer>());
527 } 527 }
528 // This may have been deleted by read_callback_, so check first. 528 // This may have been deleted by read_callback_, so check first.
529 if (weak_ptr.get() && !write_callback.is_null()) 529 if (weak_ptr.get() && !write_callback.is_null())
530 write_callback.Run(ERR_CONNECTION_CLOSED); 530 write_callback.Run(ERR_CONNECTION_CLOSED);
531 } 531 }
532 532
533 } // namespace net 533 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_stream.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698