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

Unified Diff: chromeos/network/network_change_notifier_chromeos.cc

Issue 12927009: NetworkChangeNotifierChromeos: Invalidate network resources on system resume (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
« no previous file with comments | « chromeos/network/network_change_notifier_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_change_notifier_chromeos.cc
diff --git a/chromeos/network/network_change_notifier_chromeos.cc b/chromeos/network/network_change_notifier_chromeos.cc
index 00fab2d5578aadafef74c793db11a8cb91e8a4c1..2510735562d5b098570b174192672c9fb259553d 100644
--- a/chromeos/network/network_change_notifier_chromeos.cc
+++ b/chromeos/network/network_change_notifier_chromeos.cc
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "base/bind.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_change_notifier_chromeos.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
@@ -55,6 +56,7 @@ NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() {
}
void NetworkChangeNotifierChromeos::Initialize() {
+ DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
NetworkStateHandler::Get()->AddObserver(this);
dns_config_service_.reset(new DnsConfigService());
@@ -69,6 +71,7 @@ void NetworkChangeNotifierChromeos::Shutdown() {
dns_config_service_.reset();
if (NetworkStateHandler::Get())
NetworkStateHandler::Get()->RemoveObserver(this);
+ DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
}
net::NetworkChangeNotifier::ConnectionType
@@ -76,6 +79,13 @@ NetworkChangeNotifierChromeos::GetCurrentConnectionType() const {
return connection_type_;
}
+void NetworkChangeNotifierChromeos::SystemResumed(
+ const base::TimeDelta& sleep_duration) {
+ // Force invalidation of network resources on resume.
+ NetworkChangeNotifier::NotifyObserversOfIPAddressChange();
+}
+
+
void NetworkChangeNotifierChromeos::DefaultNetworkChanged(
const chromeos::NetworkState* default_network) {
bool connection_type_changed = false;
@@ -86,9 +96,9 @@ void NetworkChangeNotifierChromeos::DefaultNetworkChanged(
&ip_address_changed, &dns_changed);
if (connection_type_changed)
- NetworkChangeNotifierChromeos:: NotifyObserversOfConnectionTypeChange();
+ NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange();
if (ip_address_changed)
- NetworkChangeNotifierChromeos::NotifyObserversOfIPAddressChange();
+ NetworkChangeNotifier::NotifyObserversOfIPAddressChange();
if (dns_changed)
dns_config_service_->OnNetworkChange();
}
« no previous file with comments | « chromeos/network/network_change_notifier_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698