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

Unified Diff: net/proxy/proxy_script_fetcher_impl.cc

Issue 6831025: Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add timeout on Win32 DHCP API. Created 9 years, 8 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
Index: net/proxy/proxy_script_fetcher_impl.cc
diff --git a/net/proxy/proxy_script_fetcher_impl.cc b/net/proxy/proxy_script_fetcher_impl.cc
index aabe34042c245e2e2986da6cabf2e4ffe58b2093..cfc2df45f5c5d7f140fc5702412797d45da76e54 100644
--- a/net/proxy/proxy_script_fetcher_impl.cc
+++ b/net/proxy/proxy_script_fetcher_impl.cc
@@ -115,28 +115,28 @@ void ProxyScriptFetcherImpl::OnResponseCompleted(URLRequest* request) {
FetchCompleted();
}
-int ProxyScriptFetcherImpl::Fetch(const GURL& url,
- string16* text,
+int ProxyScriptFetcherImpl::Fetch(string16* text,
CompletionCallback* callback) {
// It is invalid to call Fetch() while a request is already in progress.
DCHECK(!cur_request_.get());
DCHECK(callback);
DCHECK(text);
+ DCHECK(url_.is_valid());
// Handle base-64 encoded data-urls that contain custom PAC scripts.
- if (url.SchemeIs("data")) {
+ if (url_.SchemeIs("data")) {
std::string mime_type;
std::string charset;
std::string data;
- if (!DataURL::Parse(url, &mime_type, &charset, &data))
+ if (!DataURL::Parse(url_, &mime_type, &charset, &data))
return ERR_FAILED;
ConvertResponseToUTF16(charset, data, text);
return OK;
}
- cur_request_.reset(new URLRequest(url, this));
+ cur_request_.reset(new URLRequest(url_, this));
cur_request_->set_context(url_request_context_);
cur_request_->set_method("GET");
@@ -171,10 +171,14 @@ void ProxyScriptFetcherImpl::Cancel() {
ResetCurRequestState();
}
-URLRequestContext* ProxyScriptFetcherImpl::GetRequestContext() {
+URLRequestContext* ProxyScriptFetcherImpl::GetRequestContext() const {
return url_request_context_;
}
+void ProxyScriptFetcherImpl::SetURL(const GURL& url) {
+ url_ = url;
+}
+
void ProxyScriptFetcherImpl::OnAuthRequired(URLRequest* request,
AuthChallengeInfo* auth_info) {
DCHECK_EQ(request, cur_request_.get());

Powered by Google App Engine
This is Rietveld 408576698