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

Issue 2535093003: Worker: Connect UseCounter to workers and worklets (Closed)

Created:
4 years ago by nhiroki
Modified:
4 years ago
Reviewers:
falken, haraken
CC:
chromium-reviews, shans, rjwright, blink-reviews-animation_chromium.org, shimazu+worker_chromium.org, haraken, kinuko+worker_chromium.org, Raymond Toy, darktears, blink-reviews, horo+watch_chromium.org, falken+watch_chromium.org, hongchan, kinuko+watch, blink-worker-reviews_chromium.org, Eric Willigers
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Worker: Connect UseCounter to workers and worklets This is a preparation CL for UseCounter support on workers and worklets, and does not actually record API use on them yet. This CL introduces new interfaces WorkerOrWorkletGlobalScope::countFeature() and WorkerReportingProxy::countFeature() so that UseCounter can transparently report API use to workers and worklets. After this change, call paths are as follows (TODO comments will be addressed by subsequent CLs): For DedicatedWorkers (Note: UseCounter is already enabled on DedicatedWorkers) - UseCounter::countFeature() - WorkerGlobalScope::countFeature() - InProcessWorkerObjectProxy::countFeature() - (Worker Thread -> Main Thread) - ThreadedMessagingProxyBase::countFeature() - Record API use in a parent document's UseCounter. For SharedWorkers - UseCounter::countFeature() - WorkerGlobalScope::countFeature() - WebSharedWorkerImpl::countFeature() - TODO: Send an IPC message to the browser process and ask each connected document to record API use in its UseCounter. For ServiceWorkers - UseCounter::countFeature() - WorkerGlobalScope::countFeature() - ServiceWorkerGlobalScopeProxy::countFeature() - TODO: Send an IPC message to the browser process and ask each controlled document to record API use in its UseCounter. For MainThreadWorklets - UseCounter::countFeature() - MainThreadWorkletGlobalScope::countFeature() - TODO: A parent document is on the same thread, so just record API use in the document's UseCounter. For ThreadedWorklets - UseCounter::countFeature() - ThreadedWorkletGlobalScope::countFeature() - ThreadedWorkletObjectProxy::countFeature() - TODO: Post a task to report API use to a parent document on the main thread like DedicatedWorkers. BUG=376039, 667357 Committed: https://crrev.com/258056d1132c92efb77d9f93f26d19b33d438039 Cr-Commit-Position: refs/heads/master@{#436490}

Patch Set 1 #

Total comments: 16

Patch Set 2 : rebase #

Patch Set 3 : address comments #

Patch Set 4 : make WorkerOrWorkletGlobalScope::countDeprecation() pure-virtual and add addDeprecationMessage() in… #

Patch Set 5 : add more comments #

Patch Set 6 : add more comments #

Total comments: 5

Patch Set 7 : remove const_cast #

Patch Set 8 : remove 'const' qualifiers #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -62 lines) Patch
M third_party/WebKit/Source/core/dom/ExecutionContext.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/workers/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h View 1 2 chunks +2 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp View 1 2 3 4 5 6 7 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp View 1 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerGlobalScope.h View 1 2 3 4 5 6 7 4 chunks +2 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp View 1 2 3 4 5 6 7 4 chunks +13 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h View 1 2 3 4 5 6 7 3 chunks +21 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp View 1 2 3 4 5 6 1 chunk +35 lines, -0 lines 3 comments Download
M third_party/WebKit/Source/core/workers/WorkerReportingProxy.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebSharedWorkerImpl.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (41 generated)
nhiroki
PTAL, thanks!
4 years ago (2016-11-30 08:46:38 UTC) #27
falken
https://codereview.chromium.org/2535093003/diff/100001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/100001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp#newcode31 third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp:31: // (https://crbug.com/667357) It's hard to understand the TODO at ...
4 years ago (2016-12-02 08:54:49 UTC) #30
nhiroki
Thank you. Updated. https://codereview.chromium.org/2535093003/diff/100001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/100001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp#newcode31 third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp:31: // (https://crbug.com/667357) On 2016/12/02 08:54:49, falken ...
4 years ago (2016-12-05 04:49:01 UTC) #31
nhiroki
falken@: As an offline chat, I made WorkerOrWorkletGlobalScope::countDeprecation() pure-virtual and added addDeprecationMessage() instead. Can you ...
4 years ago (2016-12-05 06:42:54 UTC) #32
falken
Do we have a plan for removing the const_cast? Should UseCounter::count just change now to ...
4 years ago (2016-12-05 07:07:22 UTC) #35
nhiroki
Updated. https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode28 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:28: // TODO(nhiroki): Stop using const_cast. On 2016/12/05 07:07:22, ...
4 years ago (2016-12-05 07:45:38 UTC) #36
falken
lgtm, thanks https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode28 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:28: // TODO(nhiroki): Stop using const_cast. On 2016/12/05 ...
4 years ago (2016-12-05 07:54:34 UTC) #39
nhiroki
https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode28 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:28: // TODO(nhiroki): Stop using const_cast. On 2016/12/05 07:54:34, falken ...
4 years ago (2016-12-05 08:13:31 UTC) #40
nhiroki
https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/200001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode28 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:28: // TODO(nhiroki): Stop using const_cast. On 2016/12/05 08:13:30, nhiroki ...
4 years ago (2016-12-05 08:21:46 UTC) #41
falken
still lgtm
4 years ago (2016-12-05 08:24:00 UTC) #44
nhiroki
+haraken@, can you review changes under core/ and web/? Thanks.
4 years ago (2016-12-05 08:24:37 UTC) #46
haraken
https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode32 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:32: Deprecation::deprecationMessage(feature))); Instead of maintaining m_deprecationWarningBits per worker, can we ...
4 years ago (2016-12-05 11:37:28 UTC) #49
nhiroki
Thank you. Comment reply only. https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode32 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:32: Deprecation::deprecationMessage(feature))); On 2016/12/05 11:37:27, ...
4 years ago (2016-12-06 02:22:04 UTC) #50
haraken
LGTM https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp File third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (right): https://codereview.chromium.org/2535093003/diff/240001/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp#newcode32 third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp:32: Deprecation::deprecationMessage(feature))); On 2016/12/06 02:22:04, nhiroki wrote: > On ...
4 years ago (2016-12-06 02:28:55 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2535093003/240001
4 years ago (2016-12-06 02:30:52 UTC) #53
commit-bot: I haz the power
Committed patchset #8 (id:240001)
4 years ago (2016-12-06 02:39:01 UTC) #56
commit-bot: I haz the power
4 years ago (2016-12-06 02:42:48 UTC) #58
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/258056d1132c92efb77d9f93f26d19b33d438039
Cr-Commit-Position: refs/heads/master@{#436490}

Powered by Google App Engine
This is Rietveld 408576698