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 #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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class MessageLoopForIO; | 23 class MessageLoopForIO; |
24 class SingleThreadTaskRunner; | 24 class SingleThreadTaskRunner; |
25 } // namespace base | 25 } // namespace base |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 | 28 |
29 // Implementation of ProxyConfigService that retrieves the system proxy | 29 // Implementation of ProxyConfigService that retrieves the system proxy |
30 // settings from environment variables, gconf, gsettings, or kioslaverc (KDE). | 30 // settings from environment variables, gconf, gsettings, or kioslaverc (KDE). |
31 class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { | 31 class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { |
32 public: | 32 public: |
33 | |
34 // Forward declaration of Delegate. | 33 // Forward declaration of Delegate. |
35 class Delegate; | 34 class Delegate; |
36 | 35 |
37 class SettingGetter { | 36 class SettingGetter { |
38 public: | 37 public: |
39 // Buffer size used in some implementations of this class when reading | 38 // Buffer size used in some implementations of this class when reading |
40 // files. Defined here so unit tests can construct worst-case inputs. | 39 // files. Defined here so unit tests can construct worst-case inputs. |
41 static const size_t BUFFER_SIZE = 512; | 40 static const size_t BUFFER_SIZE = 512; |
42 | 41 |
43 SettingGetter() {} | 42 SettingGetter() {} |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 explicit ProxyConfigServiceLinux(base::Environment* env_var_getter); | 276 explicit ProxyConfigServiceLinux(base::Environment* env_var_getter); |
278 ProxyConfigServiceLinux(base::Environment* env_var_getter, | 277 ProxyConfigServiceLinux(base::Environment* env_var_getter, |
279 SettingGetter* setting_getter); | 278 SettingGetter* setting_getter); |
280 | 279 |
281 virtual ~ProxyConfigServiceLinux(); | 280 virtual ~ProxyConfigServiceLinux(); |
282 | 281 |
283 void SetupAndFetchInitialConfig( | 282 void SetupAndFetchInitialConfig( |
284 base::SingleThreadTaskRunner* glib_thread_task_runner, | 283 base::SingleThreadTaskRunner* glib_thread_task_runner, |
285 base::SingleThreadTaskRunner* io_thread_task_runner, | 284 base::SingleThreadTaskRunner* io_thread_task_runner, |
286 base::MessageLoopForIO* file_loop) { | 285 base::MessageLoopForIO* file_loop) { |
287 delegate_->SetUpAndFetchInitialConfig(glib_thread_task_runner, | 286 delegate_->SetUpAndFetchInitialConfig( |
288 io_thread_task_runner, file_loop); | 287 glib_thread_task_runner, io_thread_task_runner, file_loop); |
289 } | 288 } |
290 void OnCheckProxyConfigSettings() { | 289 void OnCheckProxyConfigSettings() { delegate_->OnCheckProxyConfigSettings(); } |
291 delegate_->OnCheckProxyConfigSettings(); | |
292 } | |
293 | 290 |
294 // ProxyConfigService methods: | 291 // ProxyConfigService methods: |
295 // Called from IO thread. | 292 // Called from IO thread. |
296 virtual void AddObserver(Observer* observer) OVERRIDE; | 293 virtual void AddObserver(Observer* observer) OVERRIDE; |
297 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 294 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
298 virtual ProxyConfigService::ConfigAvailability GetLatestProxyConfig( | 295 virtual ProxyConfigService::ConfigAvailability GetLatestProxyConfig( |
299 ProxyConfig* config) OVERRIDE; | 296 ProxyConfig* config) OVERRIDE; |
300 | 297 |
301 private: | 298 private: |
302 scoped_refptr<Delegate> delegate_; | 299 scoped_refptr<Delegate> delegate_; |
303 | 300 |
304 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); | 301 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceLinux); |
305 }; | 302 }; |
306 | 303 |
307 } // namespace net | 304 } // namespace net |
308 | 305 |
309 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ | 306 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_LINUX_H_ |
OLD | NEW |