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

Issue 1955693003: compositor-worker: Keep worker backing thread alive for the lifetime of the compositor thread. (Closed)

Created:
4 years, 7 months ago by flackr
Modified:
4 years, 6 months ago
Reviewers:
haraken, kinuko, sof, nhiroki, yhirano
CC:
blink-reviews, blink-worker-reviews_chromium.org, chromium-reviews, falken, horo+watch_chromium.org, kinuko+worker_chromium.org, nhiroki
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

compositor-worker: Keep worker backing thread alive for the lifetime of the compositor thread. This change is to support creating and holding onto oilpan objects on the compositor thread in https://codereview.chromium.org/1895873006 BUG=430155 TEST=CompositorWorkerThreadTest.* Committed: https://crrev.com/05f2063bff785b913d17727ab5a4c2af206b6ea5 Cr-Commit-Position: refs/heads/master@{#396732}

Patch Set 1 #

Total comments: 14

Patch Set 2 : Expand on comments. #

Total comments: 11

Patch Set 3 : Refactor WorkerBackingThread to isolate Compositor Worker behavior into separate subclass. #

Patch Set 4 : Call attach and detach from BackingThreadHolder. #

Patch Set 5 : Remove unneeded scheduler changes. #

Total comments: 15

Patch Set 6 : Address comments. #

Total comments: 16

Patch Set 7 : Call TerminateExecution manually, check threads, etc. #

Total comments: 5

Patch Set 8 : Address comments. #

Patch Set 9 : Merge with master and only call TerminateExecution if initialization has occurred. #

Patch Set 10 : Use the constructed WorkerBackingThread to post tasks. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -20 lines) Patch
M third_party/WebKit/Source/modules/ModulesInitializer.cpp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +99 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -6 lines 0 comments Download

Messages

Total messages: 61 (14 generated)
flackr
This patch contains the changes to the compositor worker backing thread from https://codereview.chromium.org/1895873006 Please review, ...
4 years, 7 months ago (2016-05-06 18:28:48 UTC) #2
haraken
https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp File third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp (right): https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp#newcode33 third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp:33: thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerBackingThread::initialize, AllowCrossThreadAccess(this))); Would you elaborate on why you ...
4 years, 7 months ago (2016-05-09 02:00:53 UTC) #3
kinuko
Would you be able to give a bit more explanation about what you're trying to ...
4 years, 7 months ago (2016-05-09 12:35:10 UTC) #5
flackr
On 2016/05/09 at 12:35:10, kinuko wrote: > Would you be able to give a bit ...
4 years, 7 months ago (2016-05-10 18:07:27 UTC) #7
flackr
https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp File third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp (right): https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp#newcode33 third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp:33: thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerBackingThread::initialize, AllowCrossThreadAccess(this))); On 2016/05/09 at 02:00:53, haraken wrote: ...
4 years, 7 months ago (2016-05-10 18:07:39 UTC) #8
haraken
I want to have yhirano@ take a look at this. https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/modules/ModulesInitializer.cpp File third_party/WebKit/Source/modules/ModulesInitializer.cpp (right): https://codereview.chromium.org/1955693003/diff/1/third_party/WebKit/Source/modules/ModulesInitializer.cpp#newcode67 ...
4 years, 7 months ago (2016-05-11 00:18:31 UTC) #9
yhirano
This may be a silly question, but isn't it possible to create a CompositorMutator in ...
4 years, 7 months ago (2016-05-11 02:21:02 UTC) #10
flackr
I think a lot of confusion came from the fact that I was trying to ...
4 years, 7 months ago (2016-05-18 05:26:50 UTC) #11
yhirano
I still think > If you truly need initialize / shutdown threads before / after ...
4 years, 7 months ago (2016-05-18 05:32:56 UTC) #12
flackr
> This may be a silly question, but isn't it possible to create a CompositorMutator ...
4 years, 7 months ago (2016-05-18 12:41:35 UTC) #13
yhirano
https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/ModulesInitializer.cpp File third_party/WebKit/Source/modules/ModulesInitializer.cpp (right): https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/ModulesInitializer.cpp#newcode67 third_party/WebKit/Source/modules/ModulesInitializer.cpp:67: CompositorWorkerThread::clearSharedBackingThread(); I think this should be placed after CoreInitializer::shutdown(). ...
4 years, 7 months ago (2016-05-19 05:35:37 UTC) #14
yhirano
4 years, 7 months ago (2016-05-19 05:35:38 UTC) #15
flackr
https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/ModulesInitializer.cpp File third_party/WebKit/Source/modules/ModulesInitializer.cpp (right): https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/ModulesInitializer.cpp#newcode67 third_party/WebKit/Source/modules/ModulesInitializer.cpp:67: CompositorWorkerThread::clearSharedBackingThread(); On 2016/05/19 at 05:35:37, yhirano wrote: > I ...
4 years, 7 months ago (2016-05-19 22:24:16 UTC) #16
haraken
Mostly looks good. https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp File third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp (right): https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp#newcode34 third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp:34: if (!s_holderInstance) On 2016/05/19 22:24:16, flackr ...
4 years, 7 months ago (2016-05-20 00:24:45 UTC) #17
yhirano
Could you modify |workerBackingThread().workerScriptCount() == 1| in WorkerThread.cpp to |workerBackingThread().workerScriptCount() <= 2| (and add some ...
4 years, 7 months ago (2016-05-20 02:24:55 UTC) #18
haraken
https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp File third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp (right): https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp#newcode34 third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp:34: if (!s_holderInstance) On 2016/05/20 02:24:54, yhirano wrote: > On ...
4 years, 7 months ago (2016-05-20 02:35:24 UTC) #19
yhirano
https://codereview.chromium.org/1955693003/diff/100001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp File third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp (right): https://codereview.chromium.org/1955693003/diff/100001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp#newcode72 third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp:72: DCHECK_EQ(0u, m_thread->workerScriptCount()) << "BackingThreadHolder should be the first to ...
4 years, 7 months ago (2016-05-20 03:10:16 UTC) #20
yhirano
+nhiroki@ Talked offline w/haraken@. With this CL compositor workers will not receive TerminateExecution as haraken@ ...
4 years, 7 months ago (2016-05-20 06:00:13 UTC) #22
flackr
Thanks for all the help, please take another look. Thanks. https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp File third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp (right): https://codereview.chromium.org/1955693003/diff/80001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp#newcode34 ...
4 years, 7 months ago (2016-05-20 15:51:18 UTC) #23
haraken
LGTM on my side. Thank for being persistent on this!
4 years, 7 months ago (2016-05-21 03:22:19 UTC) #24
yhirano
As written at #22, TerminteExecution should be called before CoreInitializer::shutdown (specifically WorkerThread::terminateAndWaitForAllWorkers()) because it waits ...
4 years, 7 months ago (2016-05-23 05:35:14 UTC) #25
kinuko
I'm basically deferring this to yhirano, one nit (in addition to TerminateExecution thing) https://codereview.chromium.org/1955693003/diff/120001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp File ...
4 years, 7 months ago (2016-05-23 09:53:55 UTC) #26
yhirano
https://codereview.chromium.org/1955693003/diff/120001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp File third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp (right): https://codereview.chromium.org/1955693003/diff/120001/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp#newcode186 third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp:186: ASSERT_EQ(2u, workerBackingThread->workerScriptCount()); On 2016/05/23 09:53:55, kinuko wrote: > (yhirano: ...
4 years, 7 months ago (2016-05-23 11:18:34 UTC) #27
flackr
Sorry for missing the termination order part of the comment in #22. This is done ...
4 years, 6 months ago (2016-05-25 16:42:52 UTC) #28
yhirano
lgtm, thank you.
4 years, 6 months ago (2016-05-26 02:15:44 UTC) #29
yhirano
> Calling isolate()->IsExecutionTerminating() resulted in a crash I suppose accessing an invalid isolate? Sorry, I ...
4 years, 6 months ago (2016-05-26 03:57:50 UTC) #30
flackr
On 2016/05/26 at 03:57:50, yhirano wrote: > > Calling isolate()->IsExecutionTerminating() resulted in a crash I ...
4 years, 6 months ago (2016-05-26 04:07:58 UTC) #31
flackr
On 2016/05/26 at 03:57:50, yhirano wrote: > > Calling isolate()->IsExecutionTerminating() resulted in a crash I ...
4 years, 6 months ago (2016-05-26 05:01:43 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1955693003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1955693003/160001
4 years, 6 months ago (2016-05-26 14:05:53 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/234427)
4 years, 6 months ago (2016-05-26 15:27:28 UTC) #37
flackr
On 2016/05/26 at 15:27:28, commit-bot wrote: > Try jobs failed on following builders: > mac_chromium_rel_ng ...
4 years, 6 months ago (2016-05-27 02:10:03 UTC) #38
yhirano
On 2016/05/27 02:10:03, flackr wrote: > On 2016/05/26 at 15:27:28, commit-bot wrote: > > Try ...
4 years, 6 months ago (2016-05-27 03:09:16 UTC) #39
flackr
On 2016/05/27 at 03:09:16, yhirano wrote: > On 2016/05/27 02:10:03, flackr wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:10:46 UTC) #40
yhirano
On 2016/05/27 15:10:46, flackr wrote: > On 2016/05/27 at 03:09:16, yhirano wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:22:25 UTC) #41
flackr
On 2016/05/27 at 15:22:25, yhirano wrote: > On 2016/05/27 15:10:46, flackr wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:28:36 UTC) #42
yhirano
On 2016/05/27 15:28:36, flackr wrote: > On 2016/05/27 at 15:22:25, yhirano wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:37:24 UTC) #43
flackr
On 2016/05/27 at 15:37:24, yhirano wrote: > On 2016/05/27 15:28:36, flackr wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:43:48 UTC) #44
yhirano
On 2016/05/27 15:43:48, flackr wrote: > On 2016/05/27 at 15:37:24, yhirano wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:51:22 UTC) #45
flackr
On 2016/05/27 at 15:51:22, yhirano wrote: > On 2016/05/27 15:43:48, flackr wrote: > > On ...
4 years, 6 months ago (2016-05-27 15:52:56 UTC) #46
yhirano
Sorry, I still don't understand. > I was looking into why this works on tip ...
4 years, 6 months ago (2016-05-27 16:18:40 UTC) #47
yhirano
On 2016/05/27 16:18:40, yhirano wrote: > Sorry, I still don't understand. > > > I ...
4 years, 6 months ago (2016-05-30 11:52:49 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1955693003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1955693003/180001
4 years, 6 months ago (2016-05-30 12:00:56 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/78640)
4 years, 6 months ago (2016-05-30 13:59:12 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1955693003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1955693003/180001
4 years, 6 months ago (2016-05-30 14:46:57 UTC) #55
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 6 months ago (2016-05-30 15:39:45 UTC) #57
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/05f2063bff785b913d17727ab5a4c2af206b6ea5 Cr-Commit-Position: refs/heads/master@{#396732}
4 years, 6 months ago (2016-05-30 15:42:29 UTC) #59
sof
4 years, 6 months ago (2016-06-03 06:50:43 UTC) #61
Message was sent while issue was closed.
Seems like there are some lifetime issues with CompositorProxyClientImpl,


https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Win7__dbg...

Powered by Google App Engine
This is Rietveld 408576698