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

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

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/proxy/proxy_config_service_linux_unittest.cc ('k') | net/proxy/proxy_resolver_v8.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) 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_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/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/profiler/scoped_profile.h" 14 #include "base/profiler/scoped_tracker.h"
15 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/string_tokenizer.h" 17 #include "base/strings/string_tokenizer.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/threading/thread_restrictions.h" 19 #include "base/threading/thread_restrictions.h"
20 #include "base/win/registry.h" 20 #include "base/win/registry.h"
21 #include "base/win/scoped_handle.h" 21 #include "base/win/scoped_handle.h"
22 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
23 #include "net/proxy/proxy_config.h" 23 #include "net/proxy/proxy_config.h"
24 24
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 base::Unretained(this), 106 base::Unretained(this),
107 base::Unretained(key.get())))) { 107 base::Unretained(key.get())))) {
108 return false; 108 return false;
109 } 109 }
110 110
111 keys_to_watch_.push_back(key.release()); 111 keys_to_watch_.push_back(key.release());
112 return true; 112 return true;
113 } 113 }
114 114
115 void ProxyConfigServiceWin::OnObjectSignaled(base::win::RegKey* key) { 115 void ProxyConfigServiceWin::OnObjectSignaled(base::win::RegKey* key) {
116 // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed. 116 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed.
117 tracked_objects::ScopedProfile tracking_profile( 117 tracked_objects::ScopedTracker tracking_profile(
118 FROM_HERE_WITH_EXPLICIT_FUNCTION( 118 FROM_HERE_WITH_EXPLICIT_FUNCTION(
119 "ProxyConfigServiceWin_OnObjectSignaled")); 119 "ProxyConfigServiceWin_OnObjectSignaled"));
120 120
121 // Figure out which registry key signalled this change. 121 // Figure out which registry key signalled this change.
122 RegKeyList::iterator it = 122 RegKeyList::iterator it =
123 std::find(keys_to_watch_.begin(), keys_to_watch_.end(), key); 123 std::find(keys_to_watch_.begin(), keys_to_watch_.end(), key);
124 DCHECK(it != keys_to_watch_.end()); 124 DCHECK(it != keys_to_watch_.end());
125 125
126 // Keep watching the registry key. 126 // Keep watching the registry key.
127 if (!key->StartWatching(base::Bind(&ProxyConfigServiceWin::OnObjectSignaled, 127 if (!key->StartWatching(base::Bind(&ProxyConfigServiceWin::OnObjectSignaled,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 std::string bypass_url_domain = proxy_server_bypass_list.token(); 169 std::string bypass_url_domain = proxy_server_bypass_list.token();
170 config->proxy_rules().bypass_rules.AddRuleFromString(bypass_url_domain); 170 config->proxy_rules().bypass_rules.AddRuleFromString(bypass_url_domain);
171 } 171 }
172 } 172 }
173 if (ie_config.lpszAutoConfigUrl) 173 if (ie_config.lpszAutoConfigUrl)
174 config->set_pac_url(GURL(ie_config.lpszAutoConfigUrl)); 174 config->set_pac_url(GURL(ie_config.lpszAutoConfigUrl));
175 config->set_source(PROXY_CONFIG_SOURCE_SYSTEM); 175 config->set_source(PROXY_CONFIG_SOURCE_SYSTEM);
176 } 176 }
177 177
178 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_linux_unittest.cc ('k') | net/proxy/proxy_resolver_v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698