diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 22:37:16 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 22:37:16 +0000 |
commit | d9da5fe263e748c75d85816ee6bae46b2b9de9c9 (patch) | |
tree | f6dbf611550dc1118fcff2cfe9429ca721a5c1bf /net/socket/socket_test_util.cc | |
parent | a691b8874c225cf530396661264a77159db38780 (diff) | |
download | chromium_src-d9da5fe263e748c75d85816ee6bae46b2b9de9c9.zip chromium_src-d9da5fe263e748c75d85816ee6bae46b2b9de9c9.tar.gz chromium_src-d9da5fe263e748c75d85816ee6bae46b2b9de9c9.tar.bz2 |
Integrate the SpdyProxyClientSocket into the HttpStreamRequest
to support fetching HTTPS URLS over a SPDY Proxy.
BUG=29625
TEST=HttpNetworkTransactionTest.HttpsProxySpdyConnect
Review URL: http://codereview.chromium.org/3417010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socket_test_util.cc')
-rw-r--r-- | net/socket/socket_test_util.cc | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index cba4b1c..414d395 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -127,7 +127,6 @@ void MockClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { void MockClientSocket::GetSSLCertRequestInfo( net::SSLCertRequestInfo* cert_request_info) { - NOTREACHED(); } SSLClientSocket::NextProtoStatus @@ -1235,100 +1234,4 @@ const char kSOCKS5OkResponse[] = { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); -MockSSLClientSocketPool::MockSSLClientSocketPool( - int max_sockets, - int max_sockets_per_group, - ClientSocketPoolHistograms* histograms, - ClientSocketFactory* socket_factory, - TCPClientSocketPool* tcp_pool) - : SSLClientSocketPool(max_sockets, max_sockets_per_group, histograms, - NULL, NULL, socket_factory, - tcp_pool, - NULL, NULL, NULL, NULL), - client_socket_factory_(socket_factory), - release_count_(0), - cancel_count_(0) { -} - -int MockSSLClientSocketPool::RequestSocket(const std::string& group_name, - const void* socket_params, - RequestPriority priority, - ClientSocketHandle* handle, - CompletionCallback* callback, - const BoundNetLog& net_log) { - ClientSocket* socket = client_socket_factory_->CreateTCPClientSocket( - AddressList(), net_log.net_log(), net::NetLog::Source()); - MockConnectJob* job = new MockConnectJob(socket, handle, callback); - job_list_.push_back(job); - handle->set_pool_id(1); - return job->Connect(); -} - -void MockSSLClientSocketPool::CancelRequest(const std::string& group_name, - ClientSocketHandle* handle) { - std::vector<MockConnectJob*>::iterator i; - for (i = job_list_.begin(); i != job_list_.end(); ++i) { - if ((*i)->CancelHandle(handle)) { - cancel_count_++; - break; - } - } -} - -void MockSSLClientSocketPool::ReleaseSocket(const std::string& group_name, - ClientSocket* socket, int id) { - EXPECT_EQ(1, id); - release_count_++; - delete socket; -} - -MockSSLClientSocketPool::~MockSSLClientSocketPool() {} - -MockSSLClientSocketPool::MockConnectJob::MockConnectJob( - ClientSocket* socket, - ClientSocketHandle* handle, - CompletionCallback* callback) - : socket_(socket), - handle_(handle), - user_callback_(callback), - ALLOW_THIS_IN_INITIALIZER_LIST( - connect_callback_(this, &MockConnectJob::OnConnect)) { -} - -int MockSSLClientSocketPool::MockConnectJob::Connect() { - int rv = socket_->Connect(&connect_callback_); - if (rv == OK) { - user_callback_ = NULL; - OnConnect(OK); - } - return rv; -} - -bool MockSSLClientSocketPool::MockConnectJob::CancelHandle( - const ClientSocketHandle* handle) { - if (handle != handle_) - return false; - socket_.reset(); - handle_ = NULL; - user_callback_ = NULL; - return true; -} - -void MockSSLClientSocketPool::MockConnectJob::OnConnect(int rv) { - if (!socket_.get()) - return; - if (rv == OK) { - handle_->set_socket(socket_.release()); - } else { - socket_.reset(); - } - - handle_ = NULL; - - if (user_callback_) { - CompletionCallback* callback = user_callback_; - user_callback_ = NULL; - callback->Run(rv); - } -} } // namespace net |