|
|
Created:
7 years, 9 months ago by not at google - send to devlin Modified:
7 years, 8 months ago CC:
chromium-reviews, Aaron Boodman, sail+watch_chromium.org, chromium-apps-reviews_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionFix crash in extension_popup_controller.mm appearing when devtools is closed
on an inspected popup.
BUG=196812
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193332
Patch Set 1 #
Total comments: 2
Patch Set 2 : rvh -> render_view_host #Patch Set 3 : add reset back #Messages
Total messages: 26 (0 generated)
lgtm https://codereview.chromium.org/12572006/diff/1/chrome/browser/ui/cocoa/exten... File chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm (right): https://codereview.chromium.org/12572006/diff/1/chrome/browser/ui/cocoa/exten... chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm:125: RenderViewHost* rvh_; nit: don't abbrev member vars
+thakis https://codereview.chromium.org/12572006/diff/1/chrome/browser/ui/cocoa/exten... File chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm (right): https://codereview.chromium.org/12572006/diff/1/chrome/browser/ui/cocoa/exten... chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm:125: RenderViewHost* rvh_; On 2013/03/15 22:55:46, Matt Perry wrote: > nit: don't abbrev member vars Done.
yoz touched this recently I think. yoz, does this make sense for you? Is it possible to write a test for this?
yoz has been out for the day, and his comment about testing still applies I imagine. It's a pretty small crasher though so probably ok to leave until the dev channel build after this?
Should this have a TEST=?
On 2013/03/18 18:45:07, Yoyo Zhou wrote: > Should this have a TEST=? No, but only because I haven't reprod let alone actually run this, I don't have a mac for development. Now that you're back it might be better if you take over this CL, since you do have one.
LGTM. Seems reasonable, but I can't reproduce this.
thakis?
On 2013/03/18 19:29:17, Yoyo Zhou wrote: > LGTM. Seems reasonable, but I can't reproduce this. Actually, the change to -windowWillClose: reintroduces the crash in crbug.com/161604.
> > Actually, the change to -windowWillClose: reintroduces the crash in > crbug.com/161604. Oops. Maybe I meant to move it back out of the branch again. See how this goes...
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kalman@chromium.org/12572006/13001
Presubmit check for 12572006-13001 failed and returned exit status 1. INFO:root:Found 1 file(s). Running presubmit commit checks ... Running /b/commit-queue/workdir/chromium/PRESUBMIT.py Running /b/commit-queue/workdir/chromium/chrome/PRESUBMIT.py ** Presubmit ERRORS ** Missing LGTM from an OWNER for these files: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
thakis: I was able to verify that this fixes the crash reported in crbug.com/224544. (kalman is on vacation.) Could you review this for OWNERS?
yoz: I don't understand this change well. If the extension host can go away, why is it safe to keep a pointer to its render_view_host? (mpcomplete: Maybe you can comment, ExtensionHost has a TODO on you about validity of the rvh) yoz: Neither chrome/browser/ui/views/extensions/extension_popup.cc nor chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc seem to need this. Why is it needed here? On Thu, Mar 28, 2013 at 6:25 PM, <yoz@chromium.org> wrote: > thakis: I was able to verify that this fixes the crash reported in > crbug.com/224544. (kalman is on vacation.) Could you review this for > OWNERS? > > https://codereview.chromium.**org/12572006/<https://codereview.chromium.org/1... >
On 2013/03/29 02:48:29, Nico wrote: > yoz: I don't understand this change well. If the extension host can go > away, why is it safe to keep a pointer to its render_view_host? > (mpcomplete: Maybe you can comment, ExtensionHost has a TODO on you about > validity of the rvh) I think it's the ExtensionPopupController that might go away. This is related to your next question... > yoz: Neither chrome/browser/ui/views/extensions/extension_popup.cc > nor chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc seem to need > this. Why is it needed here? The GTK and Views implementations don't have these extra layer(s) of indirection (the popup itself, which owns the ExtensionHost, listens to the devtools notifications).
On 2013/03/29 05:12:30, Yoyo Zhou wrote: > On 2013/03/29 02:48:29, Nico wrote: > > yoz: I don't understand this change well. If the extension host can go > > away, why is it safe to keep a pointer to its render_view_host? > > (mpcomplete: Maybe you can comment, ExtensionHost has a TODO on you about > > validity of the rvh) > > I think it's the ExtensionPopupController that might go away. This is related to > your next question... > > > yoz: Neither chrome/browser/ui/views/extensions/extension_popup.cc > > nor chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc seem to need > > this. Why is it needed here? > > The GTK and Views implementations don't have these extra layer(s) of indirection > (the popup itself, which owns the ExtensionHost, listens to the devtools > notifications). Right, but as long ownership arrows point in the same direction the extra layer shouldn't matter, right? i.e. if it's popup --owns-> ExtensionHost in views and gtk and it's popup --owns-> controller -->owns->ExtensionHost in cocoa, things should be fine. Are the arrows the wrong way round? In general, I think it's good to keep the code in the various uis as similar as possible.
I think the key here is that the render_view_host_ is not dereferenced. The extension host (and its RVH) might have been deleted, so it's safer to keep a pointer to the RVH since we don't need to dereference it.
On Fri, Mar 29, 2013 at 3:25 PM, <mpcomplete@chromium.org> wrote: > I think the key here is that the render_view_host_ is not dereferenced. The > extension host (and its RVH) might have been deleted, so it's safer to > keep a > pointer to the RVH since we don't need to dereference it. > That's pretty subtle though, and it's not needed on views/gtk. But if you're happy with this patch, I'm happy with it too (with a "do not dereference, might be invalid" comment at the member) > > https://codereview.chromium.**org/12572006/<https://codereview.chromium.org/1... >
> > That's pretty subtle though, and it's not needed on views/gtk. I presume the complexity here is due to the Bridge classes that are necessary in cocoa. > > But if you're happy with this patch, I'm happy with it too (with a "do not > dereference, might be invalid" comment at the member) Such a comment would be misleading; the RVH outlives that bridge, but not necessarily the controller that was holding onto it weakly.
On Mon, Apr 1, 2013 at 8:43 PM, <kalman@chromium.org> wrote: > > That's pretty subtle though, and it's not needed on views/gtk. >> > > I presume the complexity here is due to the Bridge classes that are > necessary in > cocoa. As I said to yoz upthread, I don't see why that's true as long as the ownership arrows point in the same direction. > > > > But if you're happy with this patch, I'm happy with it too (with a "do not >> dereference, might be invalid" comment at the member) >> > > Such a comment would be misleading; the RVH outlives that bridge, but not > necessarily the controller that was holding onto it weakly. > > https://codereview.chromium.**org/12572006/<https://codereview.chromium.org/1... >
> > As I said to yoz upthread, I don't see why that's true as long as the > ownership arrows point in the same direction. > Ok - I went back and read upthread (I've been on vacation) - The extension host can't go away. It's the controller that goes away. This change just hangs onto the deepest node in the tree (the RVH) but we could equally hold onto the extension host like GTK and views do (but, I would also point out that each of these already have divergent logic and structure, and it seems much of a muchness whether I go and change the way this patch is written).
On 2013/04/02 04:36:20, kalman wrote: > > > > As I said to yoz upthread, I don't see why that's true as long as the > > ownership arrows point in the same direction. > > > > Ok - I went back and read upthread (I've been on vacation) - > > The extension host can't go away. It's the controller that goes away. This > change just hangs onto the deepest node in the tree (the RVH) but we could > equally hold onto the extension host like GTK and views do (but, I would also > point out that each of these already have divergent logic and structure, and it > seems much of a muchness whether I go and change the way this patch is written). ping - Matt/Nico?
I'm OK with holding onto either the ExtensionHost or RenderViewHost. LGTM either way.
As said above, this feels wrong to me, but if this lgtmp, it also lgtm. (There's currently no chrome/browser/ui/cocoa/extensions/OWNERS btw. There should be.)
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kalman@chromium.org/12572006/13001
Message was sent while issue was closed.
Change committed as 193332 |