Add support for detecting metered networks on Windows.
This change adds GetConnectionCost() to the NetworkChangeNotifier class. The structure is modeled after the existing functions of the class. The base class implements a basic best-effort guess that works on platforms that can detect cellular versus non-cellular types, which is essentially the same as how "metered" network checks exist today. This change updates the NetworkChangeNotifierWin class to retrieve the metered network status and register for updates from the OS. It also creates an Observer class similar to the other existing ones to notify other components when it changes. It's important to note that NetworkChangeNotifierWin will only register for updates from the OS once an Observer is connected. If there is no observer connected and someone asks for the current connection cost it will be retrieved from the OS at that time rather than using the cached value. Bug: 1143428 Change-Id: I6f03ae91869087c6ad72a7f5891df158815137d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542047Reviewed-by:Paul Jensen <pauljensen@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Tarun Bansal <tbansal@chromium.org> Commit-Queue: Cliff Smolinsky <cliffsmo@microsoft.com> Cr-Commit-Position: refs/heads/master@{#844383}
Showing
This diff is collapsed.
Please register or sign in to comment