diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 23:20:59 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 23:20:59 +0000 |
commit | d01c6bd4b1d5d6bf6a6d3ca5ef1166523edbd071 (patch) | |
tree | f16c2ed64a9e3a3cb38d1eaf26f8c2efc047d38d | |
parent | 3b317914486afcbbc91964d87f1ccea95ce2c12c (diff) | |
download | chromium_src-d01c6bd4b1d5d6bf6a6d3ca5ef1166523edbd071.zip chromium_src-d01c6bd4b1d5d6bf6a6d3ca5ef1166523edbd071.tar.gz chromium_src-d01c6bd4b1d5d6bf6a6d3ca5ef1166523edbd071.tar.bz2 |
net: Add NET_API to more code, this time what's used by chrome.dll
BUG=76997
TEST=none
Review URL: http://codereview.chromium.org/7082026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87393 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/base/dns_util.h | 2 | ||||
-rw-r--r-- | net/base/host_resolver.h | 2 | ||||
-rw-r--r-- | net/base/net_errors.h | 7 | ||||
-rw-r--r-- | net/base/net_util.h | 16 | ||||
-rw-r--r-- | net/base/network_change_notifier.h | 2 | ||||
-rw-r--r-- | net/base/x509_certificate.h | 2 | ||||
-rw-r--r-- | net/http/http_alternate_protocols.h | 2 | ||||
-rw-r--r-- | net/http/http_request_headers.h | 2 | ||||
-rw-r--r-- | net/socket/client_socket_pool_manager.h | 7 | ||||
-rw-r--r-- | net/socket/dns_cert_provenance_checker.h | 7 | ||||
-rw-r--r-- | net/socket/tcp_client_socket.h | 5 | ||||
-rw-r--r-- | net/url_request/url_request_context_getter.h | 5 | ||||
-rw-r--r-- | net/url_request/url_request_error_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_file_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_filter.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_redirect_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_simple_job.h | 3 |
17 files changed, 43 insertions, 31 deletions
diff --git a/net/base/dns_util.h b/net/base/dns_util.h index 781c104..d70dfd7 100644 --- a/net/base/dns_util.h +++ b/net/base/dns_util.h @@ -29,7 +29,7 @@ NET_TEST std::string DNSDomainToString(const std::string& domain); NET_TEST bool IsSTD3ASCIIValidCharacter(char c); // Returns the hostname by trimming the ending dot, if one exists. -std::string TrimEndingDot(const std::string& host); +NET_API std::string TrimEndingDot(const std::string& host); // DNS resource record types. See // http://www.iana.org/assignments/dns-parameters diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 637e671..9850617 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -202,7 +202,7 @@ class NET_API HostResolver { // This class represents the task of resolving a hostname (or IP address // literal) to an AddressList object. It wraps HostResolver to resolve only a // single hostname at a time and cancels this request when going out of scope. -class SingleRequestHostResolver { +class NET_API SingleRequestHostResolver { public: // |resolver| must remain valid for the lifetime of |this|. explicit SingleRequestHostResolver(HostResolver* resolver); diff --git a/net/base/net_errors.h b/net/base/net_errors.h index 0245169..a12813d 100644 --- a/net/base/net_errors.h +++ b/net/base/net_errors.h @@ -9,11 +9,12 @@ #include <vector> #include "base/basictypes.h" +#include "net/base/net_api.h" namespace net { // Error domain of the net module's error codes. -extern const char kErrorDomain[]; +NET_API extern const char kErrorDomain[]; // Error values are negative. enum Error { @@ -29,7 +30,7 @@ enum Error { }; // Returns a textual representation of the error code for logging purposes. -const char* ErrorToString(int error); +NET_API const char* ErrorToString(int error); // Returns true if |error| is a certificate error code. inline bool IsCertificateError(int error) { @@ -39,7 +40,7 @@ inline bool IsCertificateError(int error) { } // Map system error code to Error. -Error MapSystemError(int os_error); +NET_API Error MapSystemError(int os_error); // Returns a list of all the possible net error codes (not counting OK). This // is intended for use with UMA histograms that are reporting the result of diff --git a/net/base/net_util.h b/net/base/net_util.h index fef75ba..7ded66d 100644 --- a/net/base/net_util.h +++ b/net/base/net_util.h @@ -199,8 +199,8 @@ NET_API string16 IDNToUnicode(const std::string& host, // Canonicalizes |host| and returns it. Also fills |host_info| with // IP address information. |host_info| must not be NULL. -std::string CanonicalizeHost(const std::string& host, - url_canon::CanonHostInfo* host_info); +NET_API std::string CanonicalizeHost(const std::string& host, + url_canon::CanonHostInfo* host_info); // Returns true if |host| is not an IP address and is compliant with a set of // rules based on RFC 1738 and tweaked to be compatible with the real world. @@ -222,7 +222,7 @@ NET_API bool IsCanonicalizedHostCompliant(const std::string& host, // Call these functions to get the html snippet for a directory listing. // The return values of both functions are in UTF-8. -std::string GetDirectoryListingHeader(const string16& title); +NET_API std::string GetDirectoryListingHeader(const string16& title); // Given the name of a file in a directory (ftp or local) and // other information (is_dir, size, modification time), it returns @@ -278,9 +278,9 @@ int SetNonBlocking(int fd); // Formats the host in |url| and appends it to |output|. The host formatter // takes the same accept languages component as ElideURL(). -void AppendFormattedHost(const GURL& url, - const std::string& languages, - string16* output); +NET_API void AppendFormattedHost(const GURL& url, + const std::string& languages, + string16* output); // Creates a string representation of |url|. The IDN host name may be in Unicode // if |languages| accepts the Unicode representation. |format_type| is a bitmask @@ -330,7 +330,7 @@ inline string16 FormatUrl(const GURL& url, const std::string& languages) { // Returns whether FormatUrl() would strip a trailing slash from |url|, given a // format flag including kFormatUrlOmitTrailingSlashOnBareHostname. -bool CanStripTrailingSlash(const GURL& url); +NET_API bool CanStripTrailingSlash(const GURL& url); // Strip the portions of |url| that aren't core to the network request. // - user name / password @@ -353,7 +353,7 @@ class NET_API ScopedPortException { // Perform a simplistic test to see if IPv6 is supported by trying to create an // IPv6 socket. // TODO(jar): Make test more in-depth as needed. -bool IPv6Supported(); +NET_API bool IPv6Supported(); // Returns true if it can determine that only loopback addresses are configured. // i.e. if only 127.0.0.1 and ::1 are routable. diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h index 2683956e..1a53096 100644 --- a/net/base/network_change_notifier.h +++ b/net/base/network_change_notifier.h @@ -32,7 +32,7 @@ class NET_API NetworkChangeNotifier { DISALLOW_COPY_AND_ASSIGN(IPAddressObserver); }; - class OnlineStateObserver { + class NET_API OnlineStateObserver { public: virtual ~OnlineStateObserver() {} diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index fde9ae0..a3ad88b 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -71,7 +71,7 @@ class NET_API X509Certificate typedef std::vector<OSCertHandle> OSCertHandles; // Predicate functor used in maps when X509Certificate is used as the key. - class LessThan { + class NET_API LessThan { public: bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; }; diff --git a/net/http/http_alternate_protocols.h b/net/http/http_alternate_protocols.h index 3829044..5452d06 100644 --- a/net/http/http_alternate_protocols.h +++ b/net/http/http_alternate_protocols.h @@ -30,7 +30,7 @@ class NET_API HttpAlternateProtocols { UNINITIALIZED, }; - struct PortProtocolPair { + struct NET_API PortProtocolPair { bool Equals(const PortProtocolPair& other) const { return port == other.port && protocol == other.protocol; } diff --git a/net/http/http_request_headers.h b/net/http/http_request_headers.h index 5d60776..e214d6c 100644 --- a/net/http/http_request_headers.h +++ b/net/http/http_request_headers.h @@ -33,7 +33,7 @@ class NET_API HttpRequestHeaders { typedef std::vector<HeaderKeyValuePair> HeaderVector; - class Iterator { + class NET_API Iterator { public: explicit Iterator(const HttpRequestHeaders& headers); ~Iterator(); diff --git a/net/socket/client_socket_pool_manager.h b/net/socket/client_socket_pool_manager.h index d798420..74118d88 100644 --- a/net/socket/client_socket_pool_manager.h +++ b/net/socket/client_socket_pool_manager.h @@ -19,6 +19,7 @@ #include "base/threading/non_thread_safe.h" #include "net/base/cert_database.h" #include "net/base/completion_callback.h" +#include "net/base/net_api.h" #include "net/socket/client_socket_pool_histograms.h" class Value; @@ -99,8 +100,8 @@ class ClientSocketPoolManager : public base::NonThreadSafe, const HostPortPair& proxy_server); static int max_sockets_per_group(); - static void set_max_sockets_per_group(int socket_count); - static void set_max_sockets_per_proxy_server(int socket_count); + NET_API static void set_max_sockets_per_group(int socket_count); + NET_API static void set_max_sockets_per_proxy_server(int socket_count); // A helper method that uses the passed in proxy information to initialize a // ClientSocketHandle with the relevant socket pool. Use this method for @@ -122,7 +123,7 @@ class ClientSocketPoolManager : public base::NonThreadSafe, // ClientSocketHandle with the relevant socket pool. Use this method for // a raw socket connection to a host-port pair (that needs to tunnel through // the proxies). - static int InitSocketHandleForRawConnect( + NET_API static int InitSocketHandleForRawConnect( const HostPortPair& host_port_pair, HttpNetworkSession* session, const ProxyInfo& proxy_info, diff --git a/net/socket/dns_cert_provenance_checker.h b/net/socket/dns_cert_provenance_checker.h index 74e8768..ac3c659 100644 --- a/net/socket/dns_cert_provenance_checker.h +++ b/net/socket/dns_cert_provenance_checker.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. @@ -9,6 +9,7 @@ #include <vector> #include "base/string_piece.h" +#include "net/base/net_api.h" namespace net { @@ -16,9 +17,9 @@ class DnsRRResolver; // DnsCertProvenanceChecker is an interface for asynchronously checking HTTPS // certificates via a DNS side-channel. -class DnsCertProvenanceChecker { +class NET_API DnsCertProvenanceChecker { public: - class Delegate { + class NET_API Delegate { public: virtual ~Delegate(); diff --git a/net/socket/tcp_client_socket.h b/net/socket/tcp_client_socket.h index 13d2dfb..d756645d 100644 --- a/net/socket/tcp_client_socket.h +++ b/net/socket/tcp_client_socket.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 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. @@ -7,6 +7,7 @@ #pragma once #include "build/build_config.h" +#include "net/base/net_api.h" #if defined(OS_WIN) #include "net/socket/tcp_client_socket_win.h" @@ -25,7 +26,7 @@ typedef TCPClientSocketLibevent TCPClientSocket; // Enable/disable experimental TCP FastOpen option. // Not thread safe. Must be called during initialization/startup only. -void set_tcp_fastopen_enabled(bool value); +NET_API void set_tcp_fastopen_enabled(bool value); // Check if the TCP FastOpen option is enabled. bool is_tcp_fastopen_enabled(); diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h index f5176cb3..57406d4 100644 --- a/net/url_request/url_request_context_getter.h +++ b/net/url_request/url_request_context_getter.h @@ -8,6 +8,7 @@ #include "base/memory/ref_counted.h" #include "base/task.h" +#include "net/base/net_api.h" namespace base { class MessageLoopProxy; @@ -20,7 +21,7 @@ class URLRequestContext; struct URLRequestContextGetterTraits; // Interface for retrieving an net::URLRequestContext. -class URLRequestContextGetter +class NET_API URLRequestContextGetter : public base::RefCountedThreadSafe<URLRequestContextGetter, URLRequestContextGetterTraits> { public: @@ -37,6 +38,8 @@ class URLRequestContextGetter GetIOMessageLoopProxy() const = 0; protected: + friend class base::RefCountedThreadSafe<URLRequestContextGetter, + URLRequestContextGetterTraits>; friend class DeleteTask<const URLRequestContextGetter>; friend struct URLRequestContextGetterTraits; diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h index 404a6a1..e26ecd3 100644 --- a/net/url_request/url_request_error_job.h +++ b/net/url_request/url_request_error_job.h @@ -10,11 +10,12 @@ #pragma once #include "base/task.h" +#include "net/base/net_api.h" #include "net/url_request/url_request_job.h" namespace net { -class URLRequestErrorJob : public URLRequestJob { +class NET_API URLRequestErrorJob : public URLRequestJob { public: URLRequestErrorJob(URLRequest* request, int error); diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h index 1baac7a..9fc3e23 100644 --- a/net/url_request/url_request_file_job.h +++ b/net/url_request/url_request_file_job.h @@ -13,6 +13,7 @@ #include "base/task.h" #include "net/base/completion_callback.h" #include "net/base/file_stream.h" +#include "net/base/net_api.h" #include "net/http/http_byte_range.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_job.h" @@ -24,7 +25,7 @@ struct FileInfo; namespace net { // A request job that handles reading file URLs -class URLRequestFileJob : public URLRequestJob { +class NET_API URLRequestFileJob : public URLRequestJob { public: URLRequestFileJob(URLRequest* request, const FilePath& file_path); diff --git a/net/url_request/url_request_filter.h b/net/url_request/url_request_filter.h index 4c7b5bf..2a173f8 100644 --- a/net/url_request/url_request_filter.h +++ b/net/url_request/url_request_filter.h @@ -24,6 +24,7 @@ #include <string> #include "base/hash_tables.h" +#include "net/base/net_api.h" #include "net/url_request/url_request.h" class GURL; @@ -31,7 +32,7 @@ class GURL; namespace net { class URLRequestJob; -class URLRequestFilter { +class NET_API URLRequestFilter { public: // scheme,hostname -> ProtocolFactory typedef std::map<std::pair<std::string, std::string>, diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h index 600c8af..c8698a1 100644 --- a/net/url_request/url_request_redirect_job.h +++ b/net/url_request/url_request_redirect_job.h @@ -7,6 +7,7 @@ #pragma once #include "base/task.h" +#include "net/base/net_api.h" #include "net/url_request/url_request_job.h" class GURL; @@ -16,7 +17,7 @@ namespace net { // A URLRequestJob that will redirect the request to the specified // URL. This is useful to restart a request at a different URL based // on the result of another job. -class URLRequestRedirectJob : public URLRequestJob { +class NET_API URLRequestRedirectJob : public URLRequestJob { public: // Constructs a job that redirects to the specified URL. URLRequestRedirectJob(URLRequest* request, const GURL& redirect_destination); diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h index 8ba9104..be574d6 100644 --- a/net/url_request/url_request_simple_job.h +++ b/net/url_request/url_request_simple_job.h @@ -9,13 +9,14 @@ #include <string> #include "base/task.h" +#include "net/base/net_api.h" #include "net/url_request/url_request_job.h" namespace net { class URLRequest; -class URLRequestSimpleJob : public URLRequestJob { +class NET_API URLRequestSimpleJob : public URLRequestJob { public: explicit URLRequestSimpleJob(URLRequest* request); |