Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Unified Diff: chrome/browser/chromeos/net/network_throttling_observer.h

Issue 2364703002: Add network throttling as an enterprise policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add network bandwidth throttling as an enterprise policy Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/net/network_throttling_observer.h
diff --git a/chrome/browser/chromeos/net/network_throttling_observer.h b/chrome/browser/chromeos/net/network_throttling_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..48d718a1d490bdbf86146f496471bbd08d614086
--- /dev/null
+++ b/chrome/browser/chromeos/net/network_throttling_observer.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
+#define CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
+
+#include <string>
+
+#include "base/memory/weak_ptr.h"
+#include "components/prefs/pref_change_registrar.h"
+
+class PrefRegistrySimple;
+class Profile;
+
+namespace chromeos {
+
+// NetworkThrottlingObserver is a singleton, owned by
+// ChromeBrowserMainPartsChromeos.
+// This class is responsible for propagating network bandwidth throttling policy
+// 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.
+// kernel. It listens to changes to prefs::kNetworkThrottlingEnabled and starts
+// a call-chain that leads a shill's kSetNetworkThrottlingFunction dbus method
+// 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.
+// Call-flow: NetworkThrottlingObserver
+// -> NetworkStateHandler
+// -> ShillManagerClient
stevenjb 2016/10/24 17:14:16 Also not necessary.
kirtika1 2016/10/27 18:15:42 Done.
+class NetworkThrottlingObserver {
+ public:
+ NetworkThrottlingObserver();
+ ~NetworkThrottlingObserver();
+
+ static NetworkThrottlingObserver* Get();
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
+ void OnPreferenceChanged(const std::string& pref_name);
+
+ private:
+ base::WeakPtrFactory<NetworkThrottlingObserver> weak_ptr_factory_;
+ PrefChangeRegistrar pref_change_registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkThrottlingObserver);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698