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

Unified Diff: net/proxy/proxy_info.cc

Issue 10310179: Track sources of proxy settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 7 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_info.cc
diff --git a/net/proxy/proxy_info.cc b/net/proxy/proxy_info.cc
index b7d40a0379a767d1ddb1b43acb0b456a25ddbcb1..556e01d846b425725ee30e2b8217b769a0ce3602 100644
--- a/net/proxy/proxy_info.cc
+++ b/net/proxy/proxy_info.cc
@@ -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.
@@ -8,7 +8,9 @@
namespace net {
-ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::kInvalidConfigID) {
+ProxyInfo::ProxyInfo()
+ : config_id_(ProxyConfig::kInvalidConfigID),
+ config_source_(PROXY_CONFIG_SOURCE_UNKNOWN) {
}
ProxyInfo::~ProxyInfo() {
@@ -17,21 +19,23 @@ ProxyInfo::~ProxyInfo() {
void ProxyInfo::Use(const ProxyInfo& other) {
proxy_list_ = other.proxy_list_;
proxy_retry_info_ = other.proxy_retry_info_;
+ config_id_ = other.config_id_;
+ config_source_ = other.config_source_;
}
void ProxyInfo::UseDirect() {
+ Reset();
proxy_list_.SetSingleProxyServer(ProxyServer::Direct());
- proxy_retry_info_.clear();
}
void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) {
+ Reset();
proxy_list_.Set(proxy_uri_list);
- proxy_retry_info_.clear();
}
void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) {
+ Reset();
proxy_list_.SetSingleProxyServer(proxy_server);
- proxy_retry_info_.clear();
}
std::string ProxyInfo::ToPacString() const {
@@ -51,4 +55,11 @@ void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) {
proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field);
}
+void ProxyInfo::Reset() {
+ proxy_list_.Clear();
+ proxy_retry_info_.clear();
+ config_id_ = ProxyConfig::kInvalidConfigID;
+ config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN;
+}
+
} // namespace net
« no previous file with comments | « net/proxy/proxy_info.h ('k') | net/proxy/proxy_list.h » ('j') | net/proxy/proxy_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698