Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "components/prefs/pref_change_registrar.h" | |
| 12 | |
| 13 class PrefRegistrySimple; | |
| 14 class Profile; | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 // NetworkThrottlingObserver is a singleton, owned by | |
| 19 // ChromeBrowserMainPartsChromeos. | |
| 20 // This class is responsible for propagating network bandwidth throttling policy | |
| 21 // changes in Chrome down to shill which implements by calling 'tc' in the | |
|
stevenjb
2016/10/24 17:14:16
s/shill/Shill/
kirtika1
2016/10/27 18:15:42
Done.
| |
| 22 // kernel. It listens to changes to prefs::kNetworkThrottlingEnabled and starts | |
| 23 // a call-chain that leads a shill's kSetNetworkThrottlingFunction dbus method | |
| 24 // being called. | |
|
stevenjb
2016/10/24 17:14:16
The last sentence isn't really necessary, that lev
kirtika1
2016/10/27 18:15:42
Done.
| |
| 25 // Call-flow: NetworkThrottlingObserver | |
| 26 // -> NetworkStateHandler | |
| 27 // -> ShillManagerClient | |
|
stevenjb
2016/10/24 17:14:16
Also not necessary.
kirtika1
2016/10/27 18:15:42
Done.
| |
| 28 class NetworkThrottlingObserver { | |
| 29 public: | |
| 30 NetworkThrottlingObserver(); | |
| 31 ~NetworkThrottlingObserver(); | |
| 32 | |
| 33 static NetworkThrottlingObserver* Get(); | |
| 34 static void RegisterPrefs(PrefRegistrySimple* registry); | |
| 35 | |
| 36 void OnPreferenceChanged(const std::string& pref_name); | |
| 37 | |
| 38 private: | |
| 39 base::WeakPtrFactory<NetworkThrottlingObserver> weak_ptr_factory_; | |
| 40 PrefChangeRegistrar pref_change_registrar_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(NetworkThrottlingObserver); | |
| 43 }; | |
| 44 | |
| 45 } // namespace chromeos | |
| 46 | |
| 47 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_ | |
| OLD | NEW |