Open
Bug 694114
Opened 13 years ago
Updated 2 years ago
Add ability to statically assert from C++ that a class is 'builtinclass'
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
REOPENED
People
(Reporter: bjacob, Unassigned)
References
Details
This is a follow-up from bug 638328 comment 19. We need to be able to statically assert from C++ that a class is marked "builtinclass". Probably the easiest would be template<typename T> struct is_builtinclass { enum { value = 0 }; }; and then the IDL generator would generate for each class that is builtinclass, a specialization like: template<> struct is_builtinclass<MyClass> { enum { value = 1 }; };
Reporter | ||
Comment 1•13 years ago
|
||
And once this is possible, we want to use that in bug 638328, in GetConcreteObject in WebGLContext.h
I don't entirely understand this. That an interface is builtinclass doesn't imply that there is only one implementation of it and that it's safe to static_cast to a concrete class.
Comment 3•13 years ago
|
||
Sure, people writing non-Gecko C++ can make it fail. I think we don't care about that if it means we can make things a lot faster.
(In reply to Peter Van der Beken [:peterv] from comment #3) > Sure, people writing non-Gecko C++ can make it fail. I think we don't care > about that if it means we can make things a lot faster. I agree, I just don't know that it's worth adding asserts for this if it's not actually guaranteeing much.
Comment 5•13 years ago
|
||
My worry is forgetting to add a builtinclass somewhere and then letting JS pass random objects that we'll try to cast because we assume only C++ can implement the interface.
Comment 7•6 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
Updated•6 years ago
|
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•