Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: net/proxy/proxy_config_service_win.cc

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/ssl_config_service_win.cc ('k') | webkit/plugins/npapi/plugin_list_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/ssl_config_service_win.cc ('k') | webkit/plugins/npapi/plugin_list_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698