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

Issue 2476353002: Fix bug where removed (but not deleted) windows are not reflected in the tree properly (Closed)

Created:
4 years, 1 month ago by Sarmad Hashmi
Modified:
4 years, 1 month ago
Reviewers:
sadrul
CC:
chromium-reviews, kalyank, sadrul, pfeldman, devtools-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix bug where removed (but not deleted) windows are not reflected in the tree properly When there are windows which are removed as children of some parent, and they still exist, OnWindowDestroying is not called because the child window was never destroyed. However, OnWindowTreeChanging is called, if the target has an old_parent, aka the parent it is being removed from. OnWindowTreeChanged is called if the target has a new_parent, aka the parent it is being added to. This CL removes nodes on OnWindowTreeChanging and adds them back in OnWindowTreeChanged if necessary. Since we only want them to trigger once, we check to see in either callback if the window that the callback is being called on is the old_parent or the new_parent. BUG=648701 Committed: https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e Cr-Commit-Position: refs/heads/master@{#431482}

Patch Set 1 #

Patch Set 2 : Fix bug where removed (but not deleted) windows are not reflected in the tree properly #

Patch Set 3 : Add a test for window being actually removed and inserted #

Patch Set 4 : rebase #

Total comments: 6

Patch Set 5 : sadruls comments #

Patch Set 6 : sadruls comments #

Patch Set 7 : Remove old_parent parameter #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -23 lines) Patch
M ash/common/devtools/ash_devtools_dom_agent.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M ash/common/devtools/ash_devtools_dom_agent.cc View 1 2 3 4 5 6 3 chunks +30 lines, -21 lines 0 comments Download
M ash/common/devtools/ash_devtools_unittest.cc View 1 2 3 4 5 2 chunks +25 lines, -0 lines 2 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 35 (25 generated)
Sarmad Hashmi
4 years, 1 month ago (2016-11-07 18:48:17 UTC) #6
sadrul
https://codereview.chromium.org/2476353002/diff/60001/ash/common/devtools/ash_devtools_dom_agent.cc File ash/common/devtools/ash_devtools_dom_agent.cc (right): https://codereview.chromium.org/2476353002/diff/60001/ash/common/devtools/ash_devtools_dom_agent.cc#newcode113 ash/common/devtools/ash_devtools_dom_agent.cc:113: if (window == params.old_parent) Should you check that params.new_parent ...
4 years, 1 month ago (2016-11-09 16:09:26 UTC) #13
Sarmad Hashmi
https://codereview.chromium.org/2476353002/diff/60001/ash/common/devtools/ash_devtools_dom_agent.cc File ash/common/devtools/ash_devtools_dom_agent.cc (right): https://codereview.chromium.org/2476353002/diff/60001/ash/common/devtools/ash_devtools_dom_agent.cc#newcode113 ash/common/devtools/ash_devtools_dom_agent.cc:113: if (window == params.old_parent) On 2016/11/09 16:09:26, sadrul wrote: ...
4 years, 1 month ago (2016-11-09 17:51:30 UTC) #16
sadrul
https://codereview.chromium.org/2476353002/diff/120001/ash/common/devtools/ash_devtools_unittest.cc File ash/common/devtools/ash_devtools_unittest.cc (right): https://codereview.chromium.org/2476353002/diff/120001/ash/common/devtools/ash_devtools_unittest.cc#newcode271 ash/common/devtools/ash_devtools_unittest.cc:271: child_window->GetParent()->RemoveChild(child_window); Why is this necessary?
4 years, 1 month ago (2016-11-10 20:25:24 UTC) #27
Sarmad Hashmi
https://codereview.chromium.org/2476353002/diff/120001/ash/common/devtools/ash_devtools_unittest.cc File ash/common/devtools/ash_devtools_unittest.cc (right): https://codereview.chromium.org/2476353002/diff/120001/ash/common/devtools/ash_devtools_unittest.cc#newcode271 ash/common/devtools/ash_devtools_unittest.cc:271: child_window->GetParent()->RemoveChild(child_window); On 2016/11/10 20:25:24, sadrul wrote: > Why is ...
4 years, 1 month ago (2016-11-10 21:00:34 UTC) #28
sadrul
lgtm
4 years, 1 month ago (2016-11-11 01:47:17 UTC) #29
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/2476353002/120001
4 years, 1 month ago (2016-11-11 02:55:09 UTC) #31
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 1 month ago (2016-11-11 03:25:18 UTC) #32
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e Cr-Commit-Position: refs/heads/master@{#431482}
4 years, 1 month ago (2016-11-11 03:35:58 UTC) #34
hiroshige
4 years, 1 month ago (2016-11-11 11:44:19 UTC) #35
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2498593002/ by hiroshige@chromium.org.

The reason for reverting is: Suspected to cause
SystemTrayTest.NullDefaultViewIsNotRecorded failure.

BUG=664428
.

Powered by Google App Engine
This is Rietveld 408576698