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

Side by Side Diff: net/spdy/spdy_stream_unittest.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/spdy_stream.cc ('k') | net/spdy/spdy_test_util_common.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_stream.h" 5 #include "net/spdy/spdy_stream.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <limits> 10 #include <limits>
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 BoundNetLog(), CompletionCallback()); 286 BoundNetLog(), CompletionCallback());
287 ASSERT_THAT(result, IsOk()); 287 ASSERT_THAT(result, IsOk());
288 base::WeakPtr<SpdyStream> stream = stream_request.ReleaseStream(); 288 base::WeakPtr<SpdyStream> stream = stream_request.ReleaseStream();
289 ActivatePushStream(spdy_session.get(), stream.get()); 289 ActivatePushStream(spdy_session.get(), stream.get());
290 290
291 EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty()); 291 EXPECT_TRUE(stream->GetUrlFromHeaders().is_empty());
292 292
293 // Set required request headers. 293 // Set required request headers.
294 SpdyHeaderBlock request_headers; 294 SpdyHeaderBlock request_headers;
295 spdy_util_.AddUrlToHeaderBlock(kStreamUrl, &request_headers); 295 spdy_util_.AddUrlToHeaderBlock(kStreamUrl, &request_headers);
296 stream->OnPushPromiseHeadersReceived(request_headers); 296 stream->OnPushPromiseHeadersReceived(std::move(request_headers));
297 297
298 base::Time response_time = base::Time::Now(); 298 base::Time response_time = base::Time::Now();
299 base::TimeTicks first_byte_time = base::TimeTicks::Now(); 299 base::TimeTicks first_byte_time = base::TimeTicks::Now();
300 // Send some basic response headers. 300 // Send some basic response headers.
301 SpdyHeaderBlock response; 301 SpdyHeaderBlock response;
302 response[spdy_util_.GetStatusKey()] = "200"; 302 response[spdy_util_.GetStatusKey()] = "200";
303 stream->OnInitialResponseHeadersReceived(response, response_time, 303 stream->OnInitialResponseHeadersReceived(response, response_time,
304 first_byte_time); 304 first_byte_time);
305 305
306 // And some more headers. 306 // And some more headers.
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 EXPECT_EQ(response_len, stream->raw_received_bytes()); 1087 EXPECT_EQ(response_len, stream->raw_received_bytes());
1088 1088
1089 // FIN 1089 // FIN
1090 data.Resume(); 1090 data.Resume();
1091 EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_CONNECTION_CLOSED)); 1091 EXPECT_THAT(delegate.WaitForClose(), IsError(ERR_CONNECTION_CLOSED));
1092 } 1092 }
1093 1093
1094 } // namespace test 1094 } // namespace test
1095 1095
1096 } // namespace net 1096 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698