[net/auth] Plumb NetLog down the HTTP auth stack.
This CL introduces a NetLog event source for HttpAuthController to use.
Followup CLs will start to use this log in place of scattered VLOGs.
The general model for logging in the HTTP authentication stack will be:
* HttpAuthController doesn't have a usable NetLog on construction.
* Each of HttpAuthController's public entry points
(MaybeGenerateAuthToken() and HandleAuthChallenge()) take a
NetLogWithSource parameter identifying the caller. The
HttpAuthController uses it to construct a bound NetLog if one
doesn't already exist for the controller. Upon construction of this
log, the controller logs a HTTP_AUTH_CONTROLLER BEGIN event.
* Upon destruction of HttpAuthController, the controller logs a
HTTP_AUTH_CONTROLLER END event if |net_log_| has a valid source
(i.e. one of the two public entry points were invoked with a
non-null NetLogWithSource).
* All HttpAuthHandlers that the controller constructs are presented
with the controller's log.
Thus, by the end of its life, the |net_log_| for the HttpAuthController
will contain all the events from the first time one of the entry points
were invoked, all the way to the end, including events logged by the
handlers.
If the controller doesn't encounter any authentication challenges during
its lifetime -- which is the case if the controller was constructed just
to check if there's a possibility of there being credentials that can be
used to perform preemptive authentication -- no logging occurs.
The HttpAuthController is stateful in terms of authentication challenge
selection, handler selection, and identity selection. Having all these
events on the same log allows for easy tracking of this state throughout
the lifetime of the controller even if it is shuffled between owners.
Bug: 884313
Doc: https://docs.google.com/document/d/1GgwVfHcPpL_v2EMKN5BJQWJalCUMwlJIGeRZQb1uc40
Change-Id: I3afeb31af76db090e1b65e1d67ae2879b53bbe7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537283
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658441}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .