summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authortyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 13:39:52 +0000
committertyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 13:39:52 +0000
commitdd5035e1af0824ba1e90710ca616faf6aa944ef8 (patch)
tree2498c8208aabf4eb58ba9c6dc3d0b70db37fea8e /net/socket_stream
parent629bbaaa1df13870e337c7551b67d77a53ec209f (diff)
downloadchromium_src-dd5035e1af0824ba1e90710ca616faf6aa944ef8.zip
chromium_src-dd5035e1af0824ba1e90710ca616faf6aa944ef8.tar.gz
chromium_src-dd5035e1af0824ba1e90710ca616faf6aa944ef8.tar.bz2
Move delegate_ checking from DoResolveHostComplete to DoResolveProtocol.
DoResolveHostComplete should just investigate the result of DoResolveHost. The real user of delegate_ is DoResolveProtocol. Review URL: https://chromiumcodereview.appspot.com/16007018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 5639171..2b3b941 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -689,7 +689,7 @@ int SocketStream::DoResolveHost() {
}
int SocketStream::DoResolveHostComplete(int result) {
- if (result == OK && delegate_)
+ if (result == OK)
next_state_ = STATE_RESOLVE_PROTOCOL;
else
next_state_ = STATE_CLOSE;
@@ -699,6 +699,12 @@ int SocketStream::DoResolveHostComplete(int result) {
int SocketStream::DoResolveProtocol(int result) {
DCHECK_EQ(OK, result);
+
+ if (!delegate_) {
+ next_state_ = STATE_CLOSE;
+ return result;
+ }
+
next_state_ = STATE_RESOLVE_PROTOCOL_COMPLETE;
result = delegate_->OnStartOpenConnection(this, io_callback_);
if (result == ERR_IO_PENDING)