#include <memory>
#include <string>
#include <unordered_set>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h"
#include "base/strings/string_split.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "net/base/network_change_notifier.h"
#include "net/proxy_resolution/proxy_config.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "net/proxy_resolution/proxy_config_with_annotation.h"
#if BUILDFLAG(IS_LINUX)
#include "net/base/network_change_notifier_linux.h"
#endif
#if BUILDFLAG(IS_APPLE)
#include "base/apple/scoped_nsautorelease_pool.h"
#endif
namespace {
#if BUILDFLAG(IS_LINUX)
const char kIgnoreNetifFlag[] = …;
#endif
const char* ConnectionTypeToString(
net::NetworkChangeNotifier::ConnectionType type) { … }
std::string ProxyConfigToString(const net::ProxyConfig& config) { … }
const char* ConfigAvailabilityToString(
net::ProxyConfigService::ConfigAvailability availability) { … }
class NetWatcher :
public net::NetworkChangeNotifier::IPAddressObserver,
public net::NetworkChangeNotifier::ConnectionTypeObserver,
public net::NetworkChangeNotifier::DNSObserver,
public net::NetworkChangeNotifier::NetworkChangeObserver,
public net::ProxyConfigService::Observer { … };
}
int main(int argc, char* argv[]) { … }