1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/net_export.h"
12 #include "net/base/network_change_notifier.h"
16 class NET_EXPORT_PRIVATE NetworkChangeNotifierLinux
17 : public NetworkChangeNotifier
{
19 // Creates NetworkChangeNotifierLinux with a list of ignored interfaces.
20 // |ignored_interfaces| is the list of interfaces to ignore. An ignored
21 // interface will not trigger IP address or connection type notifications.
22 // NOTE: Only ignore interfaces not used to connect to the internet. Adding
23 // interfaces used to connect to the internet can cause critical network
24 // changed signals to be lost allowing incorrect stale state to persist.
25 explicit NetworkChangeNotifierLinux(
26 const base::hash_set
<std::string
>& ignored_interfaces
);
31 ~NetworkChangeNotifierLinux() override
;
32 static NetworkChangeCalculatorParams
NetworkChangeCalculatorParamsLinux();
34 // NetworkChangeNotifier:
35 ConnectionType
GetCurrentConnectionType() const override
;
37 const internal::AddressTrackerLinux
* GetAddressTrackerInternal()
40 // The thread used to listen for notifications. This relays the notification
41 // to the registered observers without posting back to the thread the object
43 // Also used for DnsConfigService which requires TYPE_IO message loop.
44 scoped_ptr
<Thread
> notifier_thread_
;
46 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux
);
51 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_