Chromium Code Reviews| Index: net/proxy/proxy_config.h |
| diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h |
| index fa2f6e882a7eb783feea8baea0523ef4cf88cc2c..dd914bf060c5459e18f6480558add198d1311b64 100644 |
| --- a/net/proxy/proxy_config.h |
| +++ b/net/proxy/proxy_config.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -10,6 +10,7 @@ |
| #include "googleurl/src/gurl.h" |
| #include "net/base/net_export.h" |
| +#include "net/proxy/proxy_config_source.h" |
|
eroman
2012/05/18 03:58:56
I believe this should be sorted lower.
asanka
2012/05/18 16:27:01
Done.
|
| #include "net/proxy/proxy_bypass_rules.h" |
| #include "net/proxy/proxy_server.h" |
| @@ -52,8 +53,11 @@ class NET_EXPORT ProxyConfig { |
| return type == TYPE_NO_RULES; |
| } |
| - // Sets |result| with the proxy to use for |url| based on the current rules. |
| - void Apply(const GURL& url, ProxyInfo* result); |
| + // Sets |result| with the proxy to use for |url| based on the current |
| + // rules. Returns true if applicable rules were found and |result| was set |
| + // accordingly. If no rules are applicable, sets |result| to use direct |
| + // connections and returns false. |
| + bool Apply(const GURL& url, ProxyInfo* result) const; |
| // Parses the rules from a string, indicating which proxies to use. |
| // |
| @@ -122,7 +126,8 @@ class NET_EXPORT ProxyConfig { |
| void set_id(ID id) { id_ = id; } |
| bool is_valid() const { return id_ != kInvalidConfigID; } |
| - // Returns true if the given config is equivalent to this config. |
| + // Returns true if the given config is equivalent to this config. The |
| + // comparison ignores differences in |id()| and |source()|. |
| bool Equals(const ProxyConfig& other) const; |
| // Returns true if this config contains any "automatic" settings. See the |
| @@ -171,6 +176,14 @@ class NET_EXPORT ProxyConfig { |
| return auto_detect_; |
| } |
| + void set_source(ProxyConfigSource source) { |
| + source_ = source; |
| + } |
| + |
| + ProxyConfigSource source() const { |
| + return source_; |
| + } |
| + |
| // Helpers to construct some common proxy configurations. |
| static ProxyConfig CreateDirect() { |
| @@ -205,6 +218,9 @@ class NET_EXPORT ProxyConfig { |
| // Manual proxy settings. |
| ProxyRules proxy_rules_; |
| + // Source of proxy settings. |
| + ProxyConfigSource source_; |
| + |
| ID id_; |
| }; |