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

Unified Diff: content/browser/service_worker/service_worker_url_request_job.cc

Issue 832813002: [ServiceWorker] Keep ServiceWorker alive while streaming the response for FetchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | content/browser/service_worker/service_worker_url_request_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_url_request_job.cc
diff --git a/content/browser/service_worker/service_worker_url_request_job.cc b/content/browser/service_worker/service_worker_url_request_job.cc
index 44762fa1bce98e20d99e9da1c616c5d6f41af796..3a2dee5cb93e2c05868e019af17d51e54d031639 100644
--- a/content/browser/service_worker/service_worker_url_request_job.cc
+++ b/content/browser/service_worker/service_worker_url_request_job.cc
@@ -83,6 +83,10 @@ void ServiceWorkerURLRequestJob::Start() {
void ServiceWorkerURLRequestJob::Kill() {
net::URLRequestJob::Kill();
+ if (stream_ || !waiting_stream_url_.is_empty()) {
+ if (ServiceWorkerVersion* active_version = provider_host_->active_version())
michaeln 2015/01/07 21:48:46 couple of things i wonder about? provider_host_ i
horo 2015/01/08 04:04:02 ServiceWorkerURLRequestJob::Kill() must be called
+ active_version->RemoveStreamingURLRequestJob(this);
+ }
if (stream_) {
stream_->RemoveReadObserver(this);
stream_->Abort();
@@ -534,6 +538,8 @@ void ServiceWorkerURLRequestJob::DidDispatchFetchEvent(
// Set up a request for reading the stream.
if (response.stream_url.is_valid()) {
DCHECK(response.blob_uuid.empty());
+ DCHECK(provider_host_->active_version());
+ provider_host_->active_version()->AddStreamingURLRequestJob(this);
kinuko 2015/01/05 08:26:04 Should we just always keep alive the version while
horo 2015/01/05 08:31:32 We don't need to keep alive the version if Service
kinuko 2015/01/05 14:08:21 Ok. I just thought it might be simpler and ok enou
response_url_ = response.url;
service_worker_response_type_ = response.response_type;
CreateResponseHeader(
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698