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

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

Issue 912753002: Stop Service Workers that execute JavaScript for too long. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix timeout value Created 5 years, 10 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
Index: content/browser/service_worker/embedded_worker_instance.h
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h
index 99849f3fa86960dfb34c4a76be0b55866c3c192d..20acf34ae2eb9a52402ddc03f252c599930f6331 100644
--- a/content/browser/service_worker/embedded_worker_instance.h
+++ b/content/browser/service_worker/embedded_worker_instance.h
@@ -56,6 +56,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
class Listener {
public:
virtual ~Listener() {}
+ virtual void OnScriptLoaded() {}
virtual void OnStarted() {}
virtual void OnStopped(Status old_status) {}
virtual void OnPausedAfterDownload() {}
@@ -77,9 +78,8 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
~EmbeddedWorkerInstance();
// Starts the worker. It is invalid to call this when the worker is not in
- // STOPPED status. |callback| is invoked when the worker's process is created
- // if necessary and the IPC to evaluate the worker's script is sent.
- // Observer::OnStarted() is run when the worker is actually started.
+ // STOPPED status. |callback| is invoked after the worker script has been
+ // started and evaluated, or when an error occurs.
void Start(int64 service_worker_version_id,
const GURL& scope,
const GURL& script_url,
@@ -162,11 +162,12 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
void OnScriptLoadFailed();
// Called back from Registry when the worker instance has ack'ed that
- // it finished evaluating the script.
+ // it finished evaluating the script. This is called before OnStarted.
void OnScriptEvaluated(bool success);
- // Called back from Registry when the worker instance has ack'ed that
- // its WorkerGlobalScope is actually started and parsed.
+ // Called back from Registry when the worker instance has ack'ed that its
+ // WorkerGlobalScope has actually started and evaluated the script. This is
+ // called after OnScriptEvaluated.
// This will change the internal status from STARTING to RUNNING.
void OnStarted();

Powered by Google App Engine
This is Rietveld 408576698