| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #if defined(USE_GCONF) | 9 #if defined(USE_GCONF) |
| 10 #include <gconf/gconf-client.h> | 10 #include <gconf/gconf-client.h> |
| 11 #endif // defined(USE_GCONF) | 11 #endif // defined(USE_GCONF) |
| 12 #include <limits.h> | 12 #include <limits.h> |
| 13 #include <stdio.h> | 13 #include <stdio.h> |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 #include <sys/inotify.h> | 15 #include <sys/inotify.h> |
| 16 #include <unistd.h> | 16 #include <unistd.h> |
| 17 | 17 |
| 18 #include <map> | 18 #include <map> |
| 19 | 19 |
| 20 #include "base/bind.h" | 20 #include "base/bind.h" |
| 21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
| 22 #include "base/environment.h" | 22 #include "base/environment.h" |
| 23 #include "base/file_path.h" | 23 #include "base/file_path.h" |
| 24 #include "base/file_util.h" | 24 #include "base/file_util.h" |
| 25 #include "base/logging.h" | 25 #include "base/logging.h" |
| 26 #include "base/message_loop.h" | 26 #include "base/message_loop.h" |
| 27 #include "base/nix/xdg_util.h" | 27 #include "base/nix/xdg_util.h" |
| 28 #include "base/single_thread_task_runner.h" | 28 #include "base/single_thread_task_runner.h" |
| 29 #include "base/string_number_conversions.h" | 29 #include "base/string_number_conversions.h" |
| 30 #include "base/string_tokenizer.h" | |
| 31 #include "base/string_util.h" | 30 #include "base/string_util.h" |
| 31 #include "base/strings/string_tokenizer.h" |
| 32 #include "base/threading/thread_restrictions.h" | 32 #include "base/threading/thread_restrictions.h" |
| 33 #include "base/timer.h" | 33 #include "base/timer.h" |
| 34 #include "googleurl/src/url_canon.h" | 34 #include "googleurl/src/url_canon.h" |
| 35 #include "net/base/net_errors.h" | 35 #include "net/base/net_errors.h" |
| 36 #include "net/http/http_util.h" | 36 #include "net/http/http_util.h" |
| 37 #include "net/proxy/proxy_config.h" | 37 #include "net/proxy/proxy_config.h" |
| 38 #include "net/proxy/proxy_server.h" | 38 #include "net/proxy/proxy_server.h" |
| 39 | 39 |
| 40 #if defined(USE_GIO) | 40 #if defined(USE_GIO) |
| 41 #include "library_loaders/libgio.h" | 41 #include "library_loaders/libgio.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 } else { | 1046 } else { |
| 1047 // We don't need to parse the port number out; GetProxyFromSettings() | 1047 // We don't need to parse the port number out; GetProxyFromSettings() |
| 1048 // would only append it right back again. So we just leave the port | 1048 // would only append it right back again. So we just leave the port |
| 1049 // number right in the host string. | 1049 // number right in the host string. |
| 1050 string_table_[host_key] = value; | 1050 string_table_[host_key] = value; |
| 1051 } | 1051 } |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 void AddHostList(StringListSetting key, const std::string& value) { | 1054 void AddHostList(StringListSetting key, const std::string& value) { |
| 1055 std::vector<std::string> tokens; | 1055 std::vector<std::string> tokens; |
| 1056 StringTokenizer tk(value, ", "); | 1056 base::StringTokenizer tk(value, ", "); |
| 1057 while (tk.GetNext()) { | 1057 while (tk.GetNext()) { |
| 1058 std::string token = tk.token(); | 1058 std::string token = tk.token(); |
| 1059 if (!token.empty()) | 1059 if (!token.empty()) |
| 1060 tokens.push_back(token); | 1060 tokens.push_back(token); |
| 1061 } | 1061 } |
| 1062 strings_table_[key] = tokens; | 1062 strings_table_[key] = tokens; |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 void AddKDESetting(const std::string& key, const std::string& value) { | 1065 void AddKDESetting(const std::string& key, const std::string& value) { |
| 1066 if (key == "ProxyType") { | 1066 if (key == "ProxyType") { |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 void ProxyConfigServiceLinux::RemoveObserver(Observer* observer) { | 1751 void ProxyConfigServiceLinux::RemoveObserver(Observer* observer) { |
| 1752 delegate_->RemoveObserver(observer); | 1752 delegate_->RemoveObserver(observer); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 ProxyConfigService::ConfigAvailability | 1755 ProxyConfigService::ConfigAvailability |
| 1756 ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) { | 1756 ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) { |
| 1757 return delegate_->GetLatestProxyConfig(config); | 1757 return delegate_->GetLatestProxyConfig(config); |
| 1758 } | 1758 } |
| 1759 | 1759 |
| 1760 } // namespace net | 1760 } // namespace net |
| OLD | NEW |