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

Unified Diff: net/url_request/url_request_job.cc

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fixes Created 6 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 | « net/http/http_network_layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31a0d508e043eb0642936eeade8d7ad900d7407c..13326691f7238ffbc41bb5b0a7bc7cb315ab91fd 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -36,9 +36,7 @@ URLRequestJob::URLRequestJob(URLRequest* request,
deferred_redirect_status_code_(-1),
network_delegate_(network_delegate),
weak_factory_(this) {
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
- power_monitor->AddObserver(this);
+ base::PowerMonitor::AddObserver(this);
}
void URLRequestJob::SetUpload(UploadDataStream* upload) {
@@ -246,11 +244,7 @@ void URLRequestJob::OnSuspend() {
void URLRequestJob::NotifyURLRequestDestroyed() {
}
-URLRequestJob::~URLRequestJob() {
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
- power_monitor->RemoveObserver(this);
-}
+URLRequestJob::~URLRequestJob() { base::PowerMonitor::RemoveObserver(this); }
void URLRequestJob::NotifyCertificateRequested(
SSLCertRequestInfo* cert_request_info) {
« no previous file with comments | « net/http/http_network_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698