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

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

Issue 2096713002: Reduce SpdyHeaderBlock copies with move semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear() does not work after all. Created 4 years, 6 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_session.cc ('k') | 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 base::WeakPtr<SpdySession> sessionA = 549 base::WeakPtr<SpdySession> sessionA =
550 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog()); 550 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog());
551 551
552 GURL urlA(kTestHostA); 552 GURL urlA(kTestHostA);
553 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( 553 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously(
554 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); 554 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog());
555 test::StreamDelegateDoNothing delegateA(spdy_streamA); 555 test::StreamDelegateDoNothing delegateA(spdy_streamA);
556 spdy_streamA->SetDelegate(&delegateA); 556 spdy_streamA->SetDelegate(&delegateA);
557 557
558 std::unique_ptr<SpdyHeaderBlock> headers( 558 std::unique_ptr<SpdyHeaderBlock> headers(
559 spdy_util.ConstructGetHeaderBlock(urlA.spec())); 559 new SpdyHeaderBlock(spdy_util.ConstructGetHeaderBlock(urlA.spec())));
560 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND); 560 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
561 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders()); 561 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders());
562 562
563 base::RunLoop().RunUntilIdle(); // Allow headers to write. 563 base::RunLoop().RunUntilIdle(); // Allow headers to write.
564 EXPECT_TRUE(delegateA.send_headers_completed()); 564 EXPECT_TRUE(delegateA.send_headers_completed());
565 565
566 sessionA->MakeUnavailable(); 566 sessionA->MakeUnavailable();
567 EXPECT_TRUE(sessionA->IsGoingAway()); 567 EXPECT_TRUE(sessionA->IsGoingAway());
568 EXPECT_FALSE(delegateA.StreamIsClosed()); 568 EXPECT_FALSE(delegateA.StreamIsClosed());
569 569
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // there is no pushed stream on any sessions owned by |spdy_session_pool_|. 664 // there is no pushed stream on any sessions owned by |spdy_session_pool_|.
665 base::WeakPtr<SpdySession> session2 = 665 base::WeakPtr<SpdySession> session2 =
666 spdy_session_pool_->FindAvailableSession( 666 spdy_session_pool_->FindAvailableSession(
667 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); 667 key, GURL("http://news.example.org/foo.html"), BoundNetLog());
668 EXPECT_EQ(session.get(), session2.get()); 668 EXPECT_EQ(session.get(), session2.get());
669 669
670 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); 670 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED);
671 } 671 }
672 672
673 } // namespace net 673 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698