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

Issue 1128943003: Move PNaCl process startup back to the main thread. (Closed)

Created:
5 years, 7 months ago by jvoung (off chromium)
Modified:
5 years, 7 months ago
Reviewers:
Derek Schuff
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move PNaCl process startup back to the main thread. Previously it was split between the helper thread and the main thread. Way back in the day it was only the helper thread, but there was concern about thread-safety and part of the process moved to the main thread, straddling two threads. Now we move all the way back to the main thread only. This removes the need to have "WaitFor*Start" in the helper thread. Otherwise the helper thread would post work to the main thread, and wait. That makes it very risky w.r.t. deadlock, since the main thread will join() the helper thread as part of plugin teardown. We had a bunch of workarounds like a timeout when waiting on the condvar. The bad thing about main thread loads is that it blocks the renderer from doing work (like animation) as the nexe loads. However, since we bounce work to the main thread anyway, we block right now without this CL already. In a later CL we can take advantage of the sel_main_chrome load status hook to know when the nexe load is about done, and only then call-back into the plugin when the blocking is minimized. Hook added here: https://codereview.chromium.org/1090233003/diff/100001/components/nacl/common/nacl_renderer_messages.h SRPC client connection is still done on the helper thread. I'm not sure of the requirement, but it will block indefinitely if we do that in the main thread so I left that in the helper thread. There's still a bunch of pnacl_translate_thread mutexes and condvars and the *_subprocess_active flags left in the pnacl_translate_thread. Haven't moved the activeness tracking out so that's left as is. BUG=473474 Committed: https://crrev.com/a26ccdf90ca5f7464df921c72d18ec52d5e27d09 Cr-Commit-Position: refs/heads/master@{#329409}

Patch Set 1 #

Patch Set 2 : Tiny bit of cleanup. #

Patch Set 3 : more checks #

Patch Set 4 : remove unused field #

Total comments: 17

Patch Set 5 : review #

Patch Set 6 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+307 lines, -390 lines) Patch
M components/nacl/renderer/plugin/plugin.h View 1 2 3 4 5 2 chunks +17 lines, -28 lines 0 comments Download
M components/nacl/renderer/plugin/plugin.cc View 1 2 3 4 3 chunks +34 lines, -111 lines 0 comments Download
M components/nacl/renderer/plugin/pnacl_coordinator.h View 1 2 3 4 3 chunks +9 lines, -4 lines 0 comments Download
M components/nacl/renderer/plugin/pnacl_coordinator.cc View 1 2 3 4 3 chunks +88 lines, -10 lines 0 comments Download
M components/nacl/renderer/plugin/pnacl_translate_thread.h View 1 2 3 4 5 chunks +54 lines, -34 lines 0 comments Download
M components/nacl/renderer/plugin/pnacl_translate_thread.cc View 1 2 3 4 5 12 chunks +104 lines, -104 lines 0 comments Download
M components/nacl/renderer/plugin/service_runtime.h View 2 chunks +0 lines, -29 lines 0 comments Download
M components/nacl/renderer/plugin/service_runtime.cc View 1 6 chunks +1 line, -70 lines 0 comments Download

Messages

Total messages: 19 (5 generated)
jvoung (off chromium)
Still a bunch of cleanup to do, but wdyt about moving this to the main ...
5 years, 7 months ago (2015-05-07 00:56:38 UTC) #2
Derek Schuff
On 2015/05/07 00:56:38, jvoung wrote: > Still a bunch of cleanup to do, but wdyt ...
5 years, 7 months ago (2015-05-07 19:51:26 UTC) #3
Derek Schuff
On 2015/05/07 19:51:26, Derek Schuff wrote: > On 2015/05/07 00:56:38, jvoung wrote: > > Still ...
5 years, 7 months ago (2015-05-07 19:52:12 UTC) #4
jvoung (off chromium)
On 2015/05/07 19:51:26, Derek Schuff wrote: > On 2015/05/07 00:56:38, jvoung wrote: > > Still ...
5 years, 7 months ago (2015-05-07 20:09:39 UTC) #5
jvoung (off chromium)
ok did a bit of cleanup -- PTAL
5 years, 7 months ago (2015-05-07 22:52:26 UTC) #6
Derek Schuff
https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/plugin.cc File components/nacl/renderer/plugin/plugin.cc (right): https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/plugin.cc#newcode117 components/nacl/renderer/plugin/plugin.cc:117: // TODO(jvoung): This operations blocks. That's bad because this ...
5 years, 7 months ago (2015-05-08 22:45:59 UTC) #7
jvoung (off chromium)
https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/plugin.cc File components/nacl/renderer/plugin/plugin.cc (right): https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/plugin.cc#newcode117 components/nacl/renderer/plugin/plugin.cc:117: // TODO(jvoung): This operations blocks. That's bad because this ...
5 years, 7 months ago (2015-05-08 23:59:32 UTC) #8
Derek Schuff
lgtm https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/pnacl_translate_thread.cc File components/nacl/renderer/plugin/pnacl_translate_thread.cc (right): https://codereview.chromium.org/1128943003/diff/60001/components/nacl/renderer/plugin/pnacl_translate_thread.cc#newcode150 components/nacl/renderer/plugin/pnacl_translate_thread.cc:150: // Tear down the previous thread. This does ...
5 years, 7 months ago (2015-05-09 00:18:32 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1128943003/80001
5 years, 7 months ago (2015-05-09 04:32:54 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) android_chromium_gn_compile_rel on ...
5 years, 7 months ago (2015-05-09 12:15:40 UTC) #13
jvoung (off chromium)
FYI, rebased after ananta's change landed first: https://codereview.chromium.org/1137833003/ This CL also had removed the CloseFileHandle ...
5 years, 7 months ago (2015-05-12 00:13:10 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1128943003/100001
5 years, 7 months ago (2015-05-12 15:15:40 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 7 months ago (2015-05-12 15:19:40 UTC) #18
commit-bot: I haz the power
5 years, 7 months ago (2015-05-12 15:20:20 UTC) #19
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/a26ccdf90ca5f7464df921c72d18ec52d5e27d09
Cr-Commit-Position: refs/heads/master@{#329409}

Powered by Google App Engine
This is Rietveld 408576698