Closed Bug 683099 Opened 8 years ago Closed 8 years ago

NS_NATIVE_WINDOW value should not be used as IPC shareable

Categories

(Core :: Widget, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(3 files, 1 obsolete file)

http://hg.mozilla.org/mozilla-central/rev/f1d496722775#l11.29
We are using widget->GetNativeData(NS_NATIVE_WINDOW) value to send it over IPC.. that is probably correct for windows, but not for Linux and other platforms.
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #556765 - Flags: review?(roc)
Blocks: 590299
Comment on attachment 556768 [details] [diff] [review]
Also crossprocess shareable window within puppet widget

Review of attachment 556768 [details] [diff] [review]:
-----------------------------------------------------------------

This patch assumes PuppetWidgets are always associated with the same toplevel browser window. That might not always be true, e.g. in multiprocess desktop Firefox it's probably not going to be true when you drag tabs from one window to another.

So PuppetWidget::GetNativeData probably needs to call SendGetNativeWidgetData every time, or else we need a way to update the cached value.
Is widget SetParent/Reparent the only place where window could be changed or is there are any other place can do that?
Attachment #556768 - Attachment is obsolete: true
Attachment #556768 - Flags: review?(roc)
Attachment #556862 - Flags: review?(jones.chris.g)
Attachment #556862 - Flags: review?(roc)
(In reply to Oleg Romashin (:romaxa) from comment #4)
> Is widget SetParent/Reparent the only place where window could be changed or
> is there are any other place can do that?

I don't think we'd call SetParent on PuppetWidgets when moving a content-process tab between windows, because the PuppetWidget doesn't know about the native widget parent.
Attachment #556862 - Flags: review?(jones.chris.g)
Keywords: checkin-needed
(In reply to Oleg Romashin (:romaxa) from comment #0)
> http://hg.mozilla.org/mozilla-central/rev/f1d496722775#l11.29
> We are using widget->GetNativeData(NS_NATIVE_WINDOW) value to send it over
> IPC.. that is probably correct for windows, but not for Linux and other
> platforms.

Oleg, could you please give background for this patch? Why can't we pass GetNativeData(NS_NATIVE_WINDOW) through ipc and what magic you add to achieve this?
because NS_NATIVE_WINDOW return shareable handle only on window HWND.
on linux Gtk/Qt that returns Toolkit objects (GdkWindow  or QWidget), and obviously you cannot share that across the processes. Only XID (XServer window can be shared on linux) and on mac someone else there are should be some displayPort or something like that..
Oleg, has this been through try or do I need to test it with some stuff I'm pushing now?
Comment on attachment 556862 [details] [diff] [review]
crossprocess shareable window within puppet widget

(Missing commit message/author)
Summary: NS_NATIVE_WINDOW value used incorrectly in Accessible implementation → NS_NATIVE_WINDOW value should not be used as IPC shareable
http://hg.mozilla.org/mozilla-central/rev/e43df9a4b36e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.