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

Unified Diff: net/http/http_proxy_client_socket_pool.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_proxy_client_socket_pool.h ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_proxy_client_socket_pool.cc
diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc
index c963d2c33a4233ae105c55edaf4aa6619b6dedf2..1f45882c526ed6bcdcffa2d21d2dc7ba55b11b4b 100644
--- a/net/http/http_proxy_client_socket_pool.cc
+++ b/net/http/http_proxy_client_socket_pool.cc
@@ -11,6 +11,7 @@
#include "base/values.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
+#include "net/base/proxy_delegate.h"
#include "net/http/http_network_session.h"
#include "net/http/http_proxy_client_socket.h"
#include "net/socket/client_socket_factory.h"
@@ -130,8 +131,10 @@ void HttpProxyConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) {
void HttpProxyConnectJob::OnIOComplete(int result) {
int rv = DoLoop(result);
- if (rv != ERR_IO_PENDING)
+ if (rv != ERR_IO_PENDING) {
+ NotifyProxyDelegateOfCompletion(rv);
NotifyDelegateOfCompletion(rv); // Deletes |this|
+ }
}
int HttpProxyConnectJob::DoLoop(int result) {
@@ -362,13 +365,29 @@ int HttpProxyConnectJob::DoSpdyProxyCreateStreamComplete(int result) {
return transport_socket_->Connect(callback_);
}
+void HttpProxyConnectJob::NotifyProxyDelegateOfCompletion(int result) {
+ if (!params_->proxy_delegate())
+ return;
+
+ const HostPortPair& proxy_server = params_->destination().host_port_pair();
+ params_->proxy_delegate()->OnTunnelConnectCompleted(params_->endpoint(),
+ proxy_server,
+ result);
+}
+
int HttpProxyConnectJob::ConnectInternal() {
if (params_->transport_params().get()) {
next_state_ = STATE_TCP_CONNECT;
} else {
next_state_ = STATE_SSL_CONNECT;
}
- return DoLoop(OK);
+
+ int rv = DoLoop(OK);
+ if (rv != ERR_IO_PENDING) {
+ NotifyProxyDelegateOfCompletion(rv);
+ }
+
+ return rv;
}
HttpProxyClientSocketPool::
« no previous file with comments | « net/http/http_proxy_client_socket_pool.h ('k') | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698