Oh! CreateNewWidgetInternal is virtual! That's... useful. Avi
On Wed, Mar 25, 2009 at 4:58 PM, Avi Drissman <[email protected]> wrote: > In re to http://codereview.chromium.org/48103/show: > > I like where you went, but this leaves me in a tough spot. I was > implementing them in http://codereview.chromium.org/45040/show and now I'm > a bit stuck. > > RWHV lives inside a view, and self-destructs when it's removed from the > view. Its lifetime is entirely due to the view and while it knows about its > host, it's not actually owned by it (see ShutdownHost()). > > In your new revision, CreateNewWidgetInternal creates a new widget, which > is only parented in a view during the call to InitAsPopup in > ShowCreatedWidgetInternal. Between those two calls the widget lives in some > kind of cache, outside a view. > > During construction of RenderWidgetHostViewMac, I had to split it into two, > the C++ side and the ObjC side. Given the lifetime semantics, I chose to > have the ObjC class have strict ownership of the C++ class. Then the ObjC > class would have view lifetime. WebContentsViewMac honors that; it creates > the RWHVM and immediately embeds it. > > With your new scheme, I'm stuck. Whoever calls CreateNewWidgetInternal will > try to keep the RWHV around, but it can't. Since it wasn't hosted in the > view system, it'll immediately self-destruct. > > I'm not sure of a great way around this. CreateNewWidgetInternal might have > to tell the RWHV that it's going to be embedded (and tell it where) rather > than leaving that to ShowCreatedWidgetInternal... > > Avi > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
