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

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: Use holder class for lazy initialization on Android 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
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 3c470a4ae7f0a88939feab514d13d279ecd06732..752c50f68d4b2f9d7f615298bda2e1fd35baadd9 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(UploadDataStream* upload) {
@@ -229,9 +230,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(
« no previous file with comments | « net/url_request/url_request_job.h ('k') | testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698