summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 23:49:35 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 23:49:35 +0000
commite7f74dada8e347bde1e7e88e88d6fd3c9882375a (patch)
treed563b0762ffe6062005b24e277dd1bb4a8019aef /jingle
parent15ff0118ad82bfc4b89ad612f130fed0df512612 (diff)
downloadchromium_src-e7f74dada8e347bde1e7e88e88d6fd3c9882375a.zip
chromium_src-e7f74dada8e347bde1e7e88e88d6fd3c9882375a.tar.gz
chromium_src-e7f74dada8e347bde1e7e88e88d6fd3c9882375a.tar.bz2
Added GetLocalAddress() in net::ClientSocket.
BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/6840033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82190 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/glue/stream_socket_adapter.cc4
-rw-r--r--jingle/glue/stream_socket_adapter.h1
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.cc4
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.h1
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket_unittest.cc1
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.cc8
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.h1
7 files changed, 20 insertions, 0 deletions
diff --git a/jingle/glue/stream_socket_adapter.cc b/jingle/glue/stream_socket_adapter.cc
index ea38aef..315dc53 100644
--- a/jingle/glue/stream_socket_adapter.cc
+++ b/jingle/glue/stream_socket_adapter.cc
@@ -55,6 +55,10 @@ int StreamSocketAdapter::GetPeerAddress(net::AddressList* address) const {
return net::OK;
}
+int StreamSocketAdapter::GetLocalAddress(net::IPEndPoint* address) const {
+ return net::ERR_UNEXPECTED;
+}
+
const net::BoundNetLog& StreamSocketAdapter::NetLog() const {
DCHECK_EQ(MessageLoop::current(), message_loop_);
return net_log_;
diff --git a/jingle/glue/stream_socket_adapter.h b/jingle/glue/stream_socket_adapter.h
index 910aa57..14a6bfc 100644
--- a/jingle/glue/stream_socket_adapter.h
+++ b/jingle/glue/stream_socket_adapter.h
@@ -34,6 +34,7 @@ class StreamSocketAdapter : public net::ClientSocket,
virtual bool IsConnected() const;
virtual bool IsConnectedAndIdle() const;
virtual int GetPeerAddress(net::AddressList* address) const;
+ virtual int GetLocalAddress(net::IPEndPoint* address) const;
virtual const net::BoundNetLog& NetLog() const;
virtual void SetSubresourceSpeculation();
virtual void SetOmniboxSpeculation();
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc
index 2cc643d..ebbad07 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket.cc
@@ -312,6 +312,10 @@ int FakeSSLClientSocket::GetPeerAddress(net::AddressList* address) const {
return transport_socket_->GetPeerAddress(address);
}
+int FakeSSLClientSocket::GetLocalAddress(net::IPEndPoint* address) const {
+ return transport_socket_->GetLocalAddress(address);
+}
+
const net::BoundNetLog& FakeSSLClientSocket::NetLog() const {
return transport_socket_->NetLog();
}
diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h
index 3dc0406..14c539b 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.h
+++ b/jingle/notifier/base/fake_ssl_client_socket.h
@@ -56,6 +56,7 @@ class FakeSSLClientSocket : public net::ClientSocket {
virtual bool IsConnected() const;
virtual bool IsConnectedAndIdle() const;
virtual int GetPeerAddress(net::AddressList* address) const;
+ virtual int GetLocalAddress(net::IPEndPoint* address) const;
virtual const net::BoundNetLog& NetLog() const;
virtual void SetSubresourceSpeculation();
virtual void SetOmniboxSpeculation();
diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
index 6f9ac1d..7b0b58f 100644
--- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
@@ -56,6 +56,7 @@ class MockClientSocket : public net::ClientSocket {
MOCK_CONST_METHOD0(IsConnected, bool());
MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
MOCK_CONST_METHOD1(GetPeerAddress, int(net::AddressList*));
+ MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&());
MOCK_METHOD0(SetSubresourceSpeculation, void());
MOCK_METHOD0(SetOmniboxSpeculation, void());
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc
index 82c300e..bdf3766 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.cc
+++ b/jingle/notifier/base/proxy_resolving_client_socket.cc
@@ -293,6 +293,14 @@ int ProxyResolvingClientSocket::GetPeerAddress(
return net::ERR_SOCKET_NOT_CONNECTED;
}
+int ProxyResolvingClientSocket::GetLocalAddress(
+ net::IPEndPoint* address) const {
+ if (transport_.get() && transport_->socket())
+ return transport_->socket()->GetLocalAddress(address);
+ NOTREACHED();
+ return net::ERR_SOCKET_NOT_CONNECTED;
+}
+
const net::BoundNetLog& ProxyResolvingClientSocket::NetLog() const {
if (transport_.get() && transport_->socket())
return transport_->socket()->NetLog();
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h
index 3622923..2b1b90e 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.h
+++ b/jingle/notifier/base/proxy_resolving_client_socket.h
@@ -51,6 +51,7 @@ class ProxyResolvingClientSocket : public net::ClientSocket {
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectedAndIdle() const OVERRIDE;
virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE;
+ virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE;
virtual const net::BoundNetLog& NetLog() const OVERRIDE;
virtual void SetSubresourceSpeculation() OVERRIDE;
virtual void SetOmniboxSpeculation() OVERRIDE;