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

Issue 2773433003: Fix CompositorResizeLock to do something. (Closed)

Created:
3 years, 9 months ago by danakj
Modified:
3 years, 8 months ago
Reviewers:
piman
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, kalyank, danakj+watch_chromium.org, James Su, xjz+watch_chromium.org, miu+watch_chromium.org, ericrk
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix CompositorResizeLock to do something. Currently CompositorResizeLock doesn't work unless deferred since the base class tries to use a virtual method from its constructor which doesn't know about the subclass yet. This fixes that and makes the following changes in the process: I noticed that there are no longer any unit tests that depend on ResizeLock being an interface. So I made CompositorResizeLock the concrete type. I noticed that CompositorResizeLock was in located in files named compositor_resize_lock_aura.{h,cc} but is not named for aura anymore, and is in fact used in non-aura cases for mac. So I renamed the files, and moved the aura pieces out to DelegatedFrameHostClientAura. In order for DelegatedFrameHostClientAura to know when to release events however, it needs to know when the resize lock ends. So I introduced CompositorResizeLockClient, which tells when the lock is over. Importantly, the above is not the same as the CompositorLock ending. That can be done by calling CompositorResizeLock::UnlockCompositor, which does not end the resize lock, but does release the CompositorLock inside it. So this doesn't inform the client at that time until the resize lock actually ends. I've tried to make this more clear with function names and comments. In order to unit test everything I've pulled CompositorLock out of compositor.h and removed the friend relationships between Compositor and CompositorLock. To do so CompositorLock now has 2 interfaces: - CompositorLockClient which it informs about timeouts. This is so that CompositorResizeLock knows when its internal CompositorLock is released by timeout. - CompositorLockDelegate which performs actual unlocking. This is the ui::Compositor outside of tests. Lastly, CompositorResizeLock has a timeout, and CompositorLock has a timeout. These happen to be the same number tho CompositorResizeLock allows you to override it. I've combined these into a single timeout (with the help of CompositorLockClient). And will allow GetCompositorLock to request a specific timeout. With that, Compositor no longer needs SetLocksWillTimeOut which has some action-at-distance properties. This maintains the property that the first to grab a lock chooses the timeout for all other locks grabbed during that time, however Mac code which wants no timeouts now doesn't cause other parts of the system to also get no timeout unless the mac lock is currently active without a timeout. R=piman@chromium.org BUG=704928 NOTRY=true Review-Url: https://codereview.chromium.org/2773433003 Cr-Commit-Position: refs/heads/master@{#460577} Committed: https://chromium.googlesource.com/chromium/src/+/ea89dd544163618531f6892ce94b1b06fd006c14

Patch Set 1 #

Patch Set 2 : resizelock: . #

Patch Set 3 : resizelock: mac #

Patch Set 4 : resizelock: withunittests #

Patch Set 5 : resizelock: nofriend #

Patch Set 6 : resizelock: timeoutparam #

Total comments: 3

Patch Set 7 : resizelock: . #

Patch Set 8 : resizelock: . #

Total comments: 2

Patch Set 9 : resizelock: outlivescompositorandtimeoutbleeding #

Total comments: 2

Patch Set 10 : resizelock: mocktime #

Patch Set 11 : resizelock: exports #

Patch Set 12 : resizelock: unittests-platform #

Patch Set 13 : resizelock: mac-compile #

Patch Set 14 : resizelock: rebase #

Total comments: 1

Patch Set 15 : resizelock: observing #

Patch Set 16 : resizelock: mac-header-windows-export #

Patch Set 17 : resizelock: rebase #

Patch Set 18 : resizelock: observer-rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+765 lines, -384 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +2 lines, -6 lines 0 comments Download
M content/browser/renderer_host/browser_compositor_view_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/browser_compositor_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +8 lines, -8 lines 0 comments Download
A content/browser/renderer_host/compositor_resize_lock.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +65 lines, -0 lines 0 comments Download
A content/browser/renderer_host/compositor_resize_lock.cc View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
M content/browser/renderer_host/compositor_resize_lock_aura.h View 1 2 3 1 chunk +0 lines, -51 lines 0 comments Download
M content/browser/renderer_host/compositor_resize_lock_aura.cc View 1 2 3 1 chunk +0 lines, -67 lines 0 comments Download
A content/browser/renderer_host/compositor_resize_lock_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +133 lines, -0 lines 0 comments Download
M content/browser/renderer_host/delegated_frame_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +6 lines, -5 lines 0 comments Download
M content/browser/renderer_host/delegated_frame_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +8 lines, -5 lines 0 comments Download
M content/browser/renderer_host/delegated_frame_host_client_aura.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +10 lines, -3 lines 0 comments Download
M content/browser/renderer_host/delegated_frame_host_client_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +21 lines, -17 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +11 lines, -21 lines 0 comments Download
M content/browser/renderer_host/resize_lock.h View 1 2 3 1 chunk +0 lines, -37 lines 0 comments Download
M content/browser/renderer_host/resize_lock.cc View 1 2 3 1 chunk +0 lines, -34 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M ui/compositor/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
M ui/compositor/compositor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 10 chunks +25 lines, -53 lines 0 comments Download
M ui/compositor/compositor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +44 lines, -48 lines 0 comments Download
A ui/compositor/compositor_lock.h View 1 2 3 4 5 6 7 8 1 chunk +67 lines, -0 lines 0 comments Download
A ui/compositor/compositor_lock.cc View 1 2 3 4 5 6 7 8 1 chunk +25 lines, -0 lines 0 comments Download
M ui/compositor/compositor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +244 lines, -26 lines 0 comments Download
A ui/compositor/test/fake_compositor_lock.h View 1 2 3 4 5 6 7 8 1 chunk +23 lines, -0 lines 0 comments Download
A ui/compositor/test/fake_compositor_lock.cc View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 94 (72 generated)
danakj
chrome_vox tests fail (via dcheck) because they are causing a commit somehow during a compositorlock. ...
3 years, 9 months ago (2017-03-23 23:05:42 UTC) #23
piman
https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h File ui/compositor/compositor.h (right): https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h#newcode308 ui/compositor/compositor.h:308: CompositorLockClient* client, 2 things. 1- I assume we want ...
3 years, 9 months ago (2017-03-24 04:05:31 UTC) #26
danakj
https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h File ui/compositor/compositor.h (right): https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h#newcode308 ui/compositor/compositor.h:308: CompositorLockClient* client, On 2017/03/24 04:05:31, piman wrote: > 2 ...
3 years, 9 months ago (2017-03-24 14:49:26 UTC) #27
danakj
Back to the chrome_vox thing after lunch. https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h File ui/compositor/compositor.h (right): https://codereview.chromium.org/2773433003/diff/100001/ui/compositor/compositor.h#newcode308 ui/compositor/compositor.h:308: CompositorLockClient* client, ...
3 years, 9 months ago (2017-03-24 16:54:56 UTC) #29
piman
LGTM+nit, there's test failures though (didn't look in details) https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h File ui/compositor/compositor.h (right): https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h#newcode418 ui/compositor/compositor.h:418: ...
3 years, 9 months ago (2017-03-24 18:42:34 UTC) #38
danakj
https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h File ui/compositor/compositor.h (right): https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h#newcode418 ui/compositor/compositor.h:418: base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_; On 2017/03/24 18:42:34, piman wrote: > nit: ...
3 years, 9 months ago (2017-03-24 18:44:33 UTC) #39
piman
On 2017/03/24 18:44:33, danakj wrote: > https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h > File ui/compositor/compositor.h (right): > > https://codereview.chromium.org/2773433003/diff/140001/ui/compositor/compositor.h#newcode418 > ...
3 years, 9 months ago (2017-03-24 18:46:03 UTC) #40
danakj
On Fri, Mar 24, 2017 at 2:46 PM, <piman@chromium.org> wrote: > On 2017/03/24 18:44:33, danakj ...
3 years, 9 months ago (2017-03-24 18:51:07 UTC) #41
danakj
On 2017/03/24 18:51:07, danakj wrote: > On Fri, Mar 24, 2017 at 2:46 PM, <mailto:piman@chromium.org> ...
3 years, 9 months ago (2017-03-24 18:59:06 UTC) #42
danakj
On 2017/03/24 18:59:06, danakj wrote: > On 2017/03/24 18:51:07, danakj wrote: > > On Fri, ...
3 years, 9 months ago (2017-03-24 19:04:07 UTC) #43
danakj
Ok latest patchset fixes the timeout bleeding, and ensures locks can outlive the compositor, with ...
3 years, 9 months ago (2017-03-24 19:29:26 UTC) #45
piman
LGTM, but I worry about 1 possible race/flaky test https://codereview.chromium.org/2773433003/diff/160001/ui/compositor/compositor_unittest.cc File ui/compositor/compositor_unittest.cc (right): https://codereview.chromium.org/2773433003/diff/160001/ui/compositor/compositor_unittest.cc#newcode219 ui/compositor/compositor_unittest.cc:219: ...
3 years, 9 months ago (2017-03-24 19:57:45 UTC) #49
danakj
https://codereview.chromium.org/2773433003/diff/160001/ui/compositor/compositor_unittest.cc File ui/compositor/compositor_unittest.cc (right): https://codereview.chromium.org/2773433003/diff/160001/ui/compositor/compositor_unittest.cc#newcode219 ui/compositor/compositor_unittest.cc:219: task_runner()->PostDelayedTask(FROM_HERE, run_loop.QuitClosure(), timeout1); On 2017/03/24 19:57:45, piman wrote: > ...
3 years, 9 months ago (2017-03-24 20:04:48 UTC) #50
danakj
I have made mock time for all compositor_unittests.cc except one where it needs a real ...
3 years, 9 months ago (2017-03-24 21:39:24 UTC) #51
piman
thank you!! LGTM.
3 years, 9 months ago (2017-03-24 21:54:28 UTC) #54
danakj
https://codereview.chromium.org/2773433003/diff/260001/ui/compositor/compositor.cc File ui/compositor/compositor.cc (right): https://codereview.chromium.org/2773433003/diff/260001/ui/compositor/compositor.cc#newcode556 ui/compositor/compositor.cc:556: active_locks_.push_back(lock.get()); Oh, this change makes OnCompositingLockStateChanged fire before IsLocked() ...
3 years, 8 months ago (2017-03-28 23:16:13 UTC) #65
piman
lgtm
3 years, 8 months ago (2017-03-29 00:08:06 UTC) #70
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/2773433003/320001
3 years, 8 months ago (2017-03-29 20:01:42 UTC) #77
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_ng/builds/265944) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 8 months ago (2017-03-29 20:23:53 UTC) #79
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/2773433003/340001
3 years, 8 months ago (2017-03-29 20:42:21 UTC) #85
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/2773433003/340001
3 years, 8 months ago (2017-03-29 23:21:47 UTC) #91
commit-bot: I haz the power
3 years, 8 months ago (2017-03-29 23:31:45 UTC) #94
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/ea89dd544163618531f6892ce94b...

Powered by Google App Engine
This is Rietveld 408576698