diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 23:32:51 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 23:32:51 +0000 |
commit | db8ff912c0325d5bbff4b989de637ee371d09406 (patch) | |
tree | d76d169b88f42e8a53e193afddc851012bb5d122 /net/proxy/proxy_config.h | |
parent | 72cf3215b9359e1f7c454e9d3f281edef5bf3fc7 (diff) | |
download | chromium_src-db8ff912c0325d5bbff4b989de637ee371d09406.zip chromium_src-db8ff912c0325d5bbff4b989de637ee371d09406.tar.gz chromium_src-db8ff912c0325d5bbff4b989de637ee371d09406.tar.bz2 |
Track sources of proxy settings.
ProxyConfig keeps track of the source of proxy settings. During proxy resolution ProxyService tags the resulting ProxyInfo with the same source information.
BUG=none
TEST=net_unittests
Review URL: https://chromiumcodereview.appspot.com/10310179
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config.h')
-rw-r--r-- | net/proxy/proxy_config.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h index fa2f6e8..4b1293d 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. @@ -11,6 +11,7 @@ #include "googleurl/src/gurl.h" #include "net/base/net_export.h" #include "net/proxy/proxy_bypass_rules.h" +#include "net/proxy/proxy_config_source.h" #include "net/proxy/proxy_server.h" namespace base { @@ -53,7 +54,7 @@ class NET_EXPORT ProxyConfig { } // Sets |result| with the proxy to use for |url| based on the current rules. - void Apply(const GURL& url, ProxyInfo* result); + void Apply(const GURL& url, ProxyInfo* result) const; // Parses the rules from a string, indicating which proxies to use. // @@ -122,7 +123,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 +173,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 +215,9 @@ class NET_EXPORT ProxyConfig { // Manual proxy settings. ProxyRules proxy_rules_; + // Source of proxy settings. + ProxyConfigSource source_; + ID id_; }; |