diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 18:24:53 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-14 18:24:53 +0000 |
commit | a48bf4a393ca231598de072e68c93b3a6ce757b9 (patch) | |
tree | de50675e79529b8016d1768c3b16d389ac6966e8 /net/proxy/proxy_config_service_linux.cc | |
parent | bdd5a9c900feb38b9e5bf150bccad6012eb8b729 (diff) | |
download | chromium_src-a48bf4a393ca231598de072e68c93b3a6ce757b9.zip chromium_src-a48bf4a393ca231598de072e68c93b3a6ce757b9.tar.gz chromium_src-a48bf4a393ca231598de072e68c93b3a6ce757b9.tar.bz2 |
Implement KDE ReversedException setting in Chrome
R=wtc,eroman
BUG=45199
TEST=Added unit tests, can also verify with steps in bug report
Review URL: http://codereview.chromium.org/2725009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config_service_linux.cc')
-rw-r--r-- | net/proxy/proxy_config_service_linux.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index bf25ebb..072a5ae 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -350,6 +350,11 @@ class GConfSettingGetterImplGConf return true; } + virtual bool BypassListIsReversed() { + // This is a KDE-specific setting. + return false; + } + private: // Logs and frees a glib error. Returns false if there was no error // (error is NULL). @@ -413,7 +418,7 @@ class GConfSettingGetterImplKDE public: explicit GConfSettingGetterImplKDE(base::EnvVarGetter* env_var_getter) : inotify_fd_(-1), notify_delegate_(NULL), indirect_manual_(false), - auto_no_pac_(false), reversed_exception_(false), + auto_no_pac_(false), reversed_bypass_list_(false), env_var_getter_(env_var_getter), file_loop_(NULL) { // Derive the location of the kde config dir from the environment. std::string home; @@ -569,13 +574,17 @@ class GConfSettingGetterImplKDE return true; } + virtual bool BypassListIsReversed() { + return reversed_bypass_list_; + } + private: void ResetCachedSettings() { string_table_.clear(); strings_table_.clear(); indirect_manual_ = false; auto_no_pac_ = false; - reversed_exception_ = false; + reversed_bypass_list_ = false; } FilePath KDEHomeToConfigPath(const FilePath& kde_home) { @@ -645,7 +654,7 @@ class GConfSettingGetterImplKDE // We count "true" or any nonzero number as true, otherwise false. // Note that if the value is not actually numeric StringToInt() // will return 0, which we count as false. - reversed_exception_ = (value == "true" || StringToInt(value)); + reversed_bypass_list_ = (value == "true" || StringToInt(value)); } else if (key == "NoProxyFor") { AddHostList("/system/http_proxy/ignore_hosts", value); } else if (key == "AuthMode") { @@ -698,14 +707,6 @@ class GConfSettingGetterImplKDE // Remove the PAC URL; we're not supposed to use it. string_table_.erase("/system/proxy/autoconfig_url"); } - if (reversed_exception_) { - // We don't actually support this setting. (It means to use the proxy - // *only* for the exception list, rather than everything but them.) - // Nevertheless we can do better than *exactly the opposite* of the - // desired behavior by clearing the exception list and warning. - strings_table_.erase("/system/http_proxy/ignore_hosts"); - LOG(WARNING) << "KDE reversed proxy exception list not supported"; - } } // Reads kioslaverc one line at a time and calls AddKDESetting() to add @@ -859,7 +860,7 @@ class GConfSettingGetterImplKDE FilePath kde_config_dir_; bool indirect_manual_; bool auto_no_pac_; - bool reversed_exception_; + bool reversed_bypass_list_; // We don't own |env_var_getter_|. It's safe to hold a pointer to it, since // both it and us are owned by ProxyConfigServiceLinux::Delegate, and have the // same lifetime. @@ -1022,6 +1023,9 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromGConf( // Note that there are no settings with semantics corresponding to // bypass of local names. + // KDE allows one to reverse the bypass rules. + config->proxy_rules().reverse_bypass = gconf_getter_->BypassListIsReversed(); + return true; } |