Commit eb2b46a6 authored by rvargas@google.com's avatar rvargas@google.com

net: Add NET_API to url_request.

BUG=76997
TEST=none
Review URL: http://codereview.chromium.org/7033036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86125 0039d316-1c4b-4281-b951-d872f2087c98
parent 72a9b30f
// 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/net_api.h"
namespace net { namespace net {
class HttpAlternateProtocols { class NET_API HttpAlternateProtocols {
public: public:
enum Protocol { enum Protocol {
NPN_SPDY_1, NPN_SPDY_1,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/host_resolver.h" #include "net/base/host_resolver.h"
#include "net/base/net_api.h"
#include "net/base/ssl_client_auth_cache.h" #include "net/base/ssl_client_auth_cache.h"
#include "net/http/http_alternate_protocols.h" #include "net/http/http_alternate_protocols.h"
#include "net/http/http_auth_cache.h" #include "net/http/http_auth_cache.h"
...@@ -39,10 +40,11 @@ class SSLConfigService; ...@@ -39,10 +40,11 @@ class SSLConfigService;
class SSLHostInfoFactory; class SSLHostInfoFactory;
// This class holds session objects used by HttpNetworkTransaction objects. // This class holds session objects used by HttpNetworkTransaction objects.
class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>, class NET_API HttpNetworkSession
public base::NonThreadSafe { : public base::RefCounted<HttpNetworkSession>,
NON_EXPORTED_BASE(public base::NonThreadSafe) {
public: public:
struct Params { struct NET_API Params {
Params() Params()
: client_socket_factory(NULL), : client_socket_factory(NULL),
host_resolver(NULL), host_resolver(NULL),
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#pragma once #pragma once
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "net/base/net_api.h"
namespace net { namespace net {
...@@ -16,7 +17,7 @@ class HttpTransaction; ...@@ -16,7 +17,7 @@ class HttpTransaction;
// An interface to a class that can create HttpTransaction objects. // An interface to a class that can create HttpTransaction objects.
class HttpTransactionFactory { class NET_API HttpTransactionFactory {
public: public:
virtual ~HttpTransactionFactory() {} virtual ~HttpTransactionFactory() {}
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/load_states.h" #include "net/base/load_states.h"
#include "net/base/net_api.h"
#include "net/base/net_log.h" #include "net/base/net_log.h"
#include "net/base/request_priority.h" #include "net/base/request_priority.h"
#include "net/http/http_request_headers.h" #include "net/http/http_request_headers.h"
...@@ -58,7 +59,7 @@ typedef std::vector<std::string> ResponseCookies; ...@@ -58,7 +59,7 @@ typedef std::vector<std::string> ResponseCookies;
// //
// NOTE: All usage of all instances of this class should be on the same thread. // NOTE: All usage of all instances of this class should be on the same thread.
// //
class URLRequest : public base::NonThreadSafe { class NET_API URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe) {
public: public:
// Callback function implemented by protocol handlers to create new jobs. // Callback function implemented by protocol handlers to create new jobs.
// The factory may return NULL to indicate an error, which will cause other // The factory may return NULL to indicate an error, which will cause other
...@@ -85,7 +86,7 @@ class URLRequest : public base::NonThreadSafe { ...@@ -85,7 +86,7 @@ class URLRequest : public base::NonThreadSafe {
// This class handles network interception. Use with // This class handles network interception. Use with
// (Un)RegisterRequestInterceptor. // (Un)RegisterRequestInterceptor.
class Interceptor { class NET_API Interceptor {
public: public:
virtual ~Interceptor() {} virtual ~Interceptor() {}
...@@ -137,7 +138,7 @@ class URLRequest : public base::NonThreadSafe { ...@@ -137,7 +138,7 @@ class URLRequest : public base::NonThreadSafe {
// if an error occurred, or if the IO is just pending. When Read() returns // if an error occurred, or if the IO is just pending. When Read() returns
// true with zero bytes read, it indicates the end of the response. // true with zero bytes read, it indicates the end of the response.
// //
class Delegate { class NET_API Delegate {
public: public:
virtual ~Delegate() {} virtual ~Delegate() {}
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "net/base/net_api.h"
#include "net/base/net_log.h" #include "net/base/net_log.h"
#include "net/base/ssl_config_service.h" #include "net/base/ssl_config_service.h"
#include "net/base/transport_security_state.h" #include "net/base/transport_security_state.h"
...@@ -38,9 +39,9 @@ class URLRequestJobFactory; ...@@ -38,9 +39,9 @@ class URLRequestJobFactory;
// instances. Note that URLRequestContext typically does not provide storage for // instances. Note that URLRequestContext typically does not provide storage for
// these member variables, since they may be shared. For the ones that aren't // these member variables, since they may be shared. For the ones that aren't
// shared, URLRequestContextStorage can be helpful in defining their storage. // shared, URLRequestContextStorage can be helpful in defining their storage.
class URLRequestContext class NET_API URLRequestContext
: public base::RefCountedThreadSafe<URLRequestContext>, : public base::RefCountedThreadSafe<URLRequestContext>,
public base::NonThreadSafe { NON_EXPORTED_BASE(public base::NonThreadSafe) {
public: public:
URLRequestContext(); URLRequestContext();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "net/base/net_api.h"
namespace net { namespace net {
...@@ -30,7 +31,7 @@ class URLRequestJobFactory; ...@@ -30,7 +31,7 @@ class URLRequestJobFactory;
// URLRequestContextStorage is a helper class that provides storage for unowned // URLRequestContextStorage is a helper class that provides storage for unowned
// member variables of URLRequestContext. // member variables of URLRequestContext.
class URLRequestContextStorage { class NET_API URLRequestContextStorage {
public: public:
// Note that URLRequestContextStorage does not acquire a reference to // Note that URLRequestContextStorage does not acquire a reference to
// URLRequestContext, since it is often designed to be embedded in a // URLRequestContext, since it is often designed to be embedded in a
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "net/base/filter.h" #include "net/base/filter.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/load_states.h" #include "net/base/load_states.h"
#include "net/base/net_api.h"
namespace net { namespace net {
...@@ -30,7 +31,7 @@ class UploadData; ...@@ -30,7 +31,7 @@ class UploadData;
class URLRequestStatus; class URLRequestStatus;
class X509Certificate; class X509Certificate;
class URLRequestJob : public base::RefCounted<URLRequestJob> { class NET_API URLRequestJob : public base::RefCounted<URLRequestJob> {
public: public:
explicit URLRequestJob(URLRequest* request); explicit URLRequestJob(URLRequest* request);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "net/base/net_api.h"
class GURL; class GURL;
...@@ -19,16 +20,17 @@ namespace net { ...@@ -19,16 +20,17 @@ namespace net {
class URLRequest; class URLRequest;
class URLRequestJob; class URLRequestJob;
class URLRequestJobFactory : public base::NonThreadSafe { class NET_TEST URLRequestJobFactory
: NON_EXPORTED_BASE(public base::NonThreadSafe) {
public: public:
class ProtocolHandler { class NET_TEST ProtocolHandler {
public: public:
virtual ~ProtocolHandler(); virtual ~ProtocolHandler();
virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0;
}; };
class Interceptor { class NET_TEST Interceptor {
public: public:
virtual ~Interceptor(); virtual ~Interceptor();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include "base/observer_list.h" #include "base/observer_list.h"
#include "net/base/net_api.h"
#include "net/url_request/url_request_status.h" #include "net/url_request/url_request_status.h"
class GURL; class GURL;
...@@ -24,7 +25,7 @@ class URLRequestJob; ...@@ -24,7 +25,7 @@ class URLRequestJob;
// onthe same thread where all of the application's URLRequest calls are // onthe same thread where all of the application's URLRequest calls are
// made. // made.
// //
class URLRequestJobTracker { class NET_API URLRequestJobTracker {
public: public:
typedef std::vector<URLRequestJob*> JobList; typedef std::vector<URLRequestJob*> JobList;
typedef JobList::const_iterator JobIterator; typedef JobList::const_iterator JobIterator;
...@@ -97,7 +98,7 @@ class URLRequestJobTracker { ...@@ -97,7 +98,7 @@ class URLRequestJobTracker {
JobList active_jobs_; JobList active_jobs_;
}; };
extern URLRequestJobTracker g_url_request_job_tracker; NET_API extern URLRequestJobTracker g_url_request_job_tracker;
} // namespace net } // namespace net
......
...@@ -36,7 +36,7 @@ namespace net { ...@@ -36,7 +36,7 @@ namespace net {
// //
// Optionally, you can also construct test jobs that advance automatically // Optionally, you can also construct test jobs that advance automatically
// without having to call ProcessOnePendingMessage. // without having to call ProcessOnePendingMessage.
class URLRequestTestJob : public URLRequestJob { class NET_TEST URLRequestTestJob : public URLRequestJob {
public: public:
// Constructs a job to return one of the canned responses depending on the // Constructs a job to return one of the canned responses depending on the
// request url, with auto advance disabled. // request url, with auto advance disabled.
......
...@@ -28,7 +28,8 @@ class URLRequestThrottlerManager; ...@@ -28,7 +28,8 @@ class URLRequestThrottlerManager;
// destination and provide guidance (to the application level only) on whether // destination and provide guidance (to the application level only) on whether
// too many requests have been sent and when a good time to send the next one // too many requests have been sent and when a good time to send the next one
// would be. This is never used to deny requests at the network level. // would be. This is never used to deny requests at the network level.
class URLRequestThrottlerEntry : public URLRequestThrottlerEntryInterface { class NET_API URLRequestThrottlerEntry
: public URLRequestThrottlerEntryInterface {
public: public:
// Sliding window period. // Sliding window period.
static const int kDefaultSlidingWindowPeriodMs; static const int kDefaultSlidingWindowPeriodMs;
......
...@@ -9,13 +9,14 @@ ...@@ -9,13 +9,14 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/time.h" #include "base/time.h"
#include "net/base/net_api.h"
namespace net { namespace net {
class URLRequestThrottlerHeaderInterface; class URLRequestThrottlerHeaderInterface;
// Interface provided on entries of the URL request throttler manager. // Interface provided on entries of the URL request throttler manager.
class URLRequestThrottlerEntryInterface class NET_API URLRequestThrottlerEntryInterface
: public base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface> { : public base::RefCountedThreadSafe<URLRequestThrottlerEntryInterface> {
public: public:
URLRequestThrottlerEntryInterface() {} URLRequestThrottlerEntryInterface() {}
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "net/base/net_api.h"
#include "net/url_request/url_request_throttler_entry.h" #include "net/url_request/url_request_throttler_entry.h"
namespace net { namespace net {
...@@ -32,7 +33,8 @@ namespace net { ...@@ -32,7 +33,8 @@ namespace net {
// NOTE: All usage of this singleton object must be on the same thread, // NOTE: All usage of this singleton object must be on the same thread,
// although to allow it to be used as a singleton, construction and destruction // although to allow it to be used as a singleton, construction and destruction
// can occur on a separate thread. // can occur on a separate thread.
class URLRequestThrottlerManager : public base::NonThreadSafe { class NET_API URLRequestThrottlerManager
: NON_EXPORTED_BASE(public base::NonThreadSafe) {
public: public:
static URLRequestThrottlerManager* GetInstance(); static URLRequestThrottlerManager* GetInstance();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/base/net_api.h"
namespace disk_cache { namespace disk_cache {
class Backend; class Backend;
...@@ -20,7 +21,7 @@ namespace net { ...@@ -20,7 +21,7 @@ namespace net {
class URLRequestContext; class URLRequestContext;
class ViewCacheHelper { class NET_API ViewCacheHelper {
public: public:
ViewCacheHelper(); ViewCacheHelper();
~ViewCacheHelper(); ~ViewCacheHelper();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment