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

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 2114893002: service worker: Clean up fetch event if URLRequest gets cancelled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revise Created 4 years, 5 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 | « content/browser/service_worker/service_worker_url_request_job_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index acb056a5ff89168f1f7991eef9c3b33b6f1198dd..71b3dcd639c753482f27cb43e65ff442bea93f97 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -192,12 +192,18 @@ class CONTENT_EXPORT ServiceWorkerVersion
const StatusCallback& error_callback);
// Call this while the worker is running before dispatching an event to the
- // worker. This informs ServiceWorkerVersion about the event in progress.
- // Returns a request id, which should later be passed to FinishRequest when
- // the event finished.
+ // worker. This informs ServiceWorkerVersion about the event in progress. The
+ // worker attempts to keep running until the event finishes.
+ //
+ // Returns a request id, which must later be passed to FinishRequest when the
+ // event finished. The caller is responsible for ensuring FinishRequest is
+ // called. If FinishRequest is not called the request will eventually time
+ // out and the worker will be forcibly terminated.
+ //
// The |error_callback| is called if either ServiceWorkerVersion decides the
// event is taking too long, or if for some reason the worker stops or is
- // killed before the request finishes.
+ // killed before the request finishes. In this case, the caller should not
+ // call FinishRequest.
int StartRequest(ServiceWorkerMetrics::EventType event_type,
const StatusCallback& error_callback);
@@ -373,6 +379,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
RequestCustomizedTimeoutKill);
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, MixedRequestTimeouts);
FRIEND_TEST_ALL_PREFIXES(ServiceWorkerURLRequestJobTest, EarlyResponse);
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerURLRequestJobTest, CancelRequest);
class Metrics;
class PingController;
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698