| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
| 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Handler for gconf change notifications: fetches a new proxy | 137 // Handler for gconf change notifications: fetches a new proxy |
| 138 // configuration from gconf settings, and if this config is | 138 // configuration from gconf settings, and if this config is |
| 139 // different than what we had before, posts a task to have it | 139 // different than what we had before, posts a task to have it |
| 140 // stored in cached_config_. | 140 // stored in cached_config_. |
| 141 // Left public for simplicity. | 141 // Left public for simplicity. |
| 142 void OnCheckProxyConfigSettings(); | 142 void OnCheckProxyConfigSettings(); |
| 143 | 143 |
| 144 // Called from IO thread. | 144 // Called from IO thread. |
| 145 void AddObserver(Observer* observer); | 145 void AddObserver(Observer* observer); |
| 146 void RemoveObserver(Observer* observer); | 146 void RemoveObserver(Observer* observer); |
| 147 bool GetLatestProxyConfig(ProxyConfig* config); | 147 ProxyConfigService::ConfigAvailability GetLatestProxyConfig( |
| 148 ProxyConfig* config); |
| 148 | 149 |
| 149 // Posts a call to OnDestroy() to the UI thread. Called from | 150 // Posts a call to OnDestroy() to the UI thread. Called from |
| 150 // ProxyConfigServiceLinux's destructor. | 151 // ProxyConfigServiceLinux's destructor. |
| 151 void PostDestroyTask(); | 152 void PostDestroyTask(); |
| 152 // Safely stops gconf notifications. Posted to the UI thread. | 153 // Safely stops gconf notifications. Posted to the UI thread. |
| 153 void OnDestroy(); | 154 void OnDestroy(); |
| 154 | 155 |
| 155 private: | 156 private: |
| 156 friend class base::RefCountedThreadSafe<Delegate>; | 157 friend class base::RefCountedThreadSafe<Delegate>; |
| 157 | 158 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 file_loop); | 233 file_loop); |
| 233 } | 234 } |
| 234 void OnCheckProxyConfigSettings() { | 235 void OnCheckProxyConfigSettings() { |
| 235 delegate_->OnCheckProxyConfigSettings(); | 236 delegate_->OnCheckProxyConfigSettings(); |
| 236 } | 237 } |
| 237 | 238 |
| 238 // ProxyConfigService methods: | 239 // ProxyConfigService methods: |
| 239 // Called from IO thread. | 240 // Called from IO thread. |
| 240 virtual void AddObserver(Observer* observer); | 241 virtual void AddObserver(Observer* observer); |
| 241 virtual void RemoveObserver(Observer* observer); | 242 virtual void RemoveObserver(Observer* observer); |
| 242 virtual bool GetLatestProxyConfig(ProxyConfig* config); | 243 virtual ProxyConfigService::ConfigAvailability GetLatestProxyConfig( |
| 244 ProxyConfig* config); |
| 243 | 245 |
| 244 private: | 246 private: |
| 245 scoped_refptr<Delegate> delegate_; | 247 scoped_refptr<Delegate> delegate_; |
| 246 | 248 |
| 247 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); | 249 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); |
| 248 }; | 250 }; |
| 249 | 251 |
| 250 } // namespace net | 252 } // namespace net |
| 251 | 253 |
| 252 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 254 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
| OLD | NEW |