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

Issue 3119027: Adds HostResolveImpl Requests and Jobs to log. (Closed)

Created:
10 years, 4 months ago by mmenke
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, dpranke+watch_chromium.org, ben+cc_chromium.org, amit, arv (Not doing code reviews), darin-cc_chromium.org, Paweł Hajdan Jr., pam+watch_chromium.org
Visibility:
Public.

Description

Adds HostResolveImpl Requests and Jobs to log. Differences over the reverted version (http://codereview.chromium.org/3080034/show - reverted http://codereview.chromium.org/3137022/show ): * Jobs never log anything in their destructor, as the HostResolverImpl randomly outlives the NetLog, at least in some unit tests. * Removed the extra log entries for when a DNS lookup starts/completes. Instead, the job's event is ended in OnLookupComplete(). * Slight modification of the CanceledAsynchronousLookup unit test, as the Job is now closed before posting any events to the Request. For actual lookups, this behavior means the Job's duration more accurately reflects the time the DNS lookup takes itself. BUG=46844 TEST=Look at the net-internals screen. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57189

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 5

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+490 lines, -116 lines) Patch
M chrome/browser/io_thread.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/net/connection_tester.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/passive_log_collector.h View 1 2 3 2 chunks +32 lines, -0 lines 0 comments Download
M chrome/browser/net/passive_log_collector.cc View 1 2 3 2 chunks +50 lines, -1 line 0 comments Download
M chrome/browser/resources/net_internals/main.css View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/resources/net_internals/sourceentry.js View 1 2 3 6 chunks +21 lines, -8 lines 0 comments Download
M chrome/service/net/service_url_request_context.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome_frame/test/test_server_test.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M jingle/notifier/listener/mediator_thread_impl.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/base/host_resolver.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M net/base/host_resolver_impl.h View 1 2 3 3 chunks +14 lines, -7 lines 0 comments Download
M net/base/host_resolver_impl.cc View 1 2 3 32 chunks +182 lines, -54 lines 0 comments Download
M net/base/host_resolver_impl_unittest.cc View 1 2 3 11 chunks +41 lines, -14 lines 0 comments Download
M net/base/mock_host_resolver.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/base/net_log.h View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M net/base/net_log.cc View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M net/base/net_log_event_type_list.h View 1 2 3 1 chunk +76 lines, -4 lines 0 comments Download
M net/base/net_log_source_type_list.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M net/base/net_log_unittest.h View 1 2 3 2 chunks +20 lines, -1 line 0 comments Download
M net/proxy/proxy_script_fetcher_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/socket/tcp_client_socket_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/socket/tcp_pinger_unittest.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M net/test/test_server.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/tools/fetch/fetch_client.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/tools/hresolv/hresolv.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_unittest.h View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/test_shell_request_context.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
mmenke
Oops...Meant to publish it after sending it to the trybots.
10 years, 4 months ago (2010-08-20 22:19:05 UTC) #1
eroman
10 years, 4 months ago (2010-08-23 19:01:47 UTC) #2
LGTM

http://codereview.chromium.org/3119027/diff/42001/43011
File net/base/host_resolver_impl.cc (right):

http://codereview.chromium.org/3119027/diff/42001/43011#newcode140
net/base/host_resolver_impl.cc:140: dict->SetString("host",
StringPrintf("%s:%i",
This will not display IPv6 literals properly (as they need to be wrapped in
brackets before appending ":port".).

Ideally RequestInfo should be using a HostPortPair (and that is an open TODO).

For now I suggest doing this:

dict->SetString("host", HostPortPair(info_.hostname(),
info_.port()).ToString());

http://codereview.chromium.org/3119027/diff/42001/43011#newcode145
net/base/host_resolver_impl.cc:145: dict->SetInteger("allow_cached_response",
info_.allow_cached_response());
Use SetBoolean().

http://codereview.chromium.org/3119027/diff/42001/43011#newcode146
net/base/host_resolver_impl.cc:146: dict->SetInteger("is_speculative",
info_.is_speculative());
SetBoolean()

http://codereview.chromium.org/3119027/diff/42001/43012
File net/base/host_resolver_impl.h (right):

http://codereview.chromium.org/3119027/diff/42001/43012#newcode81
net/base/host_resolver_impl.h:81: NetLog* net_log_);
can you mention in the documentation here that |net_log| must remain valid for
the duration of HostResolverImpl's lifetime?

http://codereview.chromium.org/3119027/diff/42001/43016
File net/base/net_log.h (right):

http://codereview.chromium.org/3119027/diff/42001/43016#newcode74
net/base/net_log.h:74: Value* ToValue() const;
nit: could you mention here that owner is responsible for deleting the return
value?

Powered by Google App Engine
This is Rietveld 408576698