diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 23:46:49 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 23:46:49 +0000 |
commit | 7aefb155470efae35c224f1ebb21f5ff893179f5 (patch) | |
tree | 6333871e5b8fdcfcafadefc95457e480c23fb8ad /net/proxy | |
parent | 9c678e93d80ab8ed8f52043e1096e2d08f97980e (diff) | |
download | chromium_src-7aefb155470efae35c224f1ebb21f5ff893179f5.zip chromium_src-7aefb155470efae35c224f1ebb21f5ff893179f5.tar.gz chromium_src-7aefb155470efae35c224f1ebb21f5ff893179f5.tar.bz2 |
More net/ header/implementation method reordering.
(Contains some minor de-inlining.)
BUG=68682
TEST=compiles
Review URL: http://codereview.chromium.org/6263010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r-- | net/proxy/proxy_resolver_v8.h | 4 | ||||
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl.cc | 48 | ||||
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl.h | 15 |
3 files changed, 34 insertions, 33 deletions
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h index 28bdcd0..6cd340f 100644 --- a/net/proxy/proxy_resolver_v8.h +++ b/net/proxy/proxy_resolver_v8.h @@ -40,6 +40,8 @@ class ProxyResolverV8 : public ProxyResolver { virtual ~ProxyResolverV8(); + ProxyResolverJSBindings* js_bindings() const { return js_bindings_.get(); } + // ProxyResolver implementation: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, @@ -54,8 +56,6 @@ class ProxyResolverV8 : public ProxyResolver { const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/); - ProxyResolverJSBindings* js_bindings() const { return js_bindings_.get(); } - private: // Context holds the Javascript state for the most recently loaded PAC // script. It corresponds with the data from the last call to diff --git a/net/proxy/proxy_script_fetcher_impl.cc b/net/proxy/proxy_script_fetcher_impl.cc index 7d22ed3..bc245a2 100644 --- a/net/proxy/proxy_script_fetcher_impl.cc +++ b/net/proxy/proxy_script_fetcher_impl.cc @@ -90,6 +90,30 @@ ProxyScriptFetcherImpl::~ProxyScriptFetcherImpl() { // ensure that the delegate (this) is not called again. } +base::TimeDelta ProxyScriptFetcherImpl::SetTimeoutConstraint( + base::TimeDelta timeout) { + base::TimeDelta prev = max_duration_; + max_duration_ = timeout; + return prev; +} + +size_t ProxyScriptFetcherImpl::SetSizeConstraint(size_t size_bytes) { + size_t prev = max_response_bytes_; + max_response_bytes_ = size_bytes; + return prev; +} + +void ProxyScriptFetcherImpl::OnResponseCompleted(URLRequest* request) { + DCHECK_EQ(request, cur_request_.get()); + + // Use |result_code_| as the request's error if we have already set it to + // something specific. + if (result_code_ == OK && !request->status().is_success()) + result_code_ = request->status().os_error(); + + FetchCompleted(); +} + int ProxyScriptFetcherImpl::Fetch(const GURL& url, string16* text, CompletionCallback* callback) { @@ -200,17 +224,6 @@ void ProxyScriptFetcherImpl::OnReadCompleted(URLRequest* request, } } -void ProxyScriptFetcherImpl::OnResponseCompleted(URLRequest* request) { - DCHECK_EQ(request, cur_request_.get()); - - // Use |result_code_| as the request's error if we have already set it to - // something specific. - if (result_code_ == OK && !request->status().is_success()) - result_code_ = request->status().os_error(); - - FetchCompleted(); -} - void ProxyScriptFetcherImpl::ReadBody(URLRequest* request) { // Read as many bytes as are available synchronously. while (true) { @@ -287,17 +300,4 @@ void ProxyScriptFetcherImpl::OnTimeout(int id) { cur_request_->Cancel(); } -base::TimeDelta ProxyScriptFetcherImpl::SetTimeoutConstraint( - base::TimeDelta timeout) { - base::TimeDelta prev = max_duration_; - max_duration_ = timeout; - return prev; -} - -size_t ProxyScriptFetcherImpl::SetSizeConstraint(size_t size_bytes) { - size_t prev = max_response_bytes_; - max_response_bytes_ = size_bytes; - return prev; -} - } // namespace net diff --git a/net/proxy/proxy_script_fetcher_impl.h b/net/proxy/proxy_script_fetcher_impl.h index 65c16f7..e3abb55 100644 --- a/net/proxy/proxy_script_fetcher_impl.h +++ b/net/proxy/proxy_script_fetcher_impl.h @@ -37,8 +37,13 @@ class ProxyScriptFetcherImpl : public ProxyScriptFetcher, virtual ~ProxyScriptFetcherImpl(); - // ProxyScriptFetcher methods: + // Used by unit-tests to modify the default limits. + base::TimeDelta SetTimeoutConstraint(base::TimeDelta timeout); + size_t SetSizeConstraint(size_t size_bytes); + virtual void OnResponseCompleted(URLRequest* request); + + // ProxyScriptFetcher methods: virtual int Fetch(const GURL& url, string16* text, CompletionCallback* callback); virtual void Cancel(); @@ -51,13 +56,10 @@ class ProxyScriptFetcherImpl : public ProxyScriptFetcher, X509Certificate* cert); virtual void OnResponseStarted(URLRequest* request); virtual void OnReadCompleted(URLRequest* request, int num_bytes); - virtual void OnResponseCompleted(URLRequest* request); - - // Used by unit-tests to modify the default limits. - base::TimeDelta SetTimeoutConstraint(base::TimeDelta timeout); - size_t SetSizeConstraint(size_t size_bytes); private: + enum { kBufSize = 4096 }; + // Read more bytes from the response. void ReadBody(URLRequest* request); @@ -83,7 +85,6 @@ class ProxyScriptFetcherImpl : public ProxyScriptFetcher, URLRequestContext* url_request_context_; // Buffer that URLRequest writes into. - enum { kBufSize = 4096 }; scoped_refptr<IOBuffer> buf_; // The next ID to use for |cur_request_| (monotonically increasing). |