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

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: rethink 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
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..24717f8eb17cf74eaa246323ba54d9189204bab3 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,
@@ -98,7 +98,8 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
void StopIfIdle();
// Sends |message| to the embedded worker running in the child process.
- // It is invalid to call this while the worker is not in RUNNING status.
+ // It is invalid to call this while the worker is not in STARTING or RUNNING
+ // status.
ServiceWorkerStatusCode SendMessage(const IPC::Message& message);
void ResumeAfterDownload();
@@ -162,11 +163,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();
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698