• Eric Orth's avatar
    Create a notifier class for system DNS config changes · de0c5665
    Eric Orth authored
    Essentially a thread-safe notifier wrapping around DnsConfigService,
    intended (but not yet used) for NetworkChangeNotifier and
    HostResolverManager(s) to listen to a shared object for system DNS
    config changes. In subsequent CLs, this will allow us to divorce
    HostResolverManager from listening to NetworkChangeNotifier and be able
    to apply Chrome-internal config changes on top of the system-only
    changes currently triggerring change notifications.
    
    In non-test, will generally be expected to be broadly shared and leaked
    on shutdown.  Sequence-safe destruction is still implemented (using an
    internal Core class with an OnTaskRunnerDeleter) for any special cases
    and for tests.
    
    Note that some of the internal workings of the new class work similarly
    to base::ObserverListThreadSafe, but it was too difficult to make that
    work with the requirement that we always be able to get an initial
    config once ready, whether read before or after adding observers.
    
    Bug: 971411
    Change-Id: Iac79dba9f74018ae6b9559c27df60174bf4edc93
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1654881Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
    Commit-Queue: Eric Orth <ericorth@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#672087}
    de0c5665
system_dns_config_change_notifier.cc 5.96 KB