diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-03 16:16:26 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-03 16:16:26 +0000 |
commit | 33661e48840aaf44b3efe090b3e947ef83f67a0a (patch) | |
tree | 68f71046efc5e025e92ec7df6139c0738d47822d /jingle/notifier/base | |
parent | 10abb583615dd307782034fabadcc0555c12fcd7 (diff) | |
download | chromium_src-33661e48840aaf44b3efe090b3e947ef83f67a0a.zip chromium_src-33661e48840aaf44b3efe090b3e947ef83f67a0a.tar.gz chromium_src-33661e48840aaf44b3efe090b3e947ef83f67a0a.tar.bz2 |
Add a new GetNegotiatedProtocol method to StreamSocket and implement in all subclasses.
BUG=120890
Review URL: https://chromiumcodereview.appspot.com/9958028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier/base')
5 files changed, 17 insertions, 3 deletions
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc index 922bda4..7ca6afc 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.cc +++ b/jingle/notifier/base/fake_ssl_client_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -338,4 +338,8 @@ base::TimeDelta FakeSSLClientSocket::GetConnectTimeMicros() const { return transport_socket_->GetConnectTimeMicros(); } +net::NextProto FakeSSLClientSocket::GetNegotiatedProtocol() const { + return transport_socket_->GetNegotiatedProtocol(); +} + } // namespace notifier diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h index 3e428cd..a0ef858 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.h +++ b/jingle/notifier/base/fake_ssl_client_socket.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -65,6 +65,7 @@ class FakeSSLClientSocket : public net::StreamSocket { virtual bool UsingTCPFastOpen() const OVERRIDE; virtual int64 NumBytesRead() const OVERRIDE; virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; + virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE; private: enum HandshakeState { diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc index 0e8a733..6584ee0 100644 --- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc +++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc @@ -66,6 +66,7 @@ class MockClientSocket : public net::StreamSocket { MOCK_CONST_METHOD0(UsingTCPFastOpen, bool()); MOCK_CONST_METHOD0(NumBytesRead, int64()); MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta()); + MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto()); }; // Break up |data| into a bunch of chunked MockReads/Writes and push diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc index 5130100..ab89ffb 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket.cc @@ -366,6 +366,13 @@ base::TimeDelta ProxyResolvingClientSocket::GetConnectTimeMicros() const { return base::TimeDelta::FromMicroseconds(-1); } +net::NextProto ProxyResolvingClientSocket::GetNegotiatedProtocol() const { + if (transport_.get() && transport_->socket()) + return transport_->socket()->GetNegotiatedProtocol(); + NOTREACHED(); + return net::kProtoUnknown; +} + void ProxyResolvingClientSocket::CloseTransportSocket() { if (transport_.get() && transport_->socket()) transport_->socket()->Disconnect(); diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h index c89d77b..f94ac4c 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.h +++ b/jingle/notifier/base/proxy_resolving_client_socket.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -65,6 +65,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket { virtual bool UsingTCPFastOpen() const OVERRIDE; virtual int64 NumBytesRead() const OVERRIDE; virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; + virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE; private: // Proxy resolution and connection functions. |