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

Issue 564553002: When we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden. (Closed)

Created:
6 years, 3 months ago by ananta
Modified:
6 years, 3 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

When we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden. This occurs in the NativeViewHostAura::NativeViewDetaching code path where we first remove the clipping window which is the intermediate parent of the web contents view. The clipping window is hidden which causes the RWHVA::Hide function to get called which initiates the hiding sequence. Then the web contents view is reparented to the main view which is still visible. Now the RWHVA::Show function is called which initiates the show sequence. Eventually the main view is hidden, which then initiates the hide sequence. Addressed this with the following changes. 1. WebView::AttachWebContents and WebView::DetachWebContents now show and hide the webcontents native view. The WebContents is shown and hidden as before in WebContentsNativeViewAura::OnWindowVisibilityChanged. 2. Removed the WebContentsNativeViewAura::OnWindowParentChanged function. This function was present to show and hide the webcontents if the window was visible. This should not be needed with the change in #1 above. 3. Added a new file webview_unittest.cc. This contains the unittest WebViewUnitTest.TestWebViewAttachDetachWebContents This is run as part of unit_tests.exe. BUG=412989 R=sky Committed: https://crrev.com/99941773a742f62892fc9aad1a1ebfb7cc967164 Cr-Commit-Position: refs/heads/master@{#294962}

Patch Set 1 #

Patch Set 2 : Added unittest #

Patch Set 3 : Fixed RemoveClippingWindowOrder views test #

Total comments: 6

Patch Set 4 : Moved the RemoveClippingWindow call to the end of the NativeViewDetaching function #

Patch Set 5 : Fixed NativeViewHierarchyChanged test #

Patch Set 6 : NULL root window check #

Total comments: 2

Patch Set 7 : Added code to hide the WC in browserview during active tab switch #

Patch Set 8 : Reverted previous changes #

Patch Set 9 : Added code to show and hide the wc view in AttachWebContents and DetachWebContents #

Patch Set 10 : Removed unnecessary include #

Patch Set 11 : Updated DEPS #

Patch Set 12 : Fixed build errors #

Patch Set 13 : Fixed flash fullscreen browser tests #

Total comments: 2

Patch Set 14 : Added comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -15 lines) Patch
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -13 lines 0 comments Download
M ui/views/controls/webview/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/controls/webview/webview.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -0 lines 0 comments Download
M ui/views/controls/webview/webview.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A ui/views/controls/webview/webview_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +163 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (11 generated)
ananta
6 years, 3 months ago (2014-09-10 22:17:23 UTC) #1
sky
How about some test coverage?
6 years, 3 months ago (2014-09-10 22:35:39 UTC) #2
ananta
On 2014/09/10 22:35:39, sky wrote: > How about some test coverage? Added a views unittest ...
6 years, 3 months ago (2014-09-11 02:27:47 UTC) #3
sky
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc File ui/views/controls/native/native_view_host_aura_unittest.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc#newcode89 ui/views/controls/native/native_view_host_aura_unittest.cc:89: virtual void OnWindowParentChanged(aura::Window* window, Can't you at events_, since ...
6 years, 3 months ago (2014-09-11 14:55:05 UTC) #4
ananta
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc File ui/views/controls/native/native_view_host_aura_unittest.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc#newcode89 ui/views/controls/native/native_view_host_aura_unittest.cc:89: virtual void OnWindowParentChanged(aura::Window* window, On 2014/09/11 14:55:05, sky wrote: ...
6 years, 3 months ago (2014-09-11 15:01:56 UTC) #5
sky
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc File ui/views/controls/native/native_view_host_aura_unittest.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc#newcode89 ui/views/controls/native/native_view_host_aura_unittest.cc:89: virtual void OnWindowParentChanged(aura::Window* window, On 2014/09/11 15:01:56, ananta wrote: ...
6 years, 3 months ago (2014-09-11 15:29:20 UTC) #6
ananta
On 2014/09/11 15:29:20, sky wrote: > https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc > File ui/views/controls/native/native_view_host_aura_unittest.cc (right): > > https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura_unittest.cc#newcode89 > ...
6 years, 3 months ago (2014-09-11 15:48:49 UTC) #7
sky
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc File ui/views/controls/native/native_view_host_aura.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc#newcode101 ui/views/controls/native/native_view_host_aura.cc:101: host_->native_view()->Hide(); Why do we need to hide at all ...
6 years, 3 months ago (2014-09-11 16:03:19 UTC) #8
ananta
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc File ui/views/controls/native/native_view_host_aura.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc#newcode101 ui/views/controls/native/native_view_host_aura.cc:101: host_->native_view()->Hide(); On 2014/09/11 16:03:19, sky wrote: > Why do ...
6 years, 3 months ago (2014-09-11 16:21:07 UTC) #9
sky
https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc File ui/views/controls/native/native_view_host_aura.cc (right): https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc#newcode101 ui/views/controls/native/native_view_host_aura.cc:101: host_->native_view()->Hide(); On 2014/09/11 16:21:07, ananta wrote: > On 2014/09/11 ...
6 years, 3 months ago (2014-09-11 16:43:36 UTC) #10
ananta
On 2014/09/11 16:43:36, sky wrote: > https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc > File ui/views/controls/native/native_view_host_aura.cc (right): > > https://codereview.chromium.org/564553002/diff/40001/ui/views/controls/native/native_view_host_aura.cc#newcode101 > ...
6 years, 3 months ago (2014-09-11 18:42:34 UTC) #11
sky
LGTM
6 years, 3 months ago (2014-09-11 19:43:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/564553002/80001
6 years, 3 months ago (2014-09-11 23:22:39 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/13496)
6 years, 3 months ago (2014-09-12 01:28:19 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/564553002/80001
6 years, 3 months ago (2014-09-12 02:23:35 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/13530)
6 years, 3 months ago (2014-09-12 03:43:45 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/564553002/80001
6 years, 3 months ago (2014-09-12 06:07:55 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/13573)
6 years, 3 months ago (2014-09-12 07:29:49 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/564553002/80001
6 years, 3 months ago (2014-09-12 12:46:47 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/13631)
6 years, 3 months ago (2014-09-12 14:07:29 UTC) #30
sky
https://codereview.chromium.org/564553002/diff/100001/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/564553002/diff/100001/ui/views/widget/native_widget_aura.cc#newcode1151 ui/views/widget/native_widget_aura.cc:1151: if (root_window) { This makes me nervous. See big ...
6 years, 3 months ago (2014-09-12 21:27:06 UTC) #31
ananta
https://codereview.chromium.org/564553002/diff/100001/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/564553002/diff/100001/ui/views/widget/native_widget_aura.cc#newcode1151 ui/views/widget/native_widget_aura.cc:1151: if (root_window) { On 2014/09/12 21:27:05, sky wrote: > ...
6 years, 3 months ago (2014-09-14 01:30:44 UTC) #32
sky
Did you try running WebContentsViewAuraTest.HideContentOnParenHide and make sure it doesn't break? The interesting case is ...
6 years, 3 months ago (2014-09-15 15:38:35 UTC) #33
ananta
On 2014/09/15 15:38:35, sky wrote: > Did you try running WebContentsViewAuraTest.HideContentOnParenHide and make sure > ...
6 years, 3 months ago (2014-09-15 18:40:03 UTC) #34
sky
https://codereview.chromium.org/564553002/diff/240001/ui/views/controls/webview/webview.cc File ui/views/controls/webview/webview.cc (right): https://codereview.chromium.org/564553002/diff/240001/ui/views/controls/webview/webview.cc#newcode307 ui/views/controls/webview/webview.cc:307: if (!is_embedding_fullscreen_widget_) Why is this code any different when ...
6 years, 3 months ago (2014-09-15 20:40:39 UTC) #35
sky
Also, if no show/hide is the right thing, document why.
6 years, 3 months ago (2014-09-15 20:40:51 UTC) #36
ananta
https://codereview.chromium.org/564553002/diff/240001/ui/views/controls/webview/webview.cc File ui/views/controls/webview/webview.cc (right): https://codereview.chromium.org/564553002/diff/240001/ui/views/controls/webview/webview.cc#newcode307 ui/views/controls/webview/webview.cc:307: if (!is_embedding_fullscreen_widget_) On 2014/09/15 20:40:39, sky wrote: > Why ...
6 years, 3 months ago (2014-09-15 21:21:09 UTC) #37
sky
LGTM
6 years, 3 months ago (2014-09-15 22:26:07 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/564553002/260001
6 years, 3 months ago (2014-09-15 22:55:40 UTC) #40
commit-bot: I haz the power
Committed patchset #14 (id:260001) as a8cc46587b78359f024b3a1e2efbad95afbcb63d
6 years, 3 months ago (2014-09-16 01:31:23 UTC) #41
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/99941773a742f62892fc9aad1a1ebfb7cc967164 Cr-Commit-Position: refs/heads/master@{#294962}
6 years, 3 months ago (2014-09-16 01:33:03 UTC) #42
nhiroki
6 years, 3 months ago (2014-09-16 06:23:46 UTC) #43
Message was sent while issue was closed.
A revert of this CL (patchset #14 id:260001) has been created in
https://codereview.chromium.org/577533003/ by nhiroki@chromium.org.

The reason for reverting is: This seems to cause memory leaks in
WebViewUnitTest.TestWebViewAttachDetachWebContents on Linux(ASan/LSan) and
ChromiumOS(ASan/LSan)

http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Te....

Powered by Google App Engine
This is Rietveld 408576698