diff options
Diffstat (limited to 'net/proxy/proxy_script_fetcher_impl.cc')
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl.cc | 48 |
1 files changed, 24 insertions, 24 deletions
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 |