diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 00:22:50 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 00:22:50 +0000 |
commit | 0651b818c7122d319954ff5bc30dff68ba8b9013 (patch) | |
tree | d18a681545594c17175a584b7d56a6ee9abd10b6 /net/url_request/url_request_test_util.h | |
parent | 26616172ccaeae9842d7e52b556bc49e16751455 (diff) | |
download | chromium_src-0651b818c7122d319954ff5bc30dff68ba8b9013.zip chromium_src-0651b818c7122d319954ff5bc30dff68ba8b9013.tar.gz chromium_src-0651b818c7122d319954ff5bc30dff68ba8b9013.tar.bz2 |
Refactor of NetworkDelegate.
* Renames HttpNetworkDelegate to NetworkDelegate, moves to net/base/network_delegate.h. NOTE: this is a layering violation. wtc/eroman/willchan have agreed to this exception because the other solutions are less palatable.
* Move the virtuals in NetworkDelegate to the private section. Use non-virtual public interface as the network stack's interface for notifying the delegate. Add sanity checking to the implmentation in NetworkDelegate. The private virtual interface is for consumers to receive notifications.
* Remove ExtensionIOEventRouter from ChromeURLRequestContext, it is only used by the ChromeNetworkDelegate. Pass it directly to the ChromeNetworkDelegate's constructor.
* Introduce a SystemNetworkDelegate. It does nothing right now.
BUG=67232
TEST=none
Review URL: http://codereview.chromium.org/6580002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_test_util.h')
-rw-r--r-- | net/url_request/url_request_test_util.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h index c02344c..47ecff4 100644 --- a/net/url_request/url_request_test_util.h +++ b/net/url_request/url_request_test_util.h @@ -23,12 +23,12 @@ #include "net/base/host_resolver.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" +#include "net/base/network_delegate.h" #include "net/base/ssl_config_service_defaults.h" #include "net/disk_cache/disk_cache.h" #include "net/ftp/ftp_network_layer.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_cache.h" -#include "net/http/http_network_delegate.h" #include "net/http/http_network_layer.h" #include "net/test/test_server.h" #include "net/url_request/url_request.h" @@ -191,21 +191,21 @@ class TestDelegate : public net::URLRequest::Delegate { //----------------------------------------------------------------------------- -class TestHttpNetworkDelegate : public net::HttpNetworkDelegate { +class TestNetworkDelegate : public net::NetworkDelegate { public: - TestHttpNetworkDelegate(); - virtual ~TestHttpNetworkDelegate(); + TestNetworkDelegate(); + virtual ~TestNetworkDelegate(); - // net::HttpNetworkDelegate: + int last_os_error() const { return last_os_error_; } + int error_count() const { return error_count_; } + + private: + // net::NetworkDelegate: virtual void OnBeforeURLRequest(net::URLRequest* request); virtual void OnSendHttpRequest(net::HttpRequestHeaders* headers); virtual void OnResponseStarted(net::URLRequest* request); virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); - int last_os_error() const { return last_os_error_; } - int error_count() const { return error_count_; } - - private: int last_os_error_; int error_count_; }; |