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

Unified Diff: net/url_request/url_request_job.cc

Issue 2447083003: Move fail on suspend logic from URLRequestJob to TcpClientSocket.
Patch Set: . Created 3 years, 6 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/url_request/url_request_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | 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 050ba283f66a808362612c1fa6c00756e8a841a9..60a27399587c904f0e67e8f1a1e6239b371e5b3e 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -12,7 +12,6 @@
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
-#include "base/power_monitor/power_monitor.h"
#include "base/profiler/scoped_tracker.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
@@ -165,15 +164,9 @@ URLRequestJob::URLRequestJob(URLRequest* request,
last_notified_total_received_bytes_(0),
last_notified_total_sent_bytes_(0),
weak_factory_(this) {
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
- power_monitor->AddObserver(this);
}
URLRequestJob::~URLRequestJob() {
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
- power_monitor->RemoveObserver(this);
}
void URLRequestJob::SetUpload(UploadDataStream* upload) {
@@ -343,21 +336,6 @@ HostPortPair URLRequestJob::GetSocketAddress() const {
return HostPortPair();
}
-void URLRequestJob::OnSuspend() {
- // Most errors generated by the Job come as the result of the one current
- // operation the job is waiting on returning an error. This event is unusual
- // in that the Job may have another operation ongoing, or the Job may be idle
- // and waiting on the next call.
- //
- // Need to cancel through the request to make sure everything is notified
- // of the failure (Particularly that the NetworkDelegate, which the Job may be
- // waiting on, is notified synchronously) and torn down correctly.
- //
- // TODO(mmenke): This should probably fail the request with
- // NETWORK_IO_SUSPENDED instead.
- request_->Cancel();
-}
-
void URLRequestJob::NotifyURLRequestDestroyed() {
}
« no previous file with comments | « net/url_request/url_request_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698