Closed
Bug 1017862
Opened 11 years ago
Closed 11 years ago
Remove virtual destructor from BaseProxyHandler
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: efaust, Assigned: efaust)
References
Details
Attachments
(2 files)
12.99 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
16.71 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
All the C++ proxy handlers are singletons with the same lifetime as the program. There's no need for a desctructor. Add an assert that this is the case.
Attachment #8431150 -
Flags: review?(jorendorff)
![]() |
||
Comment 1•11 years ago
|
||
Comment on attachment 8431150 [details] [diff] [review]
Patch
Review of attachment 8431150 [details] [diff] [review]:
-----------------------------------------------------------------
Very nice.
Attachment #8431150 -
Flags: review?(jorendorff) → review+
Landed in https://hg.mozilla.org/integration/mozilla-inbound/rev/004d84a6905a
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/94cfbc72d81f for assertion failures:
https://tbpl.mozilla.org/php/getParsedLog.php?id=40676987&tree=Mozilla-Inbound
Flags: needinfo?(efaustbmo)
Comment 3•11 years ago
|
||
Comment on attachment 8431150 [details] [diff] [review]
Patch
Review of attachment 8431150 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsproxy.h
@@ +122,5 @@
> void setHasSecurityPolicy(bool aHasPolicy) { mHasSecurityPolicy = aHasPolicy; }
>
> public:
> explicit BaseProxyHandler(const void *family);
> + ~BaseProxyHandler();
Making BaseProxyHandler's destructor protected is another way to ensure that derived classes do not need virtual destructors.
Assignee | ||
Comment 4•11 years ago
|
||
OK, so the trouble was that we don't run shutdown CC/GCs in non-debug builds, because it's slow, so there was a CC managed Runtime laying around.
Relanded with a relaxed assert.
https://hg.mozilla.org/integration/mozilla-inbound/rev/88fefd05fb64
Flags: needinfo?(efaustbmo)
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/06bd71f490fa
yeah, right. Like this'll ever stick. Backed out for blowing up the whole tree.
Assignee | ||
Comment 6•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b64fd64d1c7
Too many balls in the air. It promise it was backed out for real.
Assignee | ||
Comment 7•11 years ago
|
||
So this is basically the same thing, except that we remove the destructor from BaseProxyHandler altogether. This is necessary to make all the proxy handler constructors constexpr, as the compiler wants to be guaranteed of purity, so forbids potential sources of side effects, like non-trivial destructors.
Carrying the r+ for now.
Assignee | ||
Comment 8•11 years ago
|
||
![]() |
||
Comment 9•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•