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

Unified Diff: net/data/proxy_resolver_v8_tracing_unittest/dns.js

Issue 11885009: Improve performance of proxy resolver by tracing DNS dependencies. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: re-upload due to failure last time Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/data/proxy_resolver_v8_tracing_unittest/dns.js
diff --git a/net/data/proxy_resolver_v8_tracing_unittest/dns.js b/net/data/proxy_resolver_v8_tracing_unittest/dns.js
new file mode 100644
index 0000000000000000000000000000000000000000..fbfb74ec5db89402fd0dde96b5ca63085f064412
--- /dev/null
+++ b/net/data/proxy_resolver_v8_tracing_unittest/dns.js
@@ -0,0 +1,31 @@
+var g_iteration = 0;
+
+function FindProxyForURL(url, host) {
+ alert('iteration: ' + g_iteration++);
+
+ var ips = [
+ myIpAddress(),
+ dnsResolve(''),
+ dnsResolveEx('host1'),
+ dnsResolve('host2'),
+ dnsResolve('host3'),
+ myIpAddress(),
+ dnsResolve('host3'),
+ dnsResolveEx('host1'),
+ myIpAddress(),
+ dnsResolve('host2'),
+ dnsResolveEx('host6'),
+ myIpAddressEx(),
+ dnsResolve('host1'),
+ ];
+
+ for (var i = 0; i < ips.length; ++i) {
+ // Stringize everything.
+ ips[i] = '' + ips[i];
+ }
+
+ var proxyHost = ips.join('-');
+ proxyHost = proxyHost.replace(/[^0-9a-zA-Z.-]/g, '_');
+
+ return "PROXY " + proxyHost + ":99";
+}
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698