| Index: net/base/network_change_notifier_linux.cc
|
| diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc
|
| index f77025a33d8904750a0d3e227c59f7086305c09b..dfdea59a006d8de65845ed8e2ffc3e849cb43d54 100644
|
| --- a/net/base/network_change_notifier_linux.cc
|
| +++ b/net/base/network_change_notifier_linux.cc
|
| @@ -12,6 +12,10 @@
|
|
|
| namespace net {
|
|
|
| +namespace {
|
| +NetworkChangeNotifierLinux* g_instance;
|
| +} // namespace
|
| +
|
| class NetworkChangeNotifierLinux::Thread : public base::Thread {
|
| public:
|
| Thread();
|
| @@ -27,6 +31,17 @@ class NetworkChangeNotifierLinux::Thread : public base::Thread {
|
| return &address_tracker_;
|
| }
|
|
|
| + bool AddNetifToIgnore(const std::string& netif_name) {
|
| + return address_tracker_.AddNetifToIgnore(netif_name);
|
| + }
|
| + bool RemoveNetifToIgnore(const std::string& netif_name) {
|
| + return address_tracker_.RemoveNetifToIgnore(netif_name);
|
| + }
|
| +
|
| + std::string GetPrimaryNetif() const {
|
| + return address_tracker_.GetPrimaryNetif();
|
| + };
|
| +
|
| protected:
|
| // base::Thread
|
| void Init() override;
|
| @@ -66,7 +81,12 @@ void NetworkChangeNotifierLinux::Thread::CleanUp() {
|
| }
|
|
|
| NetworkChangeNotifierLinux* NetworkChangeNotifierLinux::Create() {
|
| - return new NetworkChangeNotifierLinux();
|
| + g_instance = new NetworkChangeNotifierLinux();
|
| + return g_instance;
|
| +}
|
| +
|
| +NetworkChangeNotifierLinux* NetworkChangeNotifierLinux::GetInstance() {
|
| + return g_instance;
|
| }
|
|
|
| NetworkChangeNotifierLinux::NetworkChangeNotifierLinux()
|
| @@ -99,11 +119,30 @@ NetworkChangeNotifierLinux::NetworkChangeCalculatorParamsLinux() {
|
| return params;
|
| }
|
|
|
| +scoped_refptr<base::MessageLoopProxy>
|
| +NetworkChangeNotifierLinux::GetMessageLoopProxy() const {
|
| + return notifier_thread_->message_loop_proxy();
|
| +}
|
| +
|
| NetworkChangeNotifier::ConnectionType
|
| NetworkChangeNotifierLinux::GetCurrentConnectionType() const {
|
| return notifier_thread_->GetCurrentConnectionType();
|
| }
|
|
|
| +bool NetworkChangeNotifierLinux::AddNetifToIgnore(
|
| + const std::string& netif_name) {
|
| + return notifier_thread_->AddNetifToIgnore(netif_name);
|
| +}
|
| +
|
| +bool NetworkChangeNotifierLinux::RemoveNetifToIgnore(
|
| + const std::string& netif_name) {
|
| + return notifier_thread_->RemoveNetifToIgnore(netif_name);
|
| +}
|
| +
|
| +std::string NetworkChangeNotifierLinux::GetPrimaryNetif() const {
|
| + return notifier_thread_->GetPrimaryNetif();
|
| +}
|
| +
|
| const internal::AddressTrackerLinux*
|
| NetworkChangeNotifierLinux::GetAddressTrackerInternal() const {
|
| return notifier_thread_->address_tracker();
|
|
|