New issue
Advanced search Search tips

Issue 780391 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Add thread check to GetExecutionContext

Project Member Reported by hajimehoshi@chromium.org, Nov 1 2017

Issue description

1. SuspendableObject::GetExecutionContext should be called only from the main thread. Add DCHECK to check that the thread is the main thread.

2. ContextLifecycleObserver::GetExecutionContext should be called only from the thread that creates the ContextLifecycleObserver. Add DCHECK to check the thread is appropriate.

 
Now SuspendableObject is being renamed to PausableObject by me :-)


> 1. SuspendableObject::GetExecutionContext should be called only from the main thread. Add DCHECK to check that the thread is the main thread.

We changed the direction a little bit: We found that ScriptPromiseResolver, that is a PausableObject, is used from not only the main thread but also worker thread. As we want to allow ScriptPromiseResolver to be accessed from any thread, it would be hard to keep the assumption that PausableObject is accessed only from the main thread.

Our current conclusion is to allow PausableObject to be accessed from any thread explicitly, and add DCHECK that the thread where GetExecution is called is same as one at the creation.

Sign in to add a comment