Open Bug 817236 Opened 13 years ago Updated 3 years ago

Drop refcounting in WebGL classes that don't need it

Categories

(Core :: Graphics: CanvasWebGL, task, P3)

task

Tracking

()

People

(Reporter: bjacob, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: webgl-next)

Once we've dropped useless nsISupports inheritance, the next step is to drop refcounting on the (few) WebGL classes that don't need it. This will mean removing the refcounting macros in C++ code, and switching from 'refcounted' to 'owned' in Web IDL. Being exposed to JS doesn't make refcounting necessary. If refcounting is not used in C++ code, then we should be able to remove it. However, note that classes that inherit nsWrapperCache must be refcounted. That criterion leaves only 3 classes: WebGLUniformLocation WebGLShaderPrecisionFormat WebGLActiveInfo WebGLShaderPrecisionFormat and WebGLActiveInfo can clearly drop refcounting. WebGLUniformLocation I don't know, because it must be cycle collected, because of the strong reference to WebGLProgram (see bug 795186 comment 0). The question is: is it OK for a cycle collected class to be 'owned' in Bindings.conf? Is that even possible? Does that make sense?
Depends on: 817270
(In reply to Benoit Jacob [:bjacob] from comment #0) > The question is: is it OK for a cycle collected class to be 'owned' in > Bindings.conf? Is that even possible? Does that make sense? It does make sense, but currently we're not able to do it. The way I want to fix that is by "skipping" the owned object. Given that there is only ever one edge in the CC graph into the owned object (from the binding) we can simplify the graph by recording all the edges out of the owned object as coming from the binding.
Type: defect → task
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.