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

Issue 6831025: Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol. (Closed)

Created:
9 years, 8 months ago by Jói
Modified:
9 years, 6 months ago
CC:
chromium-reviews, wtc
Visibility:
Public.

Description

Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol. This is Windows-only for now, and is disabled by default. Start Chrome with the flag --enable-dhcp-wpad to enable the feature. See discussion in comment on DhcpProxyScriptFetcherFactory for why this needs to be done in a per-platform way rather than cross-platform. The code is factored so that adding other platform implementations will be straight forward. Most of the implementation is stand-alone and extends the ScriptProxyFetcher class hierarchy (and makes its interface slightly more generic). The integration point into existing code is in InitProxyResolver, which previously handled fallback from DNS auto-detect to custom PAC URL and now does fallback from DHCP to DNS to custom PAC URL. BUG=18575 TEST=net_unittests has good coverage for the new and changed code, but manual tests on a network with a PAC URL configured in DHCP are also needed. Original commit r85646. Reverted (test failures on some release bots) r85648. Will reland with fix. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=85661

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fixing a couple of issues shown by trybots. #

Patch Set 3 : Add PAC URL from DHCP to effective proxy config. Add unit tests for that. #

Patch Set 4 : Merge to lkgr. #

Patch Set 5 : Add timeout on Win32 DHCP API. #

Total comments: 88

Patch Set 6 : Fix issue found by unit testing on a slow machine. #

Total comments: 6

Patch Set 7 : Responding to review comments. #

Total comments: 46

Patch Set 8 : Respond to all but one piece of review feedback. #

Patch Set 9 : Isolate worker thread to separate object. Refcount context. Fix mandatory PAC. #

Total comments: 50

Patch Set 10 : Address last round of review comments. #

Patch Set 11 : Merge to head. #

Patch Set 12 : Fix release-only bug. #

Patch Set 13 : Fix memory leaks in unit test. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2527 lines, -177 lines) Patch
M chrome/browser/net/connection_tester.cc View 1 2 3 4 5 6 7 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/net/proxy_service_factory.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -7 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M net/base/net_error_list.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M net/base/net_log_event_type_list.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -7 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_adapter_fetcher_win.h View 1 2 3 4 5 6 7 8 9 1 chunk +198 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +286 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +300 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher.h View 1 2 3 4 5 6 7 1 chunk +98 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher.cc View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher_factory.h View 1 2 3 4 5 6 7 1 chunk +68 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +57 lines, -0 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -5 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher_win.h View 1 2 3 4 5 6 7 8 9 1 chunk +123 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +246 lines, -0 lines 0 comments Download
A net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +545 lines, -0 lines 2 comments Download
A net/proxy/dhcpcsvc_init_win.h View 1 chunk +20 lines, -0 lines 0 comments Download
A net/proxy/dhcpcsvc_init_win.cc View 1 chunk +40 lines, -0 lines 0 comments Download
M net/proxy/init_proxy_resolver.h View 1 2 3 4 5 6 7 8 9 7 chunks +32 lines, -14 lines 0 comments Download
M net/proxy/init_proxy_resolver.cc View 1 2 3 4 5 6 7 8 9 10 chunks +103 lines, -42 lines 0 comments Download
M net/proxy/init_proxy_resolver_unittest.cc View 1 2 3 4 5 6 7 8 9 27 chunks +156 lines, -30 lines 0 comments Download
A net/proxy/mock_proxy_script_fetcher.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
A net/proxy/mock_proxy_script_fetcher.cc View 1 2 3 4 5 6 7 8 1 chunk +55 lines, -0 lines 0 comments Download
M net/proxy/proxy_script_fetcher.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_script_fetcher_impl.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M net/proxy/proxy_script_fetcher_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_service.h View 1 2 3 4 5 6 7 8 9 5 chunks +17 lines, -4 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -5 lines 0 comments Download
M net/proxy/proxy_service_unittest.cc View 1 2 3 4 5 6 7 13 chunks +24 lines, -58 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Jói
Hi Eric, This is a bit big; apologies but there weren't really good milestones along ...
9 years, 8 months ago (2011-04-14 20:23:53 UTC) #1
Jói
One more thing: I haven't added NetLog logging to the DHCP fetcher classes yet. I ...
9 years, 8 months ago (2011-04-14 20:25:44 UTC) #2
eroman
Thanks Joi! I am a little backlogged on codereviews, but I will try to get ...
9 years, 8 months ago (2011-04-14 20:54:31 UTC) #3
Jói
Thanks a lot Eric. I'll mention two things, since you are busy: a) If you ...
9 years, 8 months ago (2011-04-14 20:59:37 UTC) #4
eroman
> a) If you would like me to ask somebody else to review, I > ...
9 years, 8 months ago (2011-04-14 21:19:30 UTC) #5
Jói
> I just want to set your expectations accordingly, that it might take me a ...
9 years, 8 months ago (2011-04-14 23:37:02 UTC) #6
Jói
FYI, I have uploaded a version that sets the effective proxy configuration correctly, and I ...
9 years, 8 months ago (2011-04-15 18:57:18 UTC) #7
Jói
Hi Eric, Manual testing revealed that the Win32 DHCP API can take an extremely long ...
9 years, 8 months ago (2011-04-19 19:12:38 UTC) #8
eroman
Thanks Joi, there is a lot of good stuff in here! Let me start with ...
9 years, 8 months ago (2011-04-21 05:22:48 UTC) #9
Jói
Hi Eric, Thanks a lot for doing this long review. Let's discuss your high-level comments ...
9 years, 8 months ago (2011-04-21 15:57:38 UTC) #10
cpu_(ooo_6.6-7.5)
drive-by http://codereview.chromium.org/6831025/diff/17001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc File net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc (right): http://codereview.chromium.org/6831025/diff/17001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc#newcode19 net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc:19: can this dhcp dll be delay-loaded?
9 years, 8 months ago (2011-04-22 20:54:59 UTC) #11
Jói
Eric, this is just to document the decisions we made when we spoke yesterday: a) ...
9 years, 7 months ago (2011-05-03 15:53:06 UTC) #12
Jói
Please take another look. Cheers, Jói http://codereview.chromium.org/6831025/diff/14001/chrome/common/chrome_switches.cc File chrome/common/chrome_switches.cc (right): http://codereview.chromium.org/6831025/diff/14001/chrome/common/chrome_switches.cc#newcode403 chrome/common/chrome_switches.cc:403: const char kEnableDhcpPac[] ...
9 years, 7 months ago (2011-05-03 21:20:59 UTC) #13
Jói
FYI - nothing important, just a couple of things I noticed today. http://codereview.chromium.org/6831025/diff/14001/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc File net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc ...
9 years, 7 months ago (2011-05-05 14:58:42 UTC) #14
Jói
Gentle ping - I know you were away for a few days. Cheers, Jói On ...
9 years, 7 months ago (2011-05-11 18:36:08 UTC) #15
eroman
http://codereview.chromium.org/6831025/diff/23001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc File net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc (right): http://codereview.chromium.org/6831025/diff/23001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc#newcode55 net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc:55: wait_timer_.Start(base::TimeDelta::FromMilliseconds(ImplGetTimeoutMs()), (optional) how about having ImplGetTimeout return a TimeDelta? ...
9 years, 7 months ago (2011-05-13 05:03:32 UTC) #16
Jói
I've uploaded a new version. There is one change still pending to handle the last ...
9 years, 7 months ago (2011-05-13 20:19:09 UTC) #17
Jói
Eric, I've uploaded a new version that I think should be good to go. In ...
9 years, 7 months ago (2011-05-16 17:22:49 UTC) #18
eroman
LGTM after considering below comments. http://codereview.chromium.org/6831025/diff/35001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc File net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc (right): http://codereview.chromium.org/6831025/diff/35001/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc#newcode61 net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc:61: void DhcpProxyScriptAdapterFetcher::Cancel() { This ...
9 years, 7 months ago (2011-05-17 04:39:39 UTC) #19
Jói
Thanks a lot Eric. I've uploaded a new version that addresses your final round of ...
9 years, 7 months ago (2011-05-17 15:38:35 UTC) #20
Timur Iskhodzhanov
http://codereview.chromium.org/6831025/diff/44002/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc File net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc (right): http://codereview.chromium.org/6831025/diff/44002/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc#newcode226 net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc:226: void Cancel() OVERRIDE { FYI, You're overriding the Cancel() ...
9 years, 6 months ago (2011-06-27 14:44:01 UTC) #21
Jói
9 years, 6 months ago (2011-06-27 15:19:06 UTC) #22
http://codereview.chromium.org/6831025/diff/44002/net/proxy/dhcp_proxy_script...
File net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc (right):

http://codereview.chromium.org/6831025/diff/44002/net/proxy/dhcp_proxy_script...
net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc:226: void Cancel() OVERRIDE
{
On 2011/06/27 14:44:01, Timur Iskhodzhanov wrote:
> FYI,
> You're overriding the Cancel() method which is called in the base class
> destructor as well.
> Are you aware that the destructor of the base class would end up calling the
not
> overridden version of the method?

Thanks, yes I'm aware.  I only need to stop the timer here when Cancel is called
outside of destruction so this is fine in this case.

Powered by Google App Engine
This is Rietveld 408576698