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

Unified Diff: net/proxy/proxy_resolver.h

Issue 160510: Better match IE's proxy settings.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix merge conflict Created 11 years, 4 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/init_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver.h
===================================================================
--- net/proxy/proxy_resolver.h (revision 22399)
+++ net/proxy/proxy_resolver.h (working copy)
@@ -8,10 +8,9 @@
#include <string>
#include "base/logging.h"
+#include "googleurl/src/gurl.h"
#include "net/base/completion_callback.h"
-class GURL;
-
namespace net {
class ProxyInfo;
@@ -52,29 +51,32 @@
bool expects_pac_bytes() const { return expects_pac_bytes_; }
// Sets the PAC script backend to use for this proxy resolver (by URL).
- void SetPacScriptByUrl(const GURL& pac_url) {
+ int SetPacScriptByUrl(const GURL& url, CompletionCallback* callback) {
DCHECK(!expects_pac_bytes());
- SetPacScriptByUrlInternal(pac_url);
+ return SetPacScript(url, std::string(), callback);
}
// Sets the PAC script backend to use for this proxy resolver (by contents).
- void SetPacScriptByData(const std::string& bytes) {
+ int SetPacScriptByData(const std::string& bytes,
+ CompletionCallback* callback) {
DCHECK(expects_pac_bytes());
- SetPacScriptByDataInternal(bytes);
+ return SetPacScript(GURL(), bytes, callback);
}
- private:
- // Called to set the PAC script backend to use. If |pac_url| is invalid,
- // this is a request to use WPAD (auto detect).
- virtual void SetPacScriptByUrlInternal(const GURL& pac_url) {
+ // TODO(eroman): Make this =0.
+ virtual void CancelSetPacScript() {
NOTREACHED();
}
- // Called to set the PAC script backend to use. |bytes| may be empty if the
+ private:
+ // Called to set the PAC script backend to use. If |pac_url| is invalid,
+ // this is a request to use WPAD (auto detect). |bytes| may be empty if the
// fetch failed, or if the fetch returned no content.
- virtual void SetPacScriptByDataInternal(const std::string& bytes) {
- NOTREACHED();
- }
+ // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies
+ // the result through |callback|.
+ virtual int SetPacScript(const GURL& pac_url,
+ const std::string& bytes,
+ CompletionCallback* callback) = 0;
const bool expects_pac_bytes_;
« no previous file with comments | « net/proxy/init_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698