Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: net/proxy/proxy_service.cc

Issue 1745133002: Revert of Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_resolver_winhttp.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 615403d719c34e672ee80bfb657745f3c765339a..d6d410c205ef380d4f2209a2848fa08c6db8eae6 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -185,10 +185,18 @@
int GetProxyForURL(const GURL& url,
ProxyInfo* results,
const CompletionCallback& callback,
- scoped_ptr<Request>* request,
+ RequestHandle* 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
@@ -201,10 +209,17 @@
int GetProxyForURL(const GURL& url,
ProxyInfo* results,
const CompletionCallback& callback,
- scoped_ptr<Request>* request,
+ RequestHandle* 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:
@@ -763,6 +778,7 @@
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),
@@ -788,7 +804,7 @@
bool is_started() const {
// Note that !! casts to bool. (VS gives a warning otherwise).
- return !!resolve_job_.get();
+ return !!resolve_job_;
}
void StartAndCompleteCheckingForSynchronous() {
@@ -803,7 +819,8 @@
void CancelResolveJob() {
DCHECK(is_started());
// The request may already be running in the resolver.
- resolve_job_.reset();
+ resolver()->CancelRequest(resolve_job_);
+ resolve_job_ = NULL;
DCHECK(!is_started());
}
@@ -831,12 +848,12 @@
int QueryDidComplete(int result_code) {
DCHECK(!was_cancelled());
- // This state is cleared when resolve_job_ is reset below.
+ // This state is cleared when resolve_job_ is set to nullptr below.
bool script_executed = is_started();
// Clear |resolve_job_| so is_started() returns false while
// DidFinishResolvingProxy() runs.
- resolve_job_.reset();
+ resolve_job_ = nullptr;
// Note that DidFinishResolvingProxy might modify |results_|.
int rv = service_->DidFinishResolvingProxy(
@@ -862,7 +879,7 @@
LoadState GetLoadState() const {
if (is_started())
- return resolve_job_->GetLoadState();
+ return resolver()->GetLoadState(resolve_job_);
return LOAD_STATE_RESOLVING_PROXY_FOR_URL;
}
@@ -895,7 +912,7 @@
GURL url_;
int load_flags_;
ProxyDelegate* proxy_delegate_;
- scoped_ptr<ProxyResolver::Request> resolve_job_;
+ ProxyResolver::RequestHandle 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_;
« no previous file with comments | « net/proxy/proxy_resolver_winhttp.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698