| Index: net/proxy/proxy_service.cc
|
| diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
|
| index 7738de799faf701177b6134986b0ca2370b5c5e6..4f0c4be41c060f02b42dd8191afb43c57bdee902 100644
|
| --- a/net/proxy/proxy_service.cc
|
| +++ b/net/proxy/proxy_service.cc
|
| @@ -181,18 +181,10 @@ class ProxyResolverNull : public ProxyResolver {
|
| int GetProxyForURL(const GURL& url,
|
| ProxyInfo* results,
|
| const CompletionCallback& callback,
|
| - RequestHandle* request,
|
| + scoped_ptr<Request>* request,
|
| const BoundNetLog& net_log) override {
|
| return ERR_NOT_IMPLEMENTED;
|
| }
|
| -
|
| - void CancelRequest(RequestHandle request) override { NOTREACHED(); }
|
| -
|
| - LoadState GetLoadState(RequestHandle request) const override {
|
| - NOTREACHED();
|
| - return LOAD_STATE_IDLE;
|
| - }
|
| -
|
| };
|
|
|
| // ProxyResolver that simulates a PAC script which returns
|
| @@ -205,19 +197,12 @@ class ProxyResolverFromPacString : public ProxyResolver {
|
| int GetProxyForURL(const GURL& url,
|
| ProxyInfo* results,
|
| const CompletionCallback& callback,
|
| - RequestHandle* request,
|
| + scoped_ptr<Request>* request,
|
| const BoundNetLog& net_log) override {
|
| results->UsePacString(pac_string_);
|
| return OK;
|
| }
|
|
|
| - void CancelRequest(RequestHandle request) override { NOTREACHED(); }
|
| -
|
| - LoadState GetLoadState(RequestHandle request) const override {
|
| - NOTREACHED();
|
| - return LOAD_STATE_IDLE;
|
| - }
|
| -
|
| private:
|
| const std::string pac_string_;
|
| };
|
| @@ -774,7 +759,6 @@ class ProxyService::PacRequest
|
| url_(url),
|
| load_flags_(load_flags),
|
| network_delegate_(network_delegate),
|
| - resolve_job_(NULL),
|
| config_id_(ProxyConfig::kInvalidConfigID),
|
| config_source_(PROXY_CONFIG_SOURCE_UNKNOWN),
|
| net_log_(net_log),
|
| @@ -800,7 +784,7 @@ class ProxyService::PacRequest
|
|
|
| bool is_started() const {
|
| // Note that !! casts to bool. (VS gives a warning otherwise).
|
| - return !!resolve_job_;
|
| + return !!resolve_job_.get();
|
| }
|
|
|
| void StartAndCompleteCheckingForSynchronous() {
|
| @@ -815,8 +799,7 @@ class ProxyService::PacRequest
|
| void CancelResolveJob() {
|
| DCHECK(is_started());
|
| // The request may already be running in the resolver.
|
| - resolver()->CancelRequest(resolve_job_);
|
| - resolve_job_ = NULL;
|
| + resolve_job_.reset();
|
| DCHECK(!is_started());
|
| }
|
|
|
| @@ -849,7 +832,7 @@ class ProxyService::PacRequest
|
|
|
| // Clear |resolve_job_| so is_started() returns false while
|
| // DidFinishResolvingProxy() runs.
|
| - resolve_job_ = nullptr;
|
| + resolve_job_.reset();
|
|
|
| // Note that DidFinishResolvingProxy might modify |results_|.
|
| int rv = service_->DidFinishResolvingProxy(
|
| @@ -875,7 +858,7 @@ class ProxyService::PacRequest
|
|
|
| LoadState GetLoadState() const {
|
| if (is_started())
|
| - return resolver()->GetLoadState(resolve_job_);
|
| + return resolve_job_->GetLoadState();
|
| return LOAD_STATE_RESOLVING_PROXY_FOR_URL;
|
| }
|
|
|
| @@ -908,7 +891,7 @@ class ProxyService::PacRequest
|
| GURL url_;
|
| int load_flags_;
|
| NetworkDelegate* network_delegate_;
|
| - ProxyResolver::RequestHandle resolve_job_;
|
| + scoped_ptr<ProxyResolver::Request> resolve_job_;
|
| ProxyConfig::ID config_id_; // The config id when the resolve was started.
|
| ProxyConfigSource config_source_; // The source of proxy settings.
|
| BoundNetLog net_log_;
|
|
|