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

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

Issue 2174943002: Avoid SpdyHeaderBlock copy in SpdyStream::OnPushPromiseHeadersReceived(). (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/header_coalescer.h ('k') | net/spdy/spdy_session.h » ('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) 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/spdy/header_coalescer.h" 5 #include "net/spdy/header_coalescer.h"
6 6
7 #include <utility>
8
7 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
8 10
9 namespace net { 11 namespace net {
10 12
11 const size_t kMaxHeaderListSize = 256 * 1024; 13 const size_t kMaxHeaderListSize = 256 * 1024;
12 14
13 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { 15 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) {
14 if (error_seen_) { 16 if (error_seen_) {
15 return; 17 return;
16 } 18 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction. 50 // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction.
49 s.append("; "); 51 s.append("; ");
50 } else { 52 } else {
51 base::StringPiece("\0", 1).AppendToString(&s); 53 base::StringPiece("\0", 1).AppendToString(&s);
52 } 54 }
53 value.AppendToString(&s); 55 value.AppendToString(&s);
54 headers_.ReplaceOrAppendHeader(key, s); 56 headers_.ReplaceOrAppendHeader(key, s);
55 } 57 }
56 } 58 }
57 59
60 SpdyHeaderBlock HeaderCoalescer::release_headers() {
61 DCHECK(headers_valid_);
62 headers_valid_ = false;
63 return std::move(headers_);
64 }
65
58 } // namespace net 66 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/header_coalescer.h ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698