diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:41:40 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:41:40 +0000 |
commit | 1e6054763faf7283d3e2e53f26389ff5d83e7d90 (patch) | |
tree | 4132c689a3196890267eae8a57989cbfab36e438 /net | |
parent | 0c5f45a87e93ac32d037ea015f67bceafbd2e340 (diff) | |
download | chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.zip chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.tar.gz chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.tar.bz2 |
Almost done deinlining virtual methods.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/5841002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 4 | ||||
-rw-r--r-- | net/net.gyp | 1 | ||||
-rw-r--r-- | net/proxy/init_proxy_resolver_unittest.cc | 6 | ||||
-rw-r--r-- | net/proxy/multi_threaded_proxy_resolver_unittest.cc | 8 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_fixed.cc | 20 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_fixed.h | 8 | ||||
-rw-r--r-- | net/proxy/proxy_resolver.h | 5 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_mac.cc | 21 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_mac.h | 14 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_v8.cc | 4 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_v8.h | 1 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_winhttp.cc | 4 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_winhttp.h | 3 | ||||
-rw-r--r-- | net/proxy/proxy_script_fetcher.h | 2 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 8 | ||||
-rw-r--r-- | net/proxy/proxy_service_unittest.cc | 2 | ||||
-rw-r--r-- | net/proxy/sync_host_resolver_bridge_unittest.cc | 4 |
17 files changed, 97 insertions, 18 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 79047e1..17c3b78d 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -6478,6 +6478,10 @@ class CapturingProxyResolver : public ProxyResolver { NOTREACHED(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&, CompletionCallback* /*callback*/) { return OK; diff --git a/net/net.gyp b/net/net.gyp index 7be250c..1e1175a 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -541,6 +541,7 @@ 'proxy/proxy_config.cc', 'proxy/proxy_config.h', 'proxy/proxy_config_service.h', + 'proxy/proxy_config_service_fixed.cc', 'proxy/proxy_config_service_fixed.h', 'proxy/proxy_config_service_linux.cc', 'proxy/proxy_config_service_linux.h', diff --git a/net/proxy/init_proxy_resolver_unittest.cc b/net/proxy/init_proxy_resolver_unittest.cc index f9858614..c1a69d1 100644 --- a/net/proxy/init_proxy_resolver_unittest.cc +++ b/net/proxy/init_proxy_resolver_unittest.cc @@ -107,6 +107,8 @@ class RuleBasedProxyScriptFetcher : public ProxyScriptFetcher { virtual void Cancel() {} + virtual URLRequestContext* GetRequestContext() { return NULL; } + private: const Rules* rules_; }; @@ -130,6 +132,10 @@ class RuleBasedProxyResolver : public ProxyResolver { NOTREACHED(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* callback) { diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc index 6f168a7..a18804f 100644 --- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc +++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc @@ -60,6 +60,10 @@ class MockProxyResolver : public ProxyResolver { NOTREACHED(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* callback) { @@ -169,6 +173,10 @@ class ForwardingProxyResolver : public ProxyResolver { impl_->CancelRequest(request); } + virtual void CancelSetPacScript() { + impl_->CancelSetPacScript(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* callback) { diff --git a/net/proxy/proxy_config_service_fixed.cc b/net/proxy/proxy_config_service_fixed.cc new file mode 100644 index 0000000..b23c265 --- /dev/null +++ b/net/proxy/proxy_config_service_fixed.cc @@ -0,0 +1,20 @@ +// Copyright (c) 2010 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. + +#include "net/proxy/proxy_config_service_fixed.h" + +namespace net { + +ProxyConfigServiceFixed::ProxyConfigServiceFixed(const ProxyConfig& pc) + : pc_(pc) { +} + +ProxyConfigServiceFixed::~ProxyConfigServiceFixed() {} + +bool ProxyConfigServiceFixed::GetLatestProxyConfig(ProxyConfig* config) { + *config = pc_; + return true; +} + +} // namespace net diff --git a/net/proxy/proxy_config_service_fixed.h b/net/proxy/proxy_config_service_fixed.h index e9eac8e..b0d8f03 100644 --- a/net/proxy/proxy_config_service_fixed.h +++ b/net/proxy/proxy_config_service_fixed.h @@ -15,15 +15,13 @@ namespace net { // Implementation of ProxyConfigService that returns a fixed result. class ProxyConfigServiceFixed : public ProxyConfigService { public: - explicit ProxyConfigServiceFixed(const ProxyConfig& pc) : pc_(pc) {} + explicit ProxyConfigServiceFixed(const ProxyConfig& pc); + virtual ~ProxyConfigServiceFixed(); // ProxyConfigService methods: virtual void AddObserver(Observer* observer) {} virtual void RemoveObserver(Observer* observer) {} - virtual bool GetLatestProxyConfig(ProxyConfig* config) { - *config = pc_; - return true; - } + virtual bool GetLatestProxyConfig(ProxyConfig* config); private: ProxyConfig pc_; diff --git a/net/proxy/proxy_resolver.h b/net/proxy/proxy_resolver.h index 9220f5e..fcc2395 100644 --- a/net/proxy/proxy_resolver.h +++ b/net/proxy/proxy_resolver.h @@ -54,10 +54,7 @@ class ProxyResolver { // contain the actual script bytes rather than just the URL. bool expects_pac_bytes() const { return expects_pac_bytes_; } - // TODO(eroman): Make this =0. - virtual void CancelSetPacScript() { - NOTREACHED(); - } + virtual void CancelSetPacScript() = 0; // Frees any unneeded memory held by the resolver, e.g. garbage in the JS // engine. Most subclasses don't need to do anything, so we provide a default diff --git a/net/proxy/proxy_resolver_mac.cc b/net/proxy/proxy_resolver_mac.cc index 442715d..128450f 100644 --- a/net/proxy/proxy_resolver_mac.cc +++ b/net/proxy/proxy_resolver_mac.cc @@ -53,6 +53,12 @@ void ResultCallback(void* client, CFArrayRef proxies, CFErrorRef error) { namespace net { +ProxyResolverMac::ProxyResolverMac() + : ProxyResolver(false /*expects_pac_bytes*/) { +} + +ProxyResolverMac::~ProxyResolverMac() {} + // Gets the proxy information for a query URL from a PAC. Implementation // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, @@ -171,4 +177,19 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, return OK; } +void ProxyResolverMac::CancelRequest(RequestHandle request) { + NOTREACHED(); +} + +void ProxyResolverMac::CancelSetPacScript() { + NOTREACHED(); +} + +int ProxyResolverMac::SetPacScript( + const scoped_refptr<ProxyResolverScriptData>& script_data, + CompletionCallback* /*callback*/) { + script_data_ = script_data; + return OK; +} + } // namespace net diff --git a/net/proxy/proxy_resolver_mac.h b/net/proxy/proxy_resolver_mac.h index 950b11f..fe6e791 100644 --- a/net/proxy/proxy_resolver_mac.h +++ b/net/proxy/proxy_resolver_mac.h @@ -16,7 +16,8 @@ namespace net { // proxies. class ProxyResolverMac : public ProxyResolver { public: - ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} + ProxyResolverMac(); + virtual ~ProxyResolverMac(); // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, @@ -25,16 +26,13 @@ class ProxyResolverMac : public ProxyResolver { RequestHandle* request, const BoundNetLog& net_log); - virtual void CancelRequest(RequestHandle request) { - NOTREACHED(); - } + virtual void CancelRequest(RequestHandle request); + + virtual void CancelSetPacScript(); virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, - CompletionCallback* /*callback*/) { - script_data_ = script_data; - return OK; - } + CompletionCallback* /*callback*/); private: scoped_refptr<ProxyResolverScriptData> script_data_; diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc index 2bf3b6d..80a1937 100644 --- a/net/proxy/proxy_resolver_v8.cc +++ b/net/proxy/proxy_resolver_v8.cc @@ -721,6 +721,10 @@ void ProxyResolverV8::CancelRequest(RequestHandle request) { NOTREACHED(); } +void ProxyResolverV8::CancelSetPacScript() { + NOTREACHED(); +} + void ProxyResolverV8::PurgeMemory() { context_->PurgeMemory(); } diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h index 7345f45..28bdcd0 100644 --- a/net/proxy/proxy_resolver_v8.h +++ b/net/proxy/proxy_resolver_v8.h @@ -47,6 +47,7 @@ class ProxyResolverV8 : public ProxyResolver { RequestHandle* /*request*/, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request); + virtual void CancelSetPacScript(); virtual void PurgeMemory(); virtual void Shutdown(); virtual int SetPacScript( diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index 6fd057d..13f5fb5 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc @@ -124,6 +124,10 @@ void ProxyResolverWinHttp::CancelRequest(RequestHandle request) { NOTREACHED(); } +void ProxyResolverWinHttp::CancelSetPacScript() { + NOTREACHED(); +} + int ProxyResolverWinHttp::SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { diff --git a/net/proxy/proxy_resolver_winhttp.h b/net/proxy/proxy_resolver_winhttp.h index 68d1109..9784672 100644 --- a/net/proxy/proxy_resolver_winhttp.h +++ b/net/proxy/proxy_resolver_winhttp.h @@ -27,6 +27,9 @@ class ProxyResolverWinHttp : public ProxyResolver { RequestHandle* /*request*/, const BoundNetLog& /*net_log*/); virtual void CancelRequest(RequestHandle request); + + virtual void CancelSetPacScript(); + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/); diff --git a/net/proxy/proxy_script_fetcher.h b/net/proxy/proxy_script_fetcher.h index 0a28065..bf33bcb 100644 --- a/net/proxy/proxy_script_fetcher.h +++ b/net/proxy/proxy_script_fetcher.h @@ -48,7 +48,7 @@ class ProxyScriptFetcher { // Returns the request context that this fetcher uses to issue downloads, // or NULL. - virtual URLRequestContext* GetRequestContext() { return NULL; } + virtual URLRequestContext* GetRequestContext() = 0; }; } // namespace net diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 669ae083..f321ef03 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -113,6 +113,10 @@ class ProxyResolverNull : public ProxyResolver { NOTREACHED(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& /*script_data*/, CompletionCallback* /*callback*/) { @@ -141,6 +145,10 @@ class ProxyResolverFromPacString : public ProxyResolver { NOTREACHED(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& pac_script, CompletionCallback* callback) { diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index 3c8ef2a..7dec769 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -98,6 +98,8 @@ class MockProxyScriptFetcher : public ProxyScriptFetcher { virtual void Cancel() {} + virtual URLRequestContext* GetRequestContext() { return NULL; } + const GURL& pending_request_url() const { return pending_request_url_; } diff --git a/net/proxy/sync_host_resolver_bridge_unittest.cc b/net/proxy/sync_host_resolver_bridge_unittest.cc index cd4264e..43c829f 100644 --- a/net/proxy/sync_host_resolver_bridge_unittest.cc +++ b/net/proxy/sync_host_resolver_bridge_unittest.cc @@ -109,6 +109,10 @@ class SyncProxyResolver : public ProxyResolver { host_resolver_->Shutdown(); } + virtual void CancelSetPacScript() { + NOTREACHED(); + } + virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* callback) { |