Add HostResolverManager::RemoveResolveContextRegistrationIfNeeded
ResolveContext::MustRegisterForNotifications becomes an invariant only after ResolveContext::set_url_request_context is called. HostResolverManager::RemoveResolveContextRegistrationIfNeeded provides a way to work around that. With the introduction of URLRequestContext::BindToNetwork, ResolveContexts may require not to receive for DNS cache invalidations after a change to network or DNS configurations. This is abstracted away through MustRegisterForNotifications. Ideally that function would be an invariant for the entire lifetime of a ResolveContext, unfortunately it is not due to the current ResolveContexts creation procedure: at construction time they are not yet associated to any URLRequestContext, the association is applied as a second step after creation. For this reason MustRegisterForNotifications can initially return a different value (since its implementation depends on ResolveContext:url_request_context) Since HostResolveManager evaluates MustRegisterForNotifications before the association is applied, it can read inconsistent values within HostResolveManager::RegisterResolveContext and HostResolveManager::DeregisterResolveContext. Bug: 1292548 Change-Id: I65ee12c0b6faadba01e211db14428d8aa43ff149 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3498103 Reviewed-by:Adam Rice <ricea@chromium.org> Commit-Queue: Stefano Duo <stefanoduo@google.com> Cr-Commit-Position: refs/heads/main@{#979733}
Loading
Please register or sign in to comment