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

Unified Diff: net/proxy/proxy_resolver_js_bindings.cc

Issue 9121055: Add a source to V8 proxy resolver-initiated DNS requests, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update year Created 8 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 | « no previous file | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_js_bindings.cc
===================================================================
--- net/proxy/proxy_resolver_js_bindings.cc (revision 118864)
+++ net/proxy/proxy_resolver_js_bindings.cc (working copy)
@@ -262,7 +262,10 @@
}
// Otherwise ask the host resolver.
- int result = host_resolver_->Resolve(info, address_list);
+ const BoundNetLog* net_log = GetNetLogForCurrentRequest();
+ int result = host_resolver_->Resolve(info,
+ address_list,
+ net_log ? *net_log : BoundNetLog());
// Save the result back to the per-request DNS cache.
if (host_cache) {
@@ -274,12 +277,20 @@
return result;
}
+ // May return NULL.
+ const BoundNetLog* GetNetLogForCurrentRequest() {
+ if (!current_request_context())
+ return NULL;
+ return current_request_context()->net_log;
+ }
+
void LogEventToCurrentRequest(
NetLog::EventPhase phase,
NetLog::EventType type,
scoped_refptr<NetLog::EventParameters> params) {
- if (current_request_context() && current_request_context()->net_log)
- current_request_context()->net_log->AddEntry(type, phase, params);
+ const BoundNetLog* net_log = GetNetLogForCurrentRequest();
+ if (net_log)
+ net_log->AddEntry(type, phase, params);
}
void LogEventToCurrentRequestAndGlobally(
« no previous file with comments | « no previous file | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698