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

Issue 12223106: Properly Remove Autofill Keyboard Listener. (Closed)

Created:
7 years, 10 months ago by csharp
Modified:
7 years, 10 months ago
CC:
chromium-reviews, Raman Kakilate, jam, benquan, dhollowa+watch_chromium.org, ahutter, browser-components-watch_chromium.org, dbeam+watch-autofill_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, Dane Wallinga, dyu1, estade+watch_chromium.org, Albert Bodenhamer
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Properly Remove Autofill Keyboard Listener. Remove the keyboard listener before we implicitly delete the object. Also update the removal code to catch problems like this if they occur again. R=estade@chromium.org BUG=175454 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=182751

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Total comments: 3

Patch Set 3 : Remove inform_delegate_of_of_destruction #

Total comments: 4

Patch Set 4 : Merge Hide and HideInternal #

Patch Set 5 : Fixing broken tests #

Total comments: 5

Patch Set 6 : #

Patch Set 7 : #

Total comments: 4

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -52 lines) Patch
M chrome/browser/autofill/autofill_external_delegate.h View 1 2 3 4 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/autofill/autofill_external_delegate.cc View 1 2 3 4 5 6 7 3 chunks +11 lines, -7 lines 0 comments Download
M chrome/browser/autofill/autofill_external_delegate_browsertest.cc View 1 2 3 4 5 6 7 5 chunks +30 lines, -15 lines 0 comments Download
M chrome/browser/autofill/autofill_external_delegate_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/autofill/autofill_popup_controller_impl.h View 1 2 3 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/ui/autofill/autofill_popup_controller_impl.cc View 1 2 3 5 chunks +14 lines, -21 lines 0 comments Download
M chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
csharp
7 years, 10 months ago (2013-02-12 20:22:23 UTC) #1
csharp
isherman@ for autofill_external_delegate.cc ben@ for render_widiget_host_impl.cc
7 years, 10 months ago (2013-02-12 20:24:53 UTC) #2
Evan Stade
I'm surprised there aren't any tests that cover this (or did they just fail to ...
7 years, 10 months ago (2013-02-12 20:36:06 UTC) #3
csharp
We didn't have any tests that tests this behavior. I'm not sure how easy it ...
7 years, 10 months ago (2013-02-12 20:41:58 UTC) #4
Ilya Sherman
Can we instead get rid of inform_delegate_of_destruction_ from autofill_popup_controller_impl.cc? It doesn't seem like we really ...
7 years, 10 months ago (2013-02-12 20:52:57 UTC) #5
Ilya Sherman
https://codereview.chromium.org/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc#newcode1217 content/browser/renderer_host/render_widget_host_impl.cc:1217: // Ensure that the element in actually in the ...
7 years, 10 months ago (2013-02-12 20:57:57 UTC) #6
csharp
I'm not sure what you mean by removing inform_delegate_of_destruction_ https://chromiumcodereview.appspot.com/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc#newcode1217 content/browser/renderer_host/render_widget_host_impl.cc:1217: ...
7 years, 10 months ago (2013-02-12 21:02:37 UTC) #7
Ilya Sherman
https://chromiumcodereview.appspot.com/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/1/content/browser/renderer_host/render_widget_host_impl.cc#newcode1219 content/browser/renderer_host/render_widget_host_impl.cc:1219: listener) != keyboard_listeners_.end()); On 2013/02/12 21:02:37, csharp wrote: > ...
7 years, 10 months ago (2013-02-12 21:07:43 UTC) #8
csharp
Removed the inform_delegate_of_destruction_ code.
7 years, 10 months ago (2013-02-12 21:13:33 UTC) #9
David Trainor- moved to gerrit
https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc File chrome/browser/autofill/autofill_external_delegate.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc#newcode67 chrome/browser/autofill/autofill_external_delegate.cc:67: controller_->Hide(); Should we just call HideAutofillPopup() here to make ...
7 years, 10 months ago (2013-02-12 21:13:35 UTC) #10
Ilya Sherman
LGTM with nits: https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc File chrome/browser/autofill/autofill_external_delegate.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc#newcode67 chrome/browser/autofill/autofill_external_delegate.cc:67: controller_->Hide(); On 2013/02/12 21:13:36, dtrainor wrote: ...
7 years, 10 months ago (2013-02-12 21:15:24 UTC) #11
csharp
https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc File chrome/browser/autofill/autofill_external_delegate.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/6001/chrome/browser/autofill/autofill_external_delegate.cc#newcode67 chrome/browser/autofill/autofill_external_delegate.cc:67: controller_->Hide(); On 2013/02/12 21:13:36, dtrainor wrote: > Should we ...
7 years, 10 months ago (2013-02-12 21:15:27 UTC) #12
csharp
https://chromiumcodereview.appspot.com/12223106/diff/9001/chrome/browser/autofill/autofill_external_delegate.cc File chrome/browser/autofill/autofill_external_delegate.cc (right): https://chromiumcodereview.appspot.com/12223106/diff/9001/chrome/browser/autofill/autofill_external_delegate.cc#newcode283 chrome/browser/autofill/autofill_external_delegate.cc:283: } On 2013/02/12 21:15:25, Ilya Sherman wrote: > nit: ...
7 years, 10 months ago (2013-02-12 21:21:18 UTC) #13
Evan Stade
lgtm
7 years, 10 months ago (2013-02-12 21:36:32 UTC) #14
csharp
I had to made a few changes to fix some tests that were broken by ...
7 years, 10 months ago (2013-02-13 19:24:30 UTC) #15
Ilya Sherman
https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h File chrome/browser/autofill/autofill_external_delegate.h (right): https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h#newcode191 chrome/browser/autofill/autofill_external_delegate.h:191: content::RenderViewHost* registered_keyboard_listener_with_; If this is only needed for tests, ...
7 years, 10 months ago (2013-02-13 21:58:12 UTC) #16
csharp
https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h File chrome/browser/autofill/autofill_external_delegate.h (right): https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h#newcode191 chrome/browser/autofill/autofill_external_delegate.h:191: content::RenderViewHost* registered_keyboard_listener_with_; On 2013/02/13 21:58:12, Ilya Sherman wrote: > ...
7 years, 10 months ago (2013-02-13 22:16:04 UTC) #17
Ilya Sherman
https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h File chrome/browser/autofill/autofill_external_delegate.h (right): https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h#newcode191 chrome/browser/autofill/autofill_external_delegate.h:191: content::RenderViewHost* registered_keyboard_listener_with_; On 2013/02/13 22:16:04, csharp wrote: > On ...
7 years, 10 months ago (2013-02-14 06:19:18 UTC) #18
csharp
Fixed the test, and went back to the old system. I was doing too many ...
7 years, 10 months ago (2013-02-14 15:44:33 UTC) #19
Ben Goodger (Google)
lgtm
7 years, 10 months ago (2013-02-14 23:18:34 UTC) #20
Ilya Sherman
Charlie, could you take a look and give your advice on how best to approach ...
7 years, 10 months ago (2013-02-15 05:57:54 UTC) #21
csharp
https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h File chrome/browser/autofill/autofill_external_delegate.h (right): https://codereview.chromium.org/12223106/diff/5007/chrome/browser/autofill/autofill_external_delegate.h#newcode191 chrome/browser/autofill/autofill_external_delegate.h:191: content::RenderViewHost* registered_keyboard_listener_with_; On 2013/02/15 05:57:55, Ilya Sherman wrote: > ...
7 years, 10 months ago (2013-02-15 14:52:27 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/csharp@chromium.org/12223106/24010
7 years, 10 months ago (2013-02-15 14:53:03 UTC) #23
commit-bot: I haz the power
Change committed as 182751
7 years, 10 months ago (2013-02-15 17:48:41 UTC) #24
Charlie Reis
On 2013/02/15 05:57:54, Ilya Sherman wrote: > Charlie, could you take a look and give ...
7 years, 10 months ago (2013-02-15 21:23:32 UTC) #25
Ilya Sherman
On 2013/02/15 21:23:32, creis wrote: > On 2013/02/15 05:57:54, Ilya Sherman wrote: > > Charlie, ...
7 years, 10 months ago (2013-02-15 21:54:58 UTC) #26
Charlie Reis
7 years, 10 months ago (2013-02-15 22:01:05 UTC) #27
Message was sent while issue was closed.
On 2013/02/15 21:54:58, Ilya Sherman wrote:
> On 2013/02/15 21:23:32, creis wrote:
> > On 2013/02/15 05:57:54, Ilya Sherman wrote:
> > > Charlie, could you take a look and give your advice on how best to
approach
> > > safely unregistering ourselves as a listener from the correct
> RenderViewHost? 
> > > Is there perhaps a way to guarantee that we'll be notified that a
navigation
> > is
> > > (definitely) about to happen *prior* to the old RenderViewHost being
swapped
> > > out?
> > 
> > Can you explain why it needs to be prior?  The notifications tend to happen
> > right after the swap.  Most earlier navigation events aren't guaranteed to
> > commit (e.g., might be a download).  The earliest we could catch it is when
we
> > tell the current RVH to run its unload handlers, but I don't think there are
> any
> > events generated for that.
> 
> It reduces the amount of bookkeeping we need to do if can get notified prior
to
> the swap.  Our goal is to (1) dismiss the Autofill popup when a navigation
> occurs and (2) unregister the popup controller as a listener when it is being
> dismissed.  If we get notified *before* the swap happens, then we can just
> dismiss the popup, which will then synchronously cause the popup to be removed
> as a listener.  If we get notified *after* the swap happens, we need to
> separately unregister the popup as a listener, and also make a note that it's
> been unregistered, so that we don't try to unregister it again when we dismiss
> the popup (which we'll do immediately after unregistering the listener).
> 
> I guess another option is to unregister ourselves from the old RVH and
register
> with the new one when the swap occurs, even though we know we're going to
> immediately unregister from the new one.  That reduces our bookkeeping, but
> feels pretty roundabout and potentially fragile (in that we could possibly get
> forwarded unexpected and unwanted keyboard events from the new RVH)...

Yeah, I don't think I'd recommend changing your underlying RVH unless you expect
the listener to operate on the new one.  And at least at the moment, I don't
know of a way to get notified just before the swap.

I'm not super familiar with this feature, but is it reasonable for it to go away
if any provisional load starts?  That might be easier.  Otherwise, I'd probably
recommend just doing the extra bookkeeping.

Powered by Google App Engine
This is Rietveld 408576698