summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 23:51:24 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 23:51:24 +0000
commit84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1 (patch)
treed5450ecf0f33e4a1cf654043fc9087e72f708f34 /net
parent3be6c69d07727f429c108a0c649bbbfb20403a47 (diff)
downloadchromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.zip
chromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.tar.gz
chromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.tar.bz2
net: Add NET_API to more code to enable building
a shared net library on Linux, and update base and crypto API definitions. BUG=76997 TEST=none Review URL: http://codereview.chromium.org/7240021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_api.h12
-rw-r--r--net/http/http_auth_gssapi_posix.h9
-rw-r--r--net/http/http_auth_handler_ntlm.h4
-rw-r--r--net/http/http_network_session.cc28
-rw-r--r--net/http/http_network_session.h27
-rw-r--r--net/ocsp/nss_ocsp.h10
-rw-r--r--net/proxy/proxy_config_service_linux.h3
-rw-r--r--net/socket/tcp_client_socket_libevent.h3
-rw-r--r--net/socket/tcp_server_socket_libevent.h6
9 files changed, 64 insertions, 38 deletions
diff --git a/net/base/net_api.h b/net/base/net_api.h
index 8a4f0aa..610e974 100644
--- a/net/base/net_api.h
+++ b/net/base/net_api.h
@@ -10,7 +10,9 @@
// exported to consumers, and NET_TEST that allows unit tests to access features
// not intended to be used directly by real consumers.
-#if defined(WIN32) && defined(NET_DLL)
+#if defined(NET_DLL)
+#if defined(WIN32)
+
#if defined(NET_IMPLEMENTATION)
#define NET_API __declspec(dllexport)
#define NET_TEST __declspec(dllexport)
@@ -18,7 +20,13 @@
#define NET_API __declspec(dllimport)
#define NET_TEST __declspec(dllimport)
#endif // defined(NET_IMPLEMENTATION)
-#else
+
+#else // defined(WIN32)
+#define NET_API __attribute__((visibility("default")))
+#define NET_TEST __attribute__((visibility("default")))
+#endif
+
+#else /// defined(NET_DLL)
#define NET_API
#define NET_TEST
#endif
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h
index 9b1d0ed..5777190 100644
--- a/net/http/http_auth_gssapi_posix.h
+++ b/net/http/http_auth_gssapi_posix.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -11,6 +11,7 @@
#include "base/gtest_prod_util.h"
#include "base/native_library.h"
#include "base/string16.h"
+#include "net/base/net_api.h"
#include "net/http/http_auth.h"
#define GSS_USE_FUNCTION_POINTERS
@@ -26,7 +27,7 @@ extern gss_OID CHROME_GSS_KRB5_MECH_OID_DESC;
// library. The default implementation attempts to load one of the standard
// GSSAPI library implementations, then simply passes the arguments on to
// that implementation.
-class GSSAPILibrary {
+class NET_TEST GSSAPILibrary {
public:
virtual ~GSSAPILibrary() {}
@@ -98,7 +99,7 @@ class GSSAPILibrary {
};
// GSSAPISharedLibrary class is defined here so that unit tests can access it.
-class GSSAPISharedLibrary : public GSSAPILibrary {
+class NET_TEST GSSAPISharedLibrary : public GSSAPILibrary {
public:
// If |gssapi_library_name| is empty, hard-coded default library names are
// used.
@@ -213,7 +214,7 @@ class ScopedSecurityContext {
// TODO(ahendrickson): Share code with HttpAuthSSPI.
-class HttpAuthGSSAPI {
+class NET_TEST HttpAuthGSSAPI {
public:
HttpAuthGSSAPI(GSSAPILibrary* library,
const std::string& scheme,
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h
index c5050af..92322f3 100644
--- a/net/http/http_auth_handler_ntlm.h
+++ b/net/http/http_auth_handler_ntlm.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -35,7 +35,7 @@ namespace net {
class URLSecurityManager;
// Code for handling HTTP NTLM authentication.
-class HttpAuthHandlerNTLM : public HttpAuthHandler {
+class NET_TEST HttpAuthHandlerNTLM : public HttpAuthHandler {
public:
class Factory : public HttpAuthHandlerFactory {
public:
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index d13ec97..27d5cb9 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -63,8 +63,36 @@ void HttpNetworkSession::RemoveResponseDrainer(
response_drainers_.erase(drainer);
}
+SOCKSClientSocketPool* HttpNetworkSession::GetSocketPoolForSOCKSProxy(
+ const HostPortPair& socks_proxy) {
+ return socket_pool_manager_.GetSocketPoolForSOCKSProxy(socks_proxy);
+}
+
+HttpProxyClientSocketPool* HttpNetworkSession::GetSocketPoolForHTTPProxy(
+ const HostPortPair& http_proxy) {
+ return socket_pool_manager_.GetSocketPoolForHTTPProxy(http_proxy);
+}
+
+SSLClientSocketPool* HttpNetworkSession::GetSocketPoolForSSLWithProxy(
+ const HostPortPair& proxy_server) {
+ return socket_pool_manager_.GetSocketPoolForSSLWithProxy(proxy_server);
+}
+
+Value* HttpNetworkSession::SocketPoolInfoToValue() const {
+ return socket_pool_manager_.SocketPoolInfoToValue();
+}
+
Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const {
return spdy_session_pool_.SpdySessionPoolInfoToValue();
}
+void HttpNetworkSession::CloseAllConnections() {
+ socket_pool_manager_.FlushSocketPools();
+ spdy_session_pool_.CloseCurrentSessions();
+}
+
+void HttpNetworkSession::CloseIdleConnections() {
+ socket_pool_manager_.CloseIdleSockets();
+}
+
} // namespace net
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index b92b033..7d5b67f 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -98,19 +98,13 @@ class NET_API HttpNetworkSession
}
SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy(
- const HostPortPair& socks_proxy) {
- return socket_pool_manager_.GetSocketPoolForSOCKSProxy(socks_proxy);
- }
+ const HostPortPair& socks_proxy);
HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy(
- const HostPortPair& http_proxy) {
- return socket_pool_manager_.GetSocketPoolForHTTPProxy(http_proxy);
- }
+ const HostPortPair& http_proxy);
SSLClientSocketPool* GetSocketPoolForSSLWithProxy(
- const HostPortPair& proxy_server) {
- return socket_pool_manager_.GetSocketPoolForSSLWithProxy(proxy_server);
- }
+ const HostPortPair& proxy_server);
CertVerifier* cert_verifier() { return cert_verifier_; }
ProxyService* proxy_service() { return proxy_service_; }
@@ -133,23 +127,14 @@ class NET_API HttpNetworkSession
// Creates a Value summary of the state of the socket pools. The caller is
// responsible for deleting the returned value.
- Value* SocketPoolInfoToValue() const {
- return socket_pool_manager_.SocketPoolInfoToValue();
- }
+ Value* SocketPoolInfoToValue() const;
// Creates a Value summary of the state of the SPDY sessions. The caller is
// responsible for deleting the returned value.
Value* SpdySessionPoolInfoToValue() const;
- void CloseAllConnections() {
- socket_pool_manager_.FlushSocketPools();
- spdy_session_pool_.CloseCurrentSessions();
- }
-
- void CloseIdleConnections() {
- socket_pool_manager_.CloseIdleSockets();
- }
-
+ void CloseAllConnections();
+ void CloseIdleConnections();
private:
friend class base::RefCounted<HttpNetworkSession>;
diff --git a/net/ocsp/nss_ocsp.h b/net/ocsp/nss_ocsp.h
index f88201d..4499a373 100644
--- a/net/ocsp/nss_ocsp.h
+++ b/net/ocsp/nss_ocsp.h
@@ -6,6 +6,8 @@
#define NET_OCSP_NSS_OCSP_H_
#pragma once
+#include "net/base/net_api.h"
+
namespace net {
class URLRequestContext;
@@ -13,19 +15,19 @@ class URLRequestContext;
// Sets the MessageLoop for OCSP to the current message loop.
// This should be called before EnsureOCSPInit() if you want to
// control the message loop for OCSP.
-void SetMessageLoopForOCSP();
+NET_API void SetMessageLoopForOCSP();
// Initializes OCSP handlers for NSS. This must be called before any
// certificate verification functions. This function is thread-safe, and OCSP
// handlers will only ever be initialized once. ShutdownOCSP() must be called
// on shutdown.
-void EnsureOCSPInit();
+NET_API void EnsureOCSPInit();
// This should be called once on shutdown to stop issuing URLRequests for OCSP.
-void ShutdownOCSP();
+NET_API void ShutdownOCSP();
// Set URLRequestContext for OCSP handlers.
-void SetURLRequestContextForOCSP(URLRequestContext* request_context);
+NET_API void SetURLRequestContextForOCSP(URLRequestContext* request_context);
} // namespace net
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index cc50203..1fbcc2c 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/observer_list.h"
+#include "net/base/net_api.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_server.h"
@@ -24,7 +25,7 @@ namespace net {
// Implementation of ProxyConfigService that retrieves the system proxy
// settings from environment variables, gconf, gsettings, or kioslaverc (KDE).
-class BASE_API ProxyConfigServiceLinux : public ProxyConfigService {
+class NET_TEST ProxyConfigServiceLinux : public ProxyConfigService {
public:
// Forward declaration of Delegate.
diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h
index f5e4a28..f77c556 100644
--- a/net/socket/tcp_client_socket_libevent.h
+++ b/net/socket/tcp_client_socket_libevent.h
@@ -20,7 +20,8 @@ namespace net {
class BoundNetLog;
// A client socket that uses TCP as the transport layer.
-class TCPClientSocketLibevent : public StreamSocket, base::NonThreadSafe {
+class NET_TEST TCPClientSocketLibevent : public StreamSocket,
+ public base::NonThreadSafe {
public:
// The IP address(es) and port number to connect to. The TCP socket will try
// each IP address in the list until it succeeds in establishing a
diff --git a/net/socket/tcp_server_socket_libevent.h b/net/socket/tcp_server_socket_libevent.h
index c00158b..9ebd6a4 100644
--- a/net/socket/tcp_server_socket_libevent.h
+++ b/net/socket/tcp_server_socket_libevent.h
@@ -16,9 +16,9 @@ namespace net {
class IPEndPoint;
-class TCPServerSocketLibevent : public ServerSocket,
- public base::NonThreadSafe,
- public MessageLoopForIO::Watcher {
+class NET_TEST TCPServerSocketLibevent : public ServerSocket,
+ public base::NonThreadSafe,
+ public MessageLoopForIO::Watcher {
public:
TCPServerSocketLibevent(net::NetLog* net_log,
const net::NetLog::Source& source);