Bug 1289608 - Define XrayWrapper<...>::singleton for all instantiations, instead of defining specializations for specific ones. r=bholey draft
authorBotond Ballo <botond@mozilla.com>
Fri, 29 Jul 2016 16:40:08 -0400
changeset 394514 0351cd5c9bd3e41373eed12b616e6fd324375423
parent 394513 29a69c5b0068bc2e948e007d656ef7b7d4efb13d
child 526830 554f162297eba6a781ebabd0fec6db3515eef0f3
push id24592
push userbballo@mozilla.com
push dateFri, 29 Jul 2016 22:02:30 +0000
reviewersbholey
bugs1289608
milestone50.0a1
Bug 1289608 - Define XrayWrapper<...>::singleton for all instantiations, instead of defining specializations for specific ones. r=bholey MozReview-Commit-ID: GecaSstpxRQ
js/xpconnect/wrappers/XrayWrapper.cpp
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -2399,37 +2399,21 @@ XrayWrapper<Base, Traits>::getPropertyKe
 
 /*
  * The Permissive / Security variants should be used depending on whether the
  * compartment of the wrapper is guranteed to subsume the compartment of the
  * wrapped object (i.e. - whether it is safe from a security perspective to
  * unwrap the wrapper).
  */
 
-template<>
-const PermissiveXrayXPCWN PermissiveXrayXPCWN::singleton(0);
-template class PermissiveXrayXPCWN;
-
-template<>
-const SecurityXrayXPCWN SecurityXrayXPCWN::singleton(0);
-template class SecurityXrayXPCWN;
-
-template<>
-const PermissiveXrayDOM PermissiveXrayDOM::singleton(0);
-template class PermissiveXrayDOM;
+template<typename Base, typename Traits>
+const xpc::XrayWrapper<Base, Traits>
+xpc::XrayWrapper<Base, Traits>::singleton(0);
 
-template<>
-const SecurityXrayDOM SecurityXrayDOM::singleton(0);
+template class PermissiveXrayXPCWN;
+template class SecurityXrayXPCWN;
+template class PermissiveXrayDOM;
 template class SecurityXrayDOM;
-
-template<>
-const PermissiveXrayJS PermissiveXrayJS::singleton(0);
 template class PermissiveXrayJS;
-
-template<>
-const PermissiveXrayOpaque PermissiveXrayOpaque::singleton(0);
 template class PermissiveXrayOpaque;
-
-template<>
-const SCSecurityXrayXPCWN SCSecurityXrayXPCWN::singleton(0);
 template class SCSecurityXrayXPCWN;
 
 } // namespace xpc