New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 646559 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

console not installed in Worklet scope.

Project Member Reported by flackr@chromium.org, Sep 13 2016

Issue description

Version: 55.0.2860.0 (Developer Build) (64-bit)
OS: All

What steps will reproduce the problem?
(1) Load the attached file with --enable-blink-features=GeometryInterfaces,CompositorWorker
(2) Open the console

What is the expected output?
Expect to see 'console message from CompositorWorker'

What do you see instead?
Instead we see that 'console does not exist in scope'. I believe this also is the reason why if you have an error in your CompositorWorker script it will silently fail.

Please use labels and text to provide additional information.

 
test-console.html
638 bytes View Download
Cc: nhiroki@chromium.org hongchan@chromium.org dgozman@chromium.org
+cc/ nhiroki, dgozman, hongchan

Yeah I think this got changed which this (below) method was introduced; and switched all debugging off for CompositorWorkerThread at the time.

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/workers/WorkerThread.h?q=workerthread.h&sq=package:chromium&l=114

We'll need to do some changes to WorkerThreadDebugger to allow multiple contexts per WorkerThread to re-enable this without being too crashy.

We also may want to change devtools for things that can't be debugged because we can't pause that particular thread mid execution. I think that Audio&Animation Worklet both fall into this category?
I.e. are we able to pause the compositor thread to debug an AnimationWorkletGlobalScope?

Not sure.
That check was introduced to fight the crashes. We are not prepared to debug any workers except for dedicated ones.

If you think debugging new types of workers becomes important now (as they mature), we should allocate resources and set appropriate goals. There are a couple of problems to resolve though, like how to pause in compositor worker and prohibit(?) any lifecycle phases; or what happens to other workers on the same thread while paused; etc.
sounds like we should get everyone in a room just before q4 planning to coordinate here.

everyone == AnimWorklet, AudioWorklet, Worker team, Devtools.

I can schedule something for folks end of Sept. if that works for folks.

Comment 4 by flackr@chromium.org, Sep 14 2016

Owner: flackr@chromium.org
Status: Assigned (was: Untriaged)
Cc: yhirano@chromium.org
Components: Blink>Workers
Cc: sadrul@chromium.org yu...@chromium.org
 Issue 486574  has been merged into this issue.
Cc: -nhiroki@chromium.org flackr@chromium.org
Labels: -Pri-3 Pri-2
Owner: nhiroki@chromium.org
Status: Started (was: Assigned)
Summary: console not installed in Worklet scope. (was: console not installed in CompositorWorker scope.)
I'll work on this in 2016Q4.
Blockedon: 662812
Project Member

Comment 10 by bugdroid1@chromium.org, Nov 8 2016

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

commit 55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e
Author: nhiroki <nhiroki@chromium.org>
Date: Tue Nov 08 06:03:00 2016

Worker: Add WorkerOrWorkletGlobalScope::thread() interface

This is a preparation for https://codereview.chromium.org/2456733002/

Before this CL, thread() is provided by WorkerGlobalScope and
ThreadedWorkletGlobalScope. This is not convenient when we handle them as
WorkerOrWorkletGlobalScope, a base class of both the global scopes, and want to
access WorkerThread from that. In the case, we need to cast it to
WorkerGlobalScope or ThreadedWorkletGlobalScope, and then call its thread().

After this CL, we can directly call WorkerOrWorkletGlobalScope::thread().

Note that MainThreadWorkletGlobalScope is also a sub-class of
WorkerOrWorkletGlobalScope, but it's not associated with WorkerThread, so
MainThreadWorkletGlobalScope::thread() always returns nullptr.

BUG= 646559 

Review-Url: https://codereview.chromium.org/2481843003
Cr-Commit-Position: refs/heads/master@{#430532}

[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
[modify] https://crrev.com/55f5c0ef44161653b49a4f2f3a8a0c9fd74ba61e/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.h

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 8 2016

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

commit 46d040e09230a0a04c61fc06d88636b9c3dfb627
Author: nhiroki <nhiroki@chromium.org>
Date: Tue Nov 08 09:45:33 2016

DevTools: Make WorkerThreadDebugger available for Worklets

DevTools is now disabled on Worklets because worker's debugger infrastructure(*)
cannot host multiple worklet execution contexts on a single thread.
(*) Worklet has been implemented on the worker infrastructure.

To support it, this CL does following things:

- This expands 1:1 relationship between WorkerThreadDebugger and WorkerThread to
  1:M relationship. The debugger has a ID-WorkerThread map to manage multiple
  WorkerThreads. WorkerThread is added when worklet context is created and
  removed when the context is destroyed.

- This decouples lifetime of WorkerThreadDebugger from lifetime of worklet
  context. Before this CL, the debugger has the same lifetime of the context.
  This prevents the debugger from hosting multiple contexts. After this CL,
  the debugger has the same lifetime of WorkerBackingThread, and attaches to
  worklet context when it's created.

DesignDoc: https://docs.google.com/document/d/1v0dNB6jWMe7w6OeK-Vlnn-Q4qW7KI4m97LGnMefUx1k/edit

BUG= 646559 

Review-Url: https://codereview.chromium.org/2456733002
Cr-Commit-Position: refs/heads/master@{#430558}

[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/README.txt
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/paint-worklet-console-expected.txt
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/paint-worklet-console.html
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/resources/console-tests.js
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/resources/console-worklet-script.js
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/README.txt
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/animation-worklet-console-expected.txt
[add] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/animation-worklet-console.html
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.h
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/WorkerThread.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/core/workers/WorkerThread.h
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.h
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
[modify] https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 8 2016

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

commit c023fcba8a6c9ca521c4c2a9f8921beaab18604e
Author: xlai <xlai@chromium.org>
Date: Tue Nov 08 16:58:33 2016

Revert of DevTools: Make WorkerThreadDebugger available for Worklets (patchset #8 id:360001 of https://codereview.chromium.org/2456733002/ )

Reason for revert:
The layout test animation-worklet-console.html is failing on WebKit Linux Precise Leak bot:

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Precise%20Leak/builds/1566

Original issue's description:
> DevTools: Make WorkerThreadDebugger available for Worklets
>
> DevTools is now disabled on Worklets because worker's debugger infrastructure(*)
> cannot host multiple worklet execution contexts on a single thread.
> (*) Worklet has been implemented on the worker infrastructure.
>
> To support it, this CL does following things:
>
> - This expands 1:1 relationship between WorkerThreadDebugger and WorkerThread to
>   1:M relationship. The debugger has a ID-WorkerThread map to manage multiple
>   WorkerThreads. WorkerThread is added when worklet context is created and
>   removed when the context is destroyed.
>
> - This decouples lifetime of WorkerThreadDebugger from lifetime of worklet
>   context. Before this CL, the debugger has the same lifetime of the context.
>   This prevents the debugger from hosting multiple contexts. After this CL,
>   the debugger has the same lifetime of WorkerBackingThread, and attaches to
>   worklet context when it's created.
>
> DesignDoc: https://docs.google.com/document/d/1v0dNB6jWMe7w6OeK-Vlnn-Q4qW7KI4m97LGnMefUx1k/edit
>
> BUG= 646559 
>
> Committed: https://crrev.com/46d040e09230a0a04c61fc06d88636b9c3dfb627
> Cr-Commit-Position: refs/heads/master@{#430558}

TBR=dgozman@chromium.org,falken@chromium.org,haraken@chromium.org,nhiroki@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.

NOTREECHECKS=true
NOTRY=true
BUG= 646559 

Review-Url: https://codereview.chromium.org/2485633004
Cr-Commit-Position: refs/heads/master@{#430638}

[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/README.txt
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/paint-worklet-console-expected.txt
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/paint-worklet-console.html
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/resources/console-tests.js
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/http/tests/worklet/chromium/resources/console-worklet-script.js
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/README.txt
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/animation-worklet-console-expected.txt
[delete] https://crrev.com/da6bd89a95fc8c444720f3d76ac67b91dfd70280/third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/chromium/animation-worklet-console.html
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.h
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/WorkerThread.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/core/workers/WorkerThread.h
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.h
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
[modify] https://crrev.com/c023fcba8a6c9ca521c4c2a9f8921beaab18604e/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 10 2016

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

commit 0bdb1f395432064cc19799facf055317a12ec6ce
Author: nhiroki <nhiroki@chromium.org>
Date: Thu Nov 10 06:51:44 2016

[Reland] DevTools: Make WorkerThreadDebugger available for Worklets

Original CL: https://codereview.chromium.org/2456733002/

The original CL was reverted because there was a memory leak. This leak was
fixed by https://codereview.chromium.org/2482393002/

In addition to that, this reland CL changes layout tests added by the original
CL because they depended on leaked Document context. After the leak is fixed,
the context can be destroyed earlier than console messages from Worklets are
printed. New layout tests wait until console messages are printed.

<Original Description>

DevTools is now disabled on Worklets because worker's debugger infrastructure(*)
cannot host multiple worklet execution contexts on a single thread.
(*) Worklet has been implemented on the worker infrastructure.

To support it, this CL does following things:

- This expands 1:1 relationship between WorkerThreadDebugger and WorkerThread to
  1:M relationship. The debugger has a ID-WorkerThread map to manage multiple
  WorkerThreads. WorkerThread is added when worklet context is created and
  removed when the context is destroyed.

- This decouples lifetime of WorkerThreadDebugger from lifetime of worklet
  context. Before this CL, the debugger has the same lifetime of the context.
  This prevents the debugger from hosting multiple contexts. After this CL,
  the debugger has the same lifetime of WorkerBackingThread, and attaches to
  worklet context when it's created.

DesignDoc: https://docs.google.com/document/d/1v0dNB6jWMe7w6OeK-Vlnn-Q4qW7KI4m97LGnMefUx1k/edit

BUG= 646559 

Review-Url: https://codereview.chromium.org/2486463005
Cr-Commit-Position: refs/heads/master@{#431198}

[add] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/inspector/console/console-on-animation-worklet-expected.txt
[add] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/inspector/console/console-on-animation-worklet.html
[add] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/inspector/console/console-on-paint-worklet-expected.txt
[add] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/inspector/console/console-on-paint-worklet.html
[add] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/inspector/console/console-worklet-script.js
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.h
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/WorkerThread.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/core/workers/WorkerThread.h
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.h
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
[modify] https://crrev.com/0bdb1f395432064cc19799facf055317a12ec6ce/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h

Blockedon: 664450
Blockedon: 664453
Blockedon: -664450 -664453 -662812
Labels: M-56
Status: Fixed (was: Started)
DevTools on worklets could still be flaky, but the console support itself was already implemented, so let me close this...

Sign in to add a comment