Commit 3d7014fa authored by Karandeep Bhatia's avatar Karandeep Bhatia Committed by Commit Bot

URLRequestFileJob: Don't suspend requests when the system suspends.

This CL changes URLRequestFileJob to not suspend file url requests when the
system suspends. There is no reason to suspend requests which don't require
network activity.

This helps solves bugs where extension event listeners are not registered as
the request for extension background scripts are aborted on system suspend.

BUG=898494

Change-Id: I3ce676fc6dc204c8c58d282d5ed0e81f97b5cc2c
Reviewed-on: https://chromium-review.googlesource.com/c/1351730
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611374}
parent 08f0ca3d
......@@ -190,6 +190,11 @@ void URLRequestFileJob::GetResponseInfo(HttpResponseInfo* info) {
info->headers = headers;
}
void URLRequestFileJob::OnSuspend() {
// Unlike URLRequestJob, don't suspend active requests here. Requests for
// file URLs need not be suspended when the system suspends.
}
void URLRequestFileJob::OnOpenComplete(int result) {}
void URLRequestFileJob::OnSeekComplete(int64_t result) {}
......
......@@ -51,6 +51,9 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
};
void GetResponseInfo(HttpResponseInfo* info) override;
// base::PowerObserver:
void OnSuspend() override;
// An interface for subclasses who wish to monitor read operations.
//
// |result| is the net::Error code resulting from attempting to open the file.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment