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

Issue 1139613003: cc: Avoid deadlock with the UI thread and NPAPI in more cases (Closed)

Created:
5 years, 7 months ago by brianderson
Modified:
5 years, 7 months ago
Reviewers:
sunnyps, mithro-old
CC:
boliu, cc-bugs_chromium.org, chromium-reviews, scheduler-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid deadlock with the UI thread and NPAPI in more cases By doing the following: 1) Avoid deferring commits until draw if not drawing soon. 2) Don't send BeginMainFrame if swap throttling will block commit. As a side-effect, some of the changes will also help release the main thread sooner in some cases where we were holding on to it for too long. Additional scheduler deadlock tests added to verify existing and future operation. This should also enable us to more easily avoid unconditionally setting active_tree_needs_first_draw_ to false in SchedulerStateMachine::UpdateStateOnInvalidateOutputSurface in followup patches if we want to. BUG=479671, 477082 Committed: https://crrev.com/2bcaa68bdea4d8dc89641992b7a0b6570d8d4d26 Cr-Commit-Position: refs/heads/master@{#330808}

Patch Set 1 #

Total comments: 19

Patch Set 2 : reformat, rename, and delete - comments and test expectations next #

Patch Set 3 : harden expectation #

Patch Set 4 : rename and reorder tests #

Patch Set 5 : rebase, shorten a test name #

Total comments: 5

Patch Set 6 : get rid of complicated imminent logic #

Total comments: 12

Patch Set 7 : address Sunny's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+299 lines, -14 lines) Patch
M cc/scheduler/scheduler_settings.h View 1 chunk +1 line, -0 lines 0 comments Download
M cc/scheduler/scheduler_settings.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.cc View 1 2 3 4 5 6 5 chunks +40 lines, -10 lines 0 comments Download
M cc/scheduler/scheduler_state_machine_unittest.cc View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M cc/scheduler/scheduler_unittest.cc View 1 2 3 4 5 6 2 chunks +249 lines, -1 line 0 comments Download

Messages

Total messages: 20 (3 generated)
brianderson
Ptal. This is a replacement for https://codereview.chromium.org/1100943003
5 years, 7 months ago (2015-05-13 23:28:47 UTC) #2
sunnyps
Left a few comments. https://codereview.chromium.org/1139613003/diff/1/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc (right): https://codereview.chromium.org/1139613003/diff/1/cc/scheduler/scheduler_state_machine.cc#newcode445 cc/scheduler/scheduler_state_machine.cc:445: // We risk deadlock with ...
5 years, 7 months ago (2015-05-14 00:02:02 UTC) #3
brianderson
I'll harden the test expectations in the next patch set. It was easier to hack ...
5 years, 7 months ago (2015-05-14 01:12:03 UTC) #4
brianderson
Ptal, again. I split out the tests into two that only apply to NPAPI deadlock ...
5 years, 7 months ago (2015-05-18 20:09:41 UTC) #5
sunnyps
On 2015/05/18 20:09:41, brianderson wrote: > Ptal, again. > > I split out the tests ...
5 years, 7 months ago (2015-05-18 22:40:39 UTC) #6
brianderson
On 2015/05/18 at 22:40:39, sunnyps wrote: > On 2015/05/18 20:09:41, brianderson wrote: > > Ptal, ...
5 years, 7 months ago (2015-05-18 22:57:35 UTC) #7
mithro-old
https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc (right): https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc#newcode485 cc/scheduler/scheduler_state_machine.cc:485: // UI thread, which prevents it from sending us ...
5 years, 7 months ago (2015-05-19 01:45:32 UTC) #8
brianderson
On 2015/05/19 at 01:45:32, mithro wrote: > https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc > File cc/scheduler/scheduler_state_machine.cc (right): > > https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc#newcode485 ...
5 years, 7 months ago (2015-05-19 02:00:24 UTC) #9
mithro-old
Maybe it would be worth moving the logic for detecting this into a "BrowserMightBeBlockedOnCommit()" or ...
5 years, 7 months ago (2015-05-19 02:08:01 UTC) #10
sunnyps
nit: commit message should start with "cc: " https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc (right): https://codereview.chromium.org/1139613003/diff/80001/cc/scheduler/scheduler_state_machine.cc#newcode456 cc/scheduler/scheduler_state_machine.cc:456: bool ...
5 years, 7 months ago (2015-05-19 02:36:12 UTC) #11
brianderson
ptal > Maybe it would be worth moving the logic for detecting this into a ...
5 years, 7 months ago (2015-05-19 20:06:24 UTC) #12
sunnyps
On 2015/05/19 20:06:24, brianderson wrote: > ptal > > > Maybe it would be worth ...
5 years, 7 months ago (2015-05-20 19:26:38 UTC) #13
sunnyps
LGTM with nits. https://codereview.chromium.org/1139613003/diff/100001/cc/scheduler/scheduler_state_machine.cc File cc/scheduler/scheduler_state_machine.cc (right): https://codereview.chromium.org/1139613003/diff/100001/cc/scheduler/scheduler_state_machine.cc#newcode413 cc/scheduler/scheduler_state_machine.cc:413: // BeginMainFrame if we were to ...
5 years, 7 months ago (2015-05-20 19:26:51 UTC) #14
brianderson
Comments addressed. > The commit could take some amount of time because of the implicit ...
5 years, 7 months ago (2015-05-20 19:49:47 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1139613003/120001
5 years, 7 months ago (2015-05-20 19:52:33 UTC) #18
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 7 months ago (2015-05-20 21:36:08 UTC) #19
commit-bot: I haz the power
5 years, 7 months ago (2015-05-20 21:36:48 UTC) #20
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/2bcaa68bdea4d8dc89641992b7a0b6570d8d4d26
Cr-Commit-Position: refs/heads/master@{#330808}

Powered by Google App Engine
This is Rietveld 408576698