That should work. If I just override those functions and retain/release the
view through it, we should be fine.

avi

On Wed, Mar 25, 2009 at 5:09 PM, Evan Stade <est...@chromium.org> wrote:

>
> I agree the popup lives in a strange state of limbo before
> InitAsPopup() is called, but this structure seems to be a side effect
> of the messages the renderer sends us. It didn't turn out to be much
> of a problem for linux/win, but if it is for mac then let me know and
> I'll try to help figure something out. (your last comment made it
> sound like you'd just override those functions?)
>
> -- Evan Stade
>
>
>
> On Wed, Mar 25, 2009 at 2:02 PM, Avi Drissman <a...@chromium.org> wrote:
> > Oh! CreateNewWidgetInternal is virtual! That's... useful.
> >
> > Avi
> >
> > On Wed, Mar 25, 2009 at 4:58 PM, Avi Drissman <a...@chromium.org> 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: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to