summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_resolver_v8.h
Commit message (Collapse)AuthorAgeFilesLines
* Switch to standard integer types in net/.Avi Drissman2015-12-201-0/+3
| | | | | | | | | BUG=488550 TBR=mmenke@chromium.org Review URL: https://codereview.chromium.org/1535363003 . Cr-Commit-Position: refs/heads/master@{#366297}
* Change ProxyResolverV8 to not implement the ProxyResolver interface.sammc2015-05-271-24/+16
| | | | | | | | | | | | | | | Because it needs to set the JSBindings for each request, ProxyResolverV8Tracing has to use ProxyResolverV8 directly. Since the only other user is ProxyResolverPerfTest, ProxyResolverV8 doesn't have a good reason to implement the ProxyResolver interface. This CL changes ProxyResolverV8 to expose a simpler interface and adds a wrapper that implements the ProxyResolver interface for ProxyResolverPerfTest to use. BUG=467403 Review URL: https://codereview.chromium.org/1124573002 Cr-Commit-Position: refs/heads/master@{#331519}
* net cleanup: Remove unnecessary namespace prefixes.ttuttle2015-04-231-2/+2
| | | | | | | | BUG=475208 Review URL: https://codereview.chromium.org/1095823003 Cr-Commit-Position: refs/heads/master@{#326610}
* Lazily initialize the v8::Isolate used by ProxyResolverV8 (in the browser ↵eroman2015-02-261-35/+0
| | | | | | | | | | | | process). Also removes the limitation of ProxyResolverV8 not being available in single-process mode which no longer applies. BUG=454983 Review URL: https://codereview.chromium.org/957933002 Cr-Commit-Position: refs/heads/master@{#318277}
* Standardize usage of virtual/override/final in net/dcheng2014-10-211-12/+11
| | | | | | | | | | | | This patch was automatically generated by applying clang fixit hints generated by the plugin to the source tree. BUG=417463 TBR=rsleevi@chromium.org Review URL: https://codereview.chromium.org/667923003 Cr-Commit-Position: refs/heads/master@{#300466}
* replace OVERRIDE and FINAL with override and final in net/mostynb2014-10-091-5/+5
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/623213004 Cr-Commit-Position: refs/heads/master@{#298844}
* Make net use v8 through ginjochen@chromium.org2014-04-081-13/+9
| | | | | | | | | | | | - no longer try to use the default isolate (we want to remove it from v8) - add the option to gin to manage an isolate in non-strict mode BUG=359977 R=eroman@chromium.org,abarth@chromium.org Review URL: https://codereview.chromium.org/227233006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262559 0039d316-1c4b-4281-b951-d872f2087c98
* Remove PurgeMemory() from the proxy service. The MemoryPurger is gone, so thispkasting@chromium.org2014-03-111-1/+0
| | | | | | | | | | | | is unused. BUG=350455 TEST=none R=eroman@chromium.org Review URL: https://codereview.chromium.org/193883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256301 0039d316-1c4b-4281-b951-d872f2087c98
* When running in metro mode, remember the default isolate on the main threadjochen@chromium.org2013-07-311-0/+10
| | | | | | | | | | | | The V8 proxy resolver depends on using the default isolate which is created on the main thread. BUG=259218 R=cpu@chromium.org, eroman@chromium.org Review URL: https://codereview.chromium.org/21084006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214586 0039d316-1c4b-4281-b951-d872f2087c98
* Convert net to use base::string16 instead of string16.brettw@chromium.org2013-03-291-2/+2
| | | | | | | | | | This is just a search-and-replace. BUG= Review URL: https://codereview.chromium.org/13329004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191432 0039d316-1c4b-4281-b951-d872f2087c98
* Replaced deprecated v8 API calls by their non-deprecated counterparts.svenpanne@chromium.org2013-03-051-0/+6
| | | | | | | | | | TBR=darin@chromium.org BUG=v8:2487 Review URL: https://chromiumcodereview.appspot.com/12398007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186152 0039d316-1c4b-4281-b951-d872f2087c98
* Optimization for ProxyResolverV8Tracing: early termination.eroman@chromium.org2013-02-211-3/+4
| | | | | | | | | | | Tries to terminate the script V8 execution when the run is abandoned for DNS tracing. BUG=119151 Review URL: https://chromiumcodereview.appspot.com/12289019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183743 0039d316-1c4b-4281-b951-d872f2087c98
* Make the v8 Isolate used in the proxy resolver explicit.jochen@chromium.org2013-02-011-0/+11
| | | | | | | | | | | | | | | For conceptual and performance reasons, the v8 API will require explicit passing of Isolates in the future instead of relying on the retrieval of one out of thin air (= either TLS or an evil global variable in v8). This CL makes the Isolate explicit in ProxyResolverV8::Context. The default Isolate is retrieved and remembered in the main browser thread and then passed down to the Context where it is needed in different threads. Review URL: https://codereview.chromium.org/11959029 Patch from Sven Panne <svenpanne@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180134 0039d316-1c4b-4281-b951-d872f2087c98
* Make an interface's virtual dtor protected rather than public.eroman@chromium.org2013-02-011-2/+3
| | | | | | | | | This avoid a warning in chromium's clang plugin, since ProxyResolverV8Tracing::Job is refcounted and implements this interface. Review URL: https://chromiumcodereview.appspot.com/12092098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180066 0039d316-1c4b-4281-b951-d872f2087c98
* Improve performance of proxy resolver by tracing DNS dependencies.eroman@chromium.org2013-01-301-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the multi-threaded V8 proxy resolver implementation, with a faster single-threaded one. The single-threaded version uses some magic to avoid blocking on DNS dependencies, so it is able to handle more parallel requests than the multi-threaded one. Design document: https://docs.google.com/a/chromium.org/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJdaBn9rKreAmGOdE/edit This has the benefit of reducing the number of threads that Chrome uses for PAC evaluation, while at the same time speeding up proxy resolving for PAC scripts that do DNS resolving (due to better parallelism). I ran a benchmark to evaluate the effectiveness of this new approach. The benchmark simulates loading the http://www.newyorktimes.com webpage with slow DNS (where each DNS resolve takes 2 seconds), and a maximum DNS resolver parallelism of 10 requests. This webpage resolves the proxy for 221 URLs, across 40 unique hostnames. - Proxy resolving using the old multithreaded code took 24.076 seconds [*] - Proxy resolving using the new code took 8.011 seconds [*] - Without a PAC script, resolving the DNS took 8.003 seconds The new proxy resolving times (8.011s) are much closer to the theoretical best (8.003s)! [*] The PAC script I used for the test was a fairly complex script 20kb (a version of google's corp PAC script modified to always call dnsResolve(host)). I will be adding histograms in a follow-up CL, to measure how often requests need to be restarted, or fall-back to synchronous mode. BUG=119151 Review URL: https://codereview.chromium.org/11885009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179714 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* base::Bind: Convert most of net/http.jhawkins@chromium.org2011-12-201-1/+1
| | | | | | | | | | BUG=none TEST=none R=csilv Review URL: http://codereview.chromium.org/8990001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115220 0039d316-1c4b-4281-b951-d872f2087c98
* base::Bind: Convert net/proxy.jhawkins@chromium.org2011-12-201-2/+2
| | | | | | | | | | BUG=none TEST=none R=csilv Review URL: http://codereview.chromium.org/8985012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115068 0039d316-1c4b-4281-b951-d872f2087c98
* Add new text for indicating we are resolving hosts during proxy resolution.willchan@chromium.org2011-11-081-0/+3
| | | | | | | | | | | | Required adding a new GetLoadStateThreadSafe() virtual method to the ProxyResolver interface. ProxyResolverV8 uses this. BUG=59308 TEST=none Review URL: http://codereview.chromium.org/8373014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108950 0039d316-1c4b-4281-b951-d872f2087c98
* Begin CompletionCallback switchover.willchan@chromium.org2011-10-011-2/+2
| | | | | | | | | | | | | 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
* Rename NET_API to NET_EXPORT, and rename NET_TEST to NET_EXPORT_PRIVATE.darin@chromium.org2011-08-121-2/+2
| | | | | | Review URL: http://codereview.chromium.org/7529043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96560 0039d316-1c4b-4281-b951-d872f2087c98
* Add OVERRIDE throughout net/proxy/*eroman@chromium.org2011-07-221-6/+7
| | | | | | | | In the process I discovered 2 dummy virtual overrides of NetworkDelegate interface. (Interface it was trying to overwrite no longer exists). Review URL: http://codereview.chromium.org/7484010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93664 0039d316-1c4b-4281-b951-d872f2087c98
* net: Add net_api to the proxy code.rvargas@google.com2011-05-191-1/+2
| | | | | | | | BUG=76997 TEST=NONE Review URL: http://codereview.chromium.org/7011055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85974 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* More net/ header/implementation method reordering.erg@google.com2011-01-211-2/+2
| | | | | | | | | | | (Contains some minor de-inlining.) BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6263010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72232 0039d316-1c4b-4281-b951-d872f2087c98
* Almost done deinlining virtual methods.erg@google.com2010-12-161-0/+1
| | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/5841002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69470 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obviously unneeded forward declarations from headers under ↵viettrungluu@chromium.org2010-08-211-4/+1
| | | | | | | | | | | src/{app,base,net}. BUG=none TEST=builds Review URL: http://codereview.chromium.org/3136025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56995 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Reference-count the data used by PAC scripts, so it is shared between threads.eroman@chromium.org2010-07-201-5/+3
| | | | | | | 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
* Add the capability to run multiple proxy PAC scripts in parallel.eroman@chromium.org2010-07-091-0/+1
| | | | | | | | | | | | | Refactors SingleThreadedProxyResolver into MultiThreadedProxyResolver. New threads are created lazily on demand, up to a fixed maximum. Note that this CL does NOT change the policy in Chrome -- it will continue to use a single thread for proxy resolving, but using the new code to do so. BUG=11079 Review URL: http://codereview.chromium.org/2822043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51924 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51877, since SpdyNetworkTransactionTest.CorruptFrameSessionError ↵eroman@chromium.org2010-07-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | started failing after this check-in (but only on vista modules builder). BUG=48588 Original CL description: Add the capability to run multiple proxy PAC scripts in parallel. Refactors SingleThreadedProxyResolver into MultiThreadedProxyResolver. New threads are created lazily on demand, up to a fixed maximum. Note that this CL does NOT change the policy in Chrome -- it will continue to use a single thread for proxy resolving, but using the new code to do so. BUG=11079 Review URL: http://codereview.chromium.org/2822043 TBR=eroman@chromium.org Review URL: http://codereview.chromium.org/2945004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51893 0039d316-1c4b-4281-b951-d872f2087c98
* Add the capability to run multiple proxy PAC scripts in parallel.eroman@chromium.org2010-07-081-0/+1
| | | | | | | | | | | | | Refactors SingleThreadedProxyResolver into MultiThreadedProxyResolver. New threads are created lazily on demand, up to a fixed maximum. Note that this CL does NOT change the policy in Chrome -- it will continue to use a single thread for proxy resolving, but using the new code to do so. BUG=11079 Review URL: http://codereview.chromium.org/2822043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51877 0039d316-1c4b-4281-b951-d872f2087c98
* Optimization: reduce the copying of string data between C++ and javascript ↵eroman@chromium.org2010-07-011-3/+1
| | | | | | | | | | | | | | | 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
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-161-1/+1
| | | | | | | | | | | | | | | | 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
* Add the ability to purge memory to the ProxyResolver.pkasting@chromium.org2009-10-131-0/+1
| | | | | | | | BUG=23400 TEST=none Review URL: http://codereview.chromium.org/272018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28769 0039d316-1c4b-4281-b951-d872f2087c98
* Respect the charset specified in PAC file responses.eroman@chromium.org2009-09-221-1/+1
| | | | | | | | | | | | I have updated the documentation of ProxyResolver and ProxyScriptFetcher to indicate that the response must always be given as UTF8. So ProxyScriptFetcher is responsible for any charset conversions internally. This CL also adds a unit-test to make sure that content-encodings are respected (like gzip). This was not previously broken, but it is a related area (and wasn't being tested.) BUG=http://crbug.com/22310 Review URL: http://codereview.chromium.org/210028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26790 0039d316-1c4b-4281-b951-d872f2087c98
* Add trace points for the "dnsResolve()" and "myIpAddress()" PAC javascript ↵eroman@chromium.org2009-09-101-1/+2
| | | | | | | | | | | | | | bindings. This makes note of the calls in the request's LoadLog. Since the LoadLog is not thread-safe, SingleThreadedProxyResolver creates a private LoadLog for ProxyResolverV8 to write into, and then copies it into the mainLoadLog on completion (on the origin thread). BUG=http://crbug.com/14478 Review URL: http://codereview.chromium.org/193037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25926 0039d316-1c4b-4281-b951-d872f2087c98
* Better match IE's proxy settings.ericroman@google.com2009-08-041-3/+4
| | | | | | | | | | | | | | | | * 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
* Rename ProxyResolverV8::JSBindings --> ProxyResolverJSBindings.eroman@chromium.org2009-08-021-39/+4
| | | | | | | | | (Since it isn't really V8-specific, and could be re-used for impelmentations using a different JS engine). Review URL: http://codereview.chromium.org/159773 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22256 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the concept of threading from ProxyService, and move it into the ↵ericroman@google.com2009-07-261-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | ProxyResolver dependency. ProxyResolver may now complete requests asynchronously, and is defined to handle multiple requests. The code from ProxyService that queued requests onto the single PAC thread has moved into SingleThreadedProxyResolver. This refactor lays the groundwork for: (1) http://crbug.com/11746 -- Run PAC proxy resolving out of process. (Can inject an IPC bridge implementation of ProxyResolver) (2) http://crbug.com/11079 -- Run PAC proxy resolving on multiple threads. (Can implement a MultithreadedProxyResolver type class; still complications around v8 threadsafety though). BUG=http://crbug.com/11746, http://crbug.com/11079 TEST=existing unit-tests. Review URL: http://codereview.chromium.org/149525 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21631 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorings surrounding HostResolver:ericroman@google.com2009-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | (1) Extract HostResolver to an interface. The existing concrete implementation is now named HostResolverImpl. This makes it possible to create mocks with more complex behavior (i.e. choose via rules if response will be sync vs async). (2) Transform HostMapper into HostResolverProc. Conceptually HostResolverProc maps a hostname to a socket address, whereas HostMapper mapped a hostname to another hostname (so you were still at the mercy of the system's host resolver). With HostResolverProc you can specify the exact AddressList, making it possible to run tests requiring IPv6 socketaddrs on systems (like WinXP) that don't actually support it. (3) Add a MockHostResolver implementation of HostResolver. This replaces the [ScopedHostMapper + RuleBasedHostMapper + HostResolver] combo. It is less clunky and a bit more expressive. BUG=http://crbug.com/16452 R=willchan TEST=existing Review URL: http://codereview.chromium.org/149511 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20795 0039d316-1c4b-4281-b951-d872f2087c98
* * Avoid doing concurrent DNS resolves of the same hostname in HostResolver.ericroman@google.com2009-06-121-13/+19
| | | | | | | | | | | | | | | | * Add a 1 minute cache for host resolves. * Refactor HostResolver to handle multiple requests. * Make HostResolver a dependency of URLRequestContext. operate the HostResolver in async mode for proxy resolver (bridging to IO thread). TEST=unittests BUG=13163 Review URL: http://codereview.chromium.org/118100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18236 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* split up proxy_service into several files (one per class).ericroman@google.com2009-03-021-1/+1
| | | | | | Review URL: http://codereview.chromium.org/28278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10739 0039d316-1c4b-4281-b951-d872f2087c98
* Add js bindings layer for ProxyResolverV8 {"alert()", "dnsResolve()", ↵ericroman@google.com2009-03-021-0/+42
| | | | | | | | | | | "myIpAddress" <-- [partial]}. Also adds a utility function to net_util for turning a addrinfo into an IP address string. BUG=2764 Review URL: http://codereview.chromium.org/31009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10730 0039d316-1c4b-4281-b951-d872f2087c98
* Add ProxyResolverV8 class.darin@chromium.org is the original author of ↵ericroman@google.com2009-02-231-0/+56
'proxy_resolver_v8.cc' and 'proxy_resolver_script.h'. Review URL: http://codereview.chromium.org/21391 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10199 0039d316-1c4b-4281-b951-d872f2087c98