Commit 043afc57 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Do not start DnsConfigServiceThread on iOS

DnsConfigService on iOS doesn't watch the config so its result can become
inaccurate at any time.  Disable it to prevent promulgation of inaccurate
DnsConfigs.

https://cs.chromium.org/chromium/src/net/dns/dns_config_service_posix.cc?q=dns_config_service_po&sq=package:chromium&g=0&l=64
shows that this is not implemented on iOS.
Calling the method produces parasite log at startup.

Bug: 852369
Change-Id: I3d24bcb1089fb3c9099b1fffcb829c2a5a2449dc
Reviewed-on: https://chromium-review.googlesource.com/1102317
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarPaul Jensen <pauljensen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567963}
parent 935eeaef
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "net/dns/dns_config_service.h" #include "net/dns/dns_config_service.h"
namespace net { namespace net {
...@@ -47,13 +48,18 @@ NetworkChangeNotifierMac::NetworkChangeNotifierMac() ...@@ -47,13 +48,18 @@ NetworkChangeNotifierMac::NetworkChangeNotifierMac()
connection_type_(CONNECTION_UNKNOWN), connection_type_(CONNECTION_UNKNOWN),
connection_type_initialized_(false), connection_type_initialized_(false),
initial_connection_type_cv_(&connection_type_lock_), initial_connection_type_cv_(&connection_type_lock_),
forwarder_(this), forwarder_(this) {
dns_config_service_thread_(std::make_unique<DnsConfigServiceThread>()) {
// Must be initialized after the rest of this object, as it may call back into // Must be initialized after the rest of this object, as it may call back into
// SetInitialConnectionType(). // SetInitialConnectionType().
config_watcher_ = std::make_unique<NetworkConfigWatcherMac>(&forwarder_); config_watcher_ = std::make_unique<NetworkConfigWatcherMac>(&forwarder_);
#if !defined(OS_IOS)
// DnsConfigService on iOS doesn't watch the config so its result can become
// inaccurate at any time. Disable it to prevent promulgation of inaccurate
// DnsConfigs.
dns_config_service_thread_ = std::make_unique<DnsConfigServiceThread>();
dns_config_service_thread_->StartWithOptions( dns_config_service_thread_->StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
#endif
} }
NetworkChangeNotifierMac::~NetworkChangeNotifierMac() { NetworkChangeNotifierMac::~NetworkChangeNotifierMac() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment