Index: net/http/http_network_layer.cc |
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc |
index 9d6dc041bc5329adac273291da329c6a413f318c..0704de420de32d29349e8e6d50f311387a362db3 100644 |
--- a/net/http/http_network_layer.cc |
+++ b/net/http/http_network_layer.cc |
@@ -25,13 +25,17 @@ |
suspended_(false) { |
DCHECK(session_.get()); |
#if defined(OS_WIN) |
- base::PowerMonitor::AddObserver(this); |
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); |
+ if (power_monitor) |
+ power_monitor->AddObserver(this); |
#endif |
} |
HttpNetworkLayer::~HttpNetworkLayer() { |
#if defined(OS_WIN) |
- base::PowerMonitor::RemoveObserver(this); |
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); |
+ if (power_monitor) |
+ power_monitor->RemoveObserver(this); |
#endif |
} |