Closed Bug 1266536 Opened 8 years ago Closed 8 years ago

Remove NS_NATIVE_GRAPHIC support on Windows

Categories

(Core :: Widget: Win32, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: dvander, Assigned: dvander)

References

Details

It looks like there are two callers of NS_NATIVE_GRAPHIC outside nsWindow:

 - GetPluginPort[1], which is dead code. See bug 1266513.
 - WGL CreateForWindow[2], which is currently not used or supported, but the intent was probably to grab the window DC.

If the window is translucent a memory DC is returned, so these callers are presumably broken. The memory DC can be freed at any time by the compositor or the window, and for both callers the potential use of the DC outlives the handle.

In addition, it's not clear how NS_NATIVE_GRAPHIC could work under an out-of-process compositor. We would not be able to share the memory DC between the compositor process and the parent process.

While it's not very important - we don't plan on shipping a software OOP compositor yet - it would simplify things to just remove support for this function.

[1] https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsPluginFrame.cpp#658
[2] https://dxr.mozilla.org/mozilla-central/source/gfx/gl/GLContextProviderWGL.cpp#454
Summary: Don't return mMemoryDC via NS_NATIVE_GRAPHIC → Remove NS_NATIVE_GRAPHIC support on Windows
https://hg.mozilla.org/mozilla-central/rev/fa44404d8be4
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.