| Index: net/proxy/proxy_service.cc
|
| diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
|
| index d6d410c205ef380d4f2209a2848fa08c6db8eae6..615403d719c34e672ee80bfb657745f3c765339a 100644
|
| --- a/net/proxy/proxy_service.cc
|
| +++ b/net/proxy/proxy_service.cc
|
| @@ -185,18 +185,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
|
| @@ -209,19 +201,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_;
|
| };
|
| @@ -778,7 +763,6 @@ class ProxyService::PacRequest
|
| url_(url),
|
| load_flags_(load_flags),
|
| proxy_delegate_(proxy_delegate),
|
| - resolve_job_(NULL),
|
| config_id_(ProxyConfig::kInvalidConfigID),
|
| config_source_(PROXY_CONFIG_SOURCE_UNKNOWN),
|
| net_log_(net_log),
|
| @@ -804,7 +788,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() {
|
| @@ -819,8 +803,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());
|
| }
|
|
|
| @@ -848,12 +831,12 @@ class ProxyService::PacRequest
|
| int QueryDidComplete(int result_code) {
|
| DCHECK(!was_cancelled());
|
|
|
| - // This state is cleared when resolve_job_ is set to nullptr below.
|
| + // This state is cleared when resolve_job_ is reset below.
|
| bool script_executed = is_started();
|
|
|
| // 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(
|
| @@ -879,7 +862,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;
|
| }
|
|
|
| @@ -912,7 +895,7 @@ class ProxyService::PacRequest
|
| GURL url_;
|
| int load_flags_;
|
| ProxyDelegate* proxy_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_;
|
|
|