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

Unified Diff: net/url_request/url_request_job.cc

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revert using Singleton pattern for PowerMonitor Created 8 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: net/url_request/url_request_job.cc
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index 66fc9f3235687881e53b289889983641fcf9a10a..3bab35db6462043e35e8605efee921f888f553ee 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "base/power_monitor/power_monitor.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "net/base/auth.h"
@@ -34,9 +35,9 @@ URLRequestJob::URLRequestJob(URLRequest* request,
deferred_redirect_status_code_(-1),
network_delegate_(network_delegate),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
- base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
- if (system_monitor)
- base::SystemMonitor::Get()->AddPowerObserver(this);
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ if (power_monitor)
+ power_monitor->AddObserver(this);
}
void URLRequestJob::SetUpload(UploadData* upload) {
@@ -220,9 +221,9 @@ void URLRequestJob::NotifyURLRequestDestroyed() {
}
URLRequestJob::~URLRequestJob() {
- base::SystemMonitor* system_monitor = base::SystemMonitor::Get();
- if (system_monitor)
- base::SystemMonitor::Get()->RemovePowerObserver(this);
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ if (power_monitor)
+ power_monitor->RemoveObserver(this);
}
void URLRequestJob::NotifyCertificateRequested(

Powered by Google App Engine
This is Rietveld 408576698