New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 780697 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
(OOO slow)
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 775813



Sign in to add a comment

Reparenting Smart Selection Tabs

Project Member Reported by donnd@google.com, Nov 2 2017

Issue description

I think there's a problem when we reparent a Tab with Smart Selection enabled: the UX works but the ContentViewCore is still holding on to the SelectionPopupController that was created for the old activity and (it's holding on to that Context).  I discovered this while manually testing a fix for reparenting CS tabs (issue 775813).  This all seems error-prone.  

I'd like to use this bug to develop a solution that cleanly reparents the SmartSelection instance.  Then I can land a fix and merge it into M-63 to complete the Smart Selection work.

The SmartSelectionClient is created with a WebContents that it watches, and when it's destroyed the native SmartSelectionClient is destroyed.  However it seems that Tab reparenting may allow the CVC and webContents to live even as they are moved from one activity to another.  So I'm thinking that a SelectionClient could have a new destroy() method that detaches it from its WebContents and then calls the destructor.  How does that sound?
 

Comment 1 by boliu@chromium.org, Nov 2 2017

the problem is the old mWindowAndroid, not mContext I think? general solution is to cache WebContents instead, and always ask it for the window, and then context

Comment 2 by donnd@google.com, Nov 3 2017

Status: WontFix (was: Started)
It looks like the ContentViewCore knows about reparenting and swaps out the SelectionPopupController, so my main worry is addressed already.

Sign in to add a comment