summaryrefslogtreecommitdiffstats
path: root/net/proxy/init_proxy_resolver.cc
Commit message (Collapse)AuthorAgeFilesLines
* Refactor: Extract "InitProxyResolver" to "ProxyScriptDecider".eroman@chromium.org2011-12-131-382/+0
| | | | | | | | | | | | | This is primarily a rename, with the exception that the initialization of ProxyResolver (i.e. the javascript runtime environment for the PAC script) is no longer done inside of ProxyScriptDecider. The motivation for doing this is to make it possible to poll our automatic proxy settings (PAC URLs or WPAD) in the background, _without_ needing to feed the scripts into the javascript parser for validation. There likely won't be any user-visible consequence of this change, however the new mechanism is weaker than the original -- it is possible for the PAC selection to now choose a PAC script which fails to parse as javascript, even though there was a later fallback choice which does parse. This should be rare though (the bad response would need to contain the substring "FindProxyForURL"). BUG=TODO (bugtracker down right now) Review URL: http://codereview.chromium.org/8896019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114281 0039d316-1c4b-4281-b951-d872f2087c98
* Begin CompletionCallback switchover.willchan@chromium.org2011-10-011-1/+1
| | | | | | | | | | | | | Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback. Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g. BUG=98719 TEST=none Review URL: http://codereview.chromium.org/8070013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98
* Update base/timer.h code to pass through Location from call sites. (reland) ↵jbates@chromium.org2011-09-021-1/+2
| | | | | | | | original CL w/LGTMs: http://codereview.chromium.org/7812036/ Review URL: http://codereview.chromium.org/7824041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99409 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location,mattm@chromium.org2011-09-021-2/+1
| | | | | | | | | | | | so the original code that created the delayed callback is lost." This reverts commit 4cf5cf73d319b69c32ad30af8954235755856455. (r99284) TBR=jbates@chromium.org Review URL: http://codereview.chromium.org/7825026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99290 0039d316-1c4b-4281-b951-d872f2087c98
* Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, so ↵jbates@chromium.org2011-09-021-1/+2
| | | | | | | | | | the original code that created the delayed callback is lost. This change adds a tracked_objects::Location parameter to the APIs in base/timer.h so we can trace the PostTask callbacks. The other files are touched to add the FROM_HERE Location parameter. Review URL: http://codereview.chromium.org/7812036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99284 0039d316-1c4b-4281-b951-d872f2087c98
* Cancel when InitProxyResolver cancels, so we don't use callback later.joi@chromium.org2011-06-131-0/+4
| | | | | | | | | | | | Also fix the invariant of data, i.e. null client_callback_ once we enter state DONE. BUG=84496 TEST=net_unittests --gtest_filter=Dhcp*:InitProxy* Review URL: http://codereview.chromium.org/7044058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88829 0039d316-1c4b-4281-b951-d872f2087c98
* Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol.joi@chromium.org2011-05-171-42/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Review URL: http://codereview.chromium.org/6831025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85661 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85646 - Adds support for the DHCP portion of the WPAD (proxy ↵joi@chromium.org2011-05-171-103/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Review URL: http://codereview.chromium.org/6831025 TBR=joi@chromium.org Review URL: http://codereview.chromium.org/7019015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85648 0039d316-1c4b-4281-b951-d872f2087c98
* Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol.joi@chromium.org2011-05-171-42/+103
| | | | | | | | | | | | | | | | | | | | | | | | | 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. Review URL: http://codereview.chromium.org/6831025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85646 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented unit tests for ProxyService and fixed a bugbattre@chromium.org2011-05-061-1/+5
| | | | | | | | | BUG=81368 TEST=execute net_unittests --gtest_filter='ProxyServiceTest.*' Review URL: http://codereview.chromium.org/6932041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84422 0039d316-1c4b-4281-b951-d872f2087c98
* Add an explanation for the divergenace from WPAD DNS protocol.eroman@chromium.org2011-02-231-1/+11
| | | | | | Review URL: http://codereview.chromium.org/6538009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75693 0039d316-1c4b-4281-b951-d872f2087c98
* NetLog: Log net error codes on a lot of EndEvents.mmenke@chromium.org2011-02-081-15/+10
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6349083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74143 0039d316-1c4b-4281-b951-d872f2087c98
* Convert implicit scoped_refptr constructor calls to explicit ones, part 2thakis@chromium.org2010-11-021-4/+4
| | | | | | | | | | | | This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2826041 I then did quite a bit of manual editing to fix style issues. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4291001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64798 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor: Address a TODO about renaming a function.eroman@chromium.org2010-08-311-1/+1
| | | | | | Review URL: http://codereview.chromium.org/3216008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57959 0039d316-1c4b-4281-b951-d872f2087c98
* Display the "effective" proxy settings in about:net-internals.eroman@chromium.org2010-08-281-2/+24
| | | | | | | | | | | | The "effective" settings is what you get after applying the various fallbacks between automatic and manual settings. This display makes it easier to notice whether "auto-detect" actually took effect, and if so what was the PAC URL it used. BUG=53549 TEST=On windows change your proxy settings to include both auto-detect, a custom pac script, and some manually configured proxy servers. Now run chrome and go to the proxy tab on about:net-internals. Check that the "original" settings is what you entered in the dialog box, however the "effective" settings will only be a subset of them. Review URL: http://codereview.chromium.org/3241002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57767 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce an artificial 2 second delay after network IP address changes ↵eroman@chromium.org2010-08-261-1/+42
| | | | | | | | | | | | | | | before re-running proxy auto-config. During this time network requests will be stalled. This is to work around a problem where DNS gives transient failures shortly after IP address changes. BUG=50779 TEST=On a linux laptop switch between wireless networks while using auto-detect. When you switch to a network that contains the host 'wpad' verify that when InitProxyResolver runs it does not get a DNS error resolving 'wpad'. (Use about:net-internals to view this information). Review URL: http://codereview.chromium.org/3151040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57471 0039d316-1c4b-4281-b951-d872f2087c98
* Reference-count the data used by PAC scripts, so it is shared between threads.eroman@chromium.org2010-07-201-14/+25
| | | | | | | BUG=49396 Review URL: http://codereview.chromium.org/2836060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53095 0039d316-1c4b-4281-b951-d872f2087c98
* Optimization: reduce the copying of string data between C++ and javascript ↵eroman@chromium.org2010-07-011-2/+2
| | | | | | | | | | | | | | | in proxy_resolver_v8.cc. This is done by sharing the string storage using ExternalStringResource. An accompanying change was to pass around the PAC script data as a UTF16 string16 rather than a UTF8 std::string -- this required changing plumbing in the other files. This optimization will be important when creating multiple ProxyResolverV8's so they don't end up duplicating the script text. BUG=11079 Review URL: http://codereview.chromium.org/2817043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51434 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove the implicit constructor for BoundNetLog that allowed ↵eroman@chromium.org2010-04-281-7/+6
| | | | | | | | | passing NULL in place of a const BoundNetLog&. BUG=37421 Review URL: http://codereview.chromium.org/1783008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45851 0039d316-1c4b-4281-b951-d872f2087c98
* More cleanup to address TODOs in net_log.h.eroman@chromium.org2010-04-281-14/+15
| | | | | | | | | | | * Removes 9 methods: AddEventWithParameters, BeginEventWithParameters, EndEventWithParameters, BeginEventWithString, BeginEventWithInteger, AddEventWithString, AddEventWithInteger, EndEventWithParameters, EndEventWithInteger. This was becoming ridiculous, instead made the EventParameters* a required parameter. * Moves CapturingBoundNetLog / CapturingNetLog to its own file. BUG=37421 Review URL: http://codereview.chromium.org/1746012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45843 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Address some of the todos in net_log.heroman@chromium.org2010-04-271-20/+15
| | | | | | | | | | | - Get rid of the AddString() and AddStringLiteral() methods. - Make EventParameters able to serialize to JSON, instead of a string. BUG=37421 Review URL: http://codereview.chromium.org/1716007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45750 0039d316-1c4b-4281-b951-d872f2087c98
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-161-24/+18
| | | | | | | | | | | | | | | | event stream (NetLog). This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events. This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up. The user-visible behavior should remain unchanged. BUG=37421 Review URL: http://codereview.chromium.org/848006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
* ProxyConfig behaved like a struct, but was defined as a class.eroman@chromium.org2010-02-241-3/+3
| | | | | | | | | Changed it to be a proper class with hidden implementation variables, setters etc. Also seized this opportunity to move the bypass list from being a member of ProxyConfig, to being a member of ProxyRules. This is a more correct hiearchy, since the bypass rules only apply to the manual settings. Lastly, this makes it possible to have the manual rules evaluation be a method on ProxyRules, and shift some more code out of proxy_service. Review URL: http://codereview.chromium.org/651070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39818 0039d316-1c4b-4281-b951-d872f2087c98
* Move some logging from LOG(INFO) to the LoadLog. These particular ones are ↵eroman@chromium.org2009-12-221-12/+22
| | | | | | | | for proxy initialization, and are enabled in passive mode since the data will be little. Review URL: http://codereview.chromium.org/501162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35123 0039d316-1c4b-4281-b951-d872f2087c98
* NULL out the ProxyScriptFetcher used by ProxyService when the ↵eroman@chromium.org2009-11-181-0/+5
| | | | | | | | | | | | URLRequestContext it was using for downloads is destroyed. This avoids the possibility of accessing freed memory when sharing ProxyService amongst request context, and the main context is destroyed first. BUG=25338 Review URL: http://codereview.chromium.org/387065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32427 0039d316-1c4b-4281-b951-d872f2087c98
* Instrument ProxyService and InitProxyResolver with LoadLog.eroman@chromium.org2009-08-171-12/+52
| | | | | | | | BUG=http://crbug.com/14478 Review URL: http://codereview.chromium.org/172020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23573 0039d316-1c4b-4281-b951-d872f2087c98
* Better match IE's proxy settings.ericroman@google.com2009-08-041-0/+189
* When BOTH autodetect and custom PAC script are given, try both. * Use successful PAC parsing as the heuristic for determining when a script is valid (rather than first-request). * Only apply the proxy bypass list when using non-PAC. The high level explanation on how this works: http://sites.google.com/a/chromium.org/dev/developers/design-documents/proxy-settings-fallback BUG= http://crbug.com/18271, http://crbug.com/9985 TEST=unit tests. Review URL: http://codereview.chromium.org/160510 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22430 0039d316-1c4b-4281-b951-d872f2087c98