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

Issue 54623007: Make code path for bounds changes getting to renderer less brittle (Closed)

Created:
7 years, 1 month ago by rharrison
Modified:
5 years, 7 months ago
Reviewers:
sadrul, jam, sky
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Make code path for bounds changes getting to renderer less brittle Currently when a move of the browser occurs WebContentsViewAura has an observer for its parent since it does not directly get a notification about the change, since it bounds are relative to the hiearchy and only the top level window's bound change in this case. This allows the class to send its new screen coordinates to the renderer. This is brittle, because it assumes that the parent is the top level window, which is currently true. I am introducing changes to NVHA (https://codereview.chromium.org/48113013/) to enabled fast resize which break this assumption. This CL changes the observer to track all of the ancestors for the window in question instead of just the parent, since any one of them moving could cause the need for an update. This CL also moves the observer class out of being a nested definition into its own class NativeViewScreenBoundsObserver and adds a delegate interface between WCVA and NVSBO to make testing easier. BUG=282463 BUG=312228 TEST=Confirmed that moving the browser window around no longer breaks the positioning of the drop down described in 312228. Ran new tests in content_unittests. <TBD> Confirm the following are fine: browser_tests: PrintPreviewTest.WindowedNPAPIPluginHidden interactive_ui_tests: StarViewTestNoDWM.WindowedNPAPIPluginHidden

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rewrote to track all ancestors of the view's window #

Total comments: 11

Patch Set 3 : Made all requested changes except for adding tests #

Total comments: 1

Patch Set 4 : Moved observer into content/browser/web_contents/aura and added tests #

Total comments: 14

Patch Set 5 : Rebasing and responding to comments #

Total comments: 2

Patch Set 6 : Rebased and merged in changes from jam #

Patch Set 7 : Fixed Win build #

Patch Set 8 : Merged constrained window code into NVSBO #

Patch Set 9 : Fix for compile issue on Windows #

Patch Set 10 : Another fix for the windows builders #

Patch Set 11 : Experimenting with single observer design #

Unified diffs Side-by-side diffs Delta from patch set Stats (+831 lines, -244 lines) Patch
A content/browser/web_contents/aura/constrained_windows_observer.h View 1 2 3 4 5 8 9 10 1 chunk +45 lines, -0 lines 0 comments Download
A content/browser/web_contents/aura/constrained_windows_observer.cc View 1 2 3 4 5 6 8 9 10 1 chunk +197 lines, -0 lines 0 comments Download
A content/browser/web_contents/aura/native_view_screen_bounds_observer.h View 1 2 3 4 8 9 10 1 chunk +66 lines, -0 lines 0 comments Download
A content/browser/web_contents/aura/native_view_screen_bounds_observer.cc View 1 2 3 4 5 8 9 10 1 chunk +134 lines, -0 lines 0 comments Download
A content/browser/web_contents/aura/native_view_screen_bounds_observer_unittest.cc View 1 2 3 4 10 1 chunk +330 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.h View 1 2 3 4 8 9 10 4 chunks +21 lines, -4 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +28 lines, -240 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
rharrison
PTAL
7 years, 1 month ago (2013-10-31 20:04:23 UTC) #1
sadrul
+sky@ for owner opinion https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (right): https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc#newcode688 content/browser/web_contents/web_contents_view_aura.cc:688: SendScreenRects(); As I think about ...
7 years, 1 month ago (2013-10-31 20:27:04 UTC) #2
sky
https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (right): https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc#newcode688 content/browser/web_contents/web_contents_view_aura.cc:688: SendScreenRects(); On 2013/10/31 20:27:05, sadrul wrote: > As I ...
7 years, 1 month ago (2013-10-31 21:55:29 UTC) #3
rharrison
On 2013/10/31 21:55:29, sky wrote: > https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc > File content/browser/web_contents/web_contents_view_aura.cc (right): > > https://codereview.chromium.org/54623007/diff/1/content/browser/web_contents/web_contents_view_aura.cc#newcode688 > ...
7 years, 1 month ago (2013-11-04 14:24:17 UTC) #4
rharrison
Looking at the views code it looks like NeedsNotificationWhenVisibleBoundsChange deals with controlling when Layout is ...
7 years, 1 month ago (2013-11-04 20:47:40 UTC) #5
sky
On Mon, Nov 4, 2013 at 12:47 PM, <rharrison@chromium.org> wrote: > Looking at the views ...
7 years, 1 month ago (2013-11-04 21:30:25 UTC) #6
sky
https://codereview.chromium.org/54623007/diff/290001/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (right): https://codereview.chromium.org/54623007/diff/290001/content/browser/web_contents/web_contents_view_aura.cc#newcode653 content/browser/web_contents/web_contents_view_aura.cc:653: class WebContentsViewAura::WindowObserver Can you move this into its own ...
7 years, 1 month ago (2013-11-04 21:33:23 UTC) #7
sky
https://codereview.chromium.org/54623007/diff/290001/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (right): https://codereview.chromium.org/54623007/diff/290001/content/browser/web_contents/web_contents_view_aura.cc#newcode718 content/browser/web_contents/web_contents_view_aura.cc:718: void AddToObserved(std::set<aura::Window*> windows) { const std::set& https://codereview.chromium.org/54623007/diff/290001/content/browser/web_contents/web_contents_view_aura.cc#newcode729 content/browser/web_contents/web_contents_view_aura.cc:729: void ...
7 years, 1 month ago (2013-11-04 21:34:00 UTC) #8
rharrison
I have made all of the desired changes except for adding new tests. I am ...
7 years, 1 month ago (2013-11-06 19:26:16 UTC) #9
sadrul
https://codereview.chromium.org/54623007/diff/540001/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (right): https://codereview.chromium.org/54623007/diff/540001/content/browser/web_contents/web_contents_view_aura.cc#newcode1203 content/browser/web_contents/web_contents_view_aura.cc:1203: window_observer_.reset(new WebContentsViewAuraWindowObserver(this)); I was thinking of something more like ...
7 years, 1 month ago (2013-11-06 20:24:05 UTC) #10
rharrison
PTAL, refactored code and added tests. sadrul, I kept the delegate interface but moved the ...
7 years, 1 month ago (2013-11-07 22:26:09 UTC) #11
sadrul
https://codereview.chromium.org/54623007/diff/600001/content/browser/web_contents/aura/native_view_screen_bounds_observer.cc File content/browser/web_contents/aura/native_view_screen_bounds_observer.cc (right): https://codereview.chromium.org/54623007/diff/600001/content/browser/web_contents/aura/native_view_screen_bounds_observer.cc#newcode95 content/browser/web_contents/aura/native_view_screen_bounds_observer.cc:95: std::set<aura::Window*> NativeViewScreenBoundsObserver::GenerateAncestors( Call this CollectAllWindowsToRoot (or something like that), ...
7 years, 1 month ago (2013-11-08 02:16:25 UTC) #12
rharrison
Unfortunately https://codereview.chromium.org/53153003 made significant changes to ::WindowObserver, basically merging ::ChildWindowObserver into it. This is going ...
7 years, 1 month ago (2013-11-11 19:41:57 UTC) #13
rharrison
jam, I have moved the NPAPI related parts of ::WindowObserver out into its own class ...
7 years, 1 month ago (2013-11-12 22:16:28 UTC) #14
jam
On 2013/11/12 22:16:28, rharrison wrote: > jam, I have moved the NPAPI related parts of ...
7 years, 1 month ago (2013-11-13 20:47:53 UTC) #15
rharrison
On 2013/11/13 20:47:53, jam wrote: > On 2013/11/12 22:16:28, rharrison wrote: > > jam, I ...
7 years, 1 month ago (2013-11-13 21:05:54 UTC) #16
jam
On 2013/11/13 21:05:54, rharrison wrote: > On 2013/11/13 20:47:53, jam wrote: > > On 2013/11/12 ...
7 years, 1 month ago (2013-11-14 02:26:20 UTC) #17
jam
btw I thought about it more, and I don't feel strongly enough either way. I ...
7 years, 1 month ago (2013-11-14 17:28:20 UTC) #18
jam
one more update: looks like there's one or two bugs related to this code that ...
7 years, 1 month ago (2013-11-14 18:56:12 UTC) #19
rharrison
On 2013/11/14 18:56:12, jam wrote: > one more update: looks like there's one or two ...
7 years, 1 month ago (2013-11-14 19:00:32 UTC) #20
jam
On 2013/11/14 19:00:32, rharrison wrote: > On 2013/11/14 18:56:12, jam wrote: > > one more ...
7 years, 1 month ago (2013-11-15 17:52:36 UTC) #21
rharrison
Sync'd to ToT today and the specific issue that I was attempting to resolve has ...
7 years, 1 month ago (2013-11-18 21:12:11 UTC) #22
rharrison
On 2013/11/18 21:12:11, rharrison wrote: > Sync'd to ToT today and the specific issue that ...
7 years, 1 month ago (2013-11-20 15:43:47 UTC) #23
rharrison
On 2013/11/20 15:43:47, rharrison wrote: > On 2013/11/18 21:12:11, rharrison wrote: > > Sync'd to ...
7 years, 1 month ago (2013-11-20 15:44:00 UTC) #24
rharrison
https://codereview.chromium.org/54623007/diff/850001/content/browser/web_contents/web_contents_view_aura.cc File content/browser/web_contents/web_contents_view_aura.cc (left): https://codereview.chromium.org/54623007/diff/850001/content/browser/web_contents/web_contents_view_aura.cc#oldcode678 content/browser/web_contents/web_contents_view_aura.cc:678: // Constrained windows are added as children of the ...
7 years, 1 month ago (2013-11-20 16:40:54 UTC) #25
rharrison
I have kept the separation between the two observers in this CL because to be ...
7 years, 1 month ago (2013-11-20 21:20:22 UTC) #26
jam
Right now, constrained windows are peers of WebContentsView or children of the root window, depending ...
7 years, 1 month ago (2013-11-21 18:32:30 UTC) #27
rharrison
On 2013/11/21 18:32:30, jam wrote: > Right now, constrained windows are peers of WebContentsView or ...
7 years, 1 month ago (2013-11-21 18:40:52 UTC) #28
rharrison
PTAL, I have merged the two classes. I still have to run the tests to ...
7 years, 1 month ago (2013-11-21 20:20:29 UTC) #29
jam
On 2013/11/21 20:20:29, rharrison wrote: > PTAL, I have merged the two classes. I still ...
7 years, 1 month ago (2013-11-23 01:59:15 UTC) #30
jam
On 2013/11/23 01:59:15, jam wrote: > On 2013/11/21 20:20:29, rharrison wrote: > > PTAL, I ...
7 years, 1 month ago (2013-11-23 01:59:33 UTC) #31
rharrison
On 2013/11/23 01:59:33, jam wrote: > On 2013/11/23 01:59:15, jam wrote: > > On 2013/11/21 ...
7 years ago (2013-11-26 04:52:04 UTC) #32
rharrison
On 2013/11/26 04:52:04, rharrison wrote: > On 2013/11/23 01:59:33, jam wrote: > > On 2013/11/23 ...
7 years ago (2013-11-26 16:58:54 UTC) #33
jam
On 2013/11/26 04:52:04, rharrison wrote: > On 2013/11/23 01:59:33, jam wrote: > > On 2013/11/23 ...
7 years ago (2013-11-27 01:17:57 UTC) #34
rharrison
On 2013/11/27 01:17:57, jam wrote: > On 2013/11/26 04:52:04, rharrison wrote: > > On 2013/11/23 ...
7 years ago (2013-11-27 04:15:34 UTC) #35
jam
On 2013/11/27 04:15:34, rharrison wrote: > On 2013/11/27 01:17:57, jam wrote: > > On 2013/11/26 ...
7 years ago (2013-11-27 17:13:50 UTC) #36
rharrison
On 2013/11/27 17:13:50, jam wrote: > On 2013/11/27 04:15:34, rharrison wrote: > > On 2013/11/27 ...
7 years ago (2013-11-27 17:43:23 UTC) #37
rharrison
I am having a real hard time getting the NPAPI tests to pass. Specifically it ...
7 years ago (2013-11-28 19:57:59 UTC) #38
rharrison
7 years ago (2013-11-29 15:53:17 UTC) #39
Well that experiment was a bit of a bust :-/

I am going to be on leave/vacation for December while I work on my thesis and
for the winter holidays. In the new year I am expecting to be leaving the Chrome
team, so I won't be working on this CL anymore. There are people in WAT that are
going to be taking over the scroll end effect work. I am leaving this CL up for
them to reference, but there will be a new version from one of them in the
future.

Powered by Google App Engine
This is Rietveld 408576698