From 52ae80c40de68f97f535d718fbbc086d5698c870 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Thu, 10 Sep 2009 21:27:00 +0000 Subject: Add trace points for the "dnsResolve()" and "myIpAddress()" PAC javascript 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 --- net/data/proxy_resolver_v8_unittest/simple.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 net/data/proxy_resolver_v8_unittest/simple.js (limited to 'net/data') diff --git a/net/data/proxy_resolver_v8_unittest/simple.js b/net/data/proxy_resolver_v8_unittest/simple.js new file mode 100644 index 0000000..c5dfa6d6 --- /dev/null +++ b/net/data/proxy_resolver_v8_unittest/simple.js @@ -0,0 +1,21 @@ +// PAC script which uses isInNet on both IP addresses and hosts, and calls +// isResolvable(). + +function FindProxyForURL(url, host) { + var my_ip = myIpAddress(); + + if (isInNet(my_ip, "172.16.0.0", "255.248.0.0")) { + return "PROXY a:80"; + } + + if (url.substring(0, 6) != "https:" && + isInNet(host, "10.0.0.0", "255.0.0.0")) { + return "PROXY b:80"; + } + + if (dnsDomainIs(host, "foo.bar.baz.com") || !isResolvable(host)) { + return "PROXY c:100"; + } + + return "DIRECT"; +} -- cgit v1.1