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

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

Issue 2169583002: Eliminate SpdyHeaderBlock copy in SpdyStream. (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 | « no previous file | net/spdy/spdy_session_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_session_pool.h" 5 #include "net/spdy/spdy_session_pool.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog()); 546 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog());
547 547
548 GURL urlA(kTestHostA); 548 GURL urlA(kTestHostA);
549 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( 549 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously(
550 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); 550 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog());
551 test::StreamDelegateDoNothing delegateA(spdy_streamA); 551 test::StreamDelegateDoNothing delegateA(spdy_streamA);
552 spdy_streamA->SetDelegate(&delegateA); 552 spdy_streamA->SetDelegate(&delegateA);
553 553
554 SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(urlA.spec())); 554 SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(urlA.spec()));
555 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND); 555 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
556 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders());
557 556
558 base::RunLoop().RunUntilIdle(); // Allow headers to write. 557 base::RunLoop().RunUntilIdle(); // Allow headers to write.
559 EXPECT_TRUE(delegateA.send_headers_completed()); 558 EXPECT_TRUE(delegateA.send_headers_completed());
560 559
561 sessionA->MakeUnavailable(); 560 sessionA->MakeUnavailable();
562 EXPECT_TRUE(sessionA->IsGoingAway()); 561 EXPECT_TRUE(sessionA->IsGoingAway());
563 EXPECT_FALSE(delegateA.StreamIsClosed()); 562 EXPECT_FALSE(delegateA.StreamIsClosed());
564 563
565 // Set up session B: Available, with a created stream. 564 // Set up session B: Available, with a created stream.
566 StaticSocketDataProvider dataB(reads, arraysize(reads), writes, 565 StaticSocketDataProvider dataB(reads, arraysize(reads), writes,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // there is no pushed stream on any sessions owned by |spdy_session_pool_|. 658 // there is no pushed stream on any sessions owned by |spdy_session_pool_|.
660 base::WeakPtr<SpdySession> session2 = 659 base::WeakPtr<SpdySession> session2 =
661 spdy_session_pool_->FindAvailableSession( 660 spdy_session_pool_->FindAvailableSession(
662 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); 661 key, GURL("http://news.example.org/foo.html"), BoundNetLog());
663 EXPECT_EQ(session.get(), session2.get()); 662 EXPECT_EQ(session.get(), session2.get());
664 663
665 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); 664 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED);
666 } 665 }
667 666
668 } // namespace net 667 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698