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

Side by Side Diff: net/socket/client_socket_pool_base_unittest.cc

Issue 384873002: This CL changes the lifespan of SSLConnectJobMessengers so that they are created only when needed, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@useloop
Patch Set: Rebase, fixed issue where messenger field wasn't set to NULL after deletion Created 6 years, 4 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
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/socket/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 void set_timeout_duration(base::TimeDelta timeout_duration) { 451 void set_timeout_duration(base::TimeDelta timeout_duration) {
452 timeout_duration_ = timeout_duration; 452 timeout_duration_ = timeout_duration;
453 } 453 }
454 454
455 // ConnectJobFactory implementation. 455 // ConnectJobFactory implementation.
456 456
457 virtual scoped_ptr<ConnectJob> NewConnectJob( 457 virtual scoped_ptr<ConnectJob> NewConnectJob(
458 const std::string& group_name, 458 const std::string& group_name,
459 const TestClientSocketPoolBase::Request& request, 459 const TestClientSocketPoolBase::Request& request,
460 ConnectJob::Delegate* delegate) const OVERRIDE { 460 ConnectJob::Delegate* delegate) OVERRIDE {
461 EXPECT_TRUE(!job_types_ || !job_types_->empty()); 461 EXPECT_TRUE(!job_types_ || !job_types_->empty());
462 TestConnectJob::JobType job_type = job_type_; 462 TestConnectJob::JobType job_type = job_type_;
463 if (job_types_ && !job_types_->empty()) { 463 if (job_types_ && !job_types_->empty()) {
464 job_type = job_types_->front(); 464 job_type = job_types_->front();
465 job_types_->pop_front(); 465 job_types_->pop_front();
466 } 466 }
467 return scoped_ptr<ConnectJob>(new TestConnectJob(job_type, 467 return scoped_ptr<ConnectJob>(new TestConnectJob(job_type,
468 group_name, 468 group_name,
469 request, 469 request,
470 timeout_duration_, 470 timeout_duration_,
(...skipping 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after
4120 request(1)->handle()->Reset(); 4120 request(1)->handle()->Reset();
4121 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a")); 4121 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a"));
4122 4122
4123 EXPECT_EQ(OK, request(2)->WaitForResult()); 4123 EXPECT_EQ(OK, request(2)->WaitForResult());
4124 EXPECT_FALSE(request(1)->have_result()); 4124 EXPECT_FALSE(request(1)->have_result());
4125 } 4125 }
4126 4126
4127 } // namespace 4127 } // namespace
4128 4128
4129 } // namespace net 4129 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698