| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_win.h" | 5 #include "net/proxy/proxy_config_service_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <winhttp.h> | 8 #include <winhttp.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 // RegKey and ObjectWatcher pair. | 39 // RegKey and ObjectWatcher pair. |
| 40 class ProxyConfigServiceWin::KeyEntry { | 40 class ProxyConfigServiceWin::KeyEntry { |
| 41 public: | 41 public: |
| 42 bool StartWatching(base::win::ObjectWatcher::Delegate* delegate) { | 42 bool StartWatching(base::win::ObjectWatcher::Delegate* delegate) { |
| 43 // Try to create a watch event for the registry key (which watches the | 43 // Try to create a watch event for the registry key (which watches the |
| 44 // sibling tree as well). | 44 // sibling tree as well). |
| 45 if (!key_.StartWatching()) | 45 if (key_.StartWatching() != ERROR_SUCCESS) |
| 46 return false; | 46 return false; |
| 47 | 47 |
| 48 // Now setup an ObjectWatcher for this event, so we get OnObjectSignaled() | 48 // Now setup an ObjectWatcher for this event, so we get OnObjectSignaled() |
| 49 // invoked on this message loop once it is signalled. | 49 // invoked on this message loop once it is signalled. |
| 50 if (!watcher_.StartWatching(key_.watch_event(), delegate)) | 50 if (!watcher_.StartWatching(key_.watch_event(), delegate)) |
| 51 return false; | 51 return false; |
| 52 | 52 |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool CreateRegKey(HKEY rootkey, const wchar_t* subkey) { | 56 bool CreateRegKey(HKEY rootkey, const wchar_t* subkey) { |
| 57 return key_.Create(rootkey, subkey, KEY_NOTIFY); | 57 return key_.Create(rootkey, subkey, KEY_NOTIFY) == ERROR_SUCCESS; |
| 58 } | 58 } |
| 59 | 59 |
| 60 HANDLE watch_event() const { | 60 HANDLE watch_event() const { |
| 61 return key_.watch_event(); | 61 return key_.watch_event(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 base::win::RegKey key_; | 65 base::win::RegKey key_; |
| 66 base::win::ObjectWatcher watcher_; | 66 base::win::ObjectWatcher watcher_; |
| 67 }; | 67 }; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 while (proxy_server_bypass_list.GetNext()) { | 183 while (proxy_server_bypass_list.GetNext()) { |
| 184 std::string bypass_url_domain = proxy_server_bypass_list.token(); | 184 std::string bypass_url_domain = proxy_server_bypass_list.token(); |
| 185 config->proxy_rules().bypass_rules.AddRuleFromString(bypass_url_domain); | 185 config->proxy_rules().bypass_rules.AddRuleFromString(bypass_url_domain); |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 if (ie_config.lpszAutoConfigUrl) | 188 if (ie_config.lpszAutoConfigUrl) |
| 189 config->set_pac_url(GURL(ie_config.lpszAutoConfigUrl)); | 189 config->set_pac_url(GURL(ie_config.lpszAutoConfigUrl)); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace net | 192 } // namespace net |
| OLD | NEW |