New issue
Advanced search Search tips

Issue 777716 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Support ScriptForbiddenScope in workers

Project Member Reported by yhirano@chromium.org, Oct 24 2017

Issue description

Currently ScriptForbiddenScope is working only on the main thread.

 - ScriptForbiddenScope::Enter can be called only on the main thread.
 - ScriptForbiddenScope::Exit can be called only on the main thread.
 - ScriptForbiddenScope::IsScriptForbidden returns false on a non-main thread.

I guess ScriptForbiddenScope methods are not so performance sensitive and we can use a thread local storage instead of a global variable.
 
Components: Blink>Workers
I suspect it can cause issue 756406 and issue 731019.

Comment 2 by kinuko@chromium.org, Oct 24 2017

Description: Show this description
+1 to making ScriptForbiddenScope available on other threads.

Cc: tzik@chromium.org
+1

Also +cc:tzik@.  I think that it could be an option to make ScriptForbiddenScope per-eventloop as tzik@ is going to refactor event loops / task queues.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 24 2017

Status: Fixed (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d8c27e28d9fe88da1c86f4b8b1f284765e43c81

commit 0d8c27e28d9fe88da1c86f4b8b1f284765e43c81
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Fri Oct 27 13:24:16 2017

Add a ScriptForbiddenScope optimization for the main thread use-case

This is a fix for some performance regressions introcued by
https://crrev.com/8419e454a81a7e8a625c43caae69d674530f8298.

This CL decreases the access cost for the counter on the main thread.

Bug:  777716 , 731019, 756406,  778270 
Change-Id: Ida8fd8e722a0cab97d74ca63d9e29f2da755674f
Reviewed-on: https://chromium-review.googlesource.com/741202
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512165}
[modify] https://crrev.com/0d8c27e28d9fe88da1c86f4b8b1f284765e43c81/third_party/WebKit/Source/platform/bindings/ScriptForbiddenScope.cpp
[modify] https://crrev.com/0d8c27e28d9fe88da1c86f4b8b1f284765e43c81/third_party/WebKit/Source/platform/bindings/ScriptForbiddenScope.h

Sign in to add a comment