Bug 1289608 - Define XrayWrapper<...>::singleton for all instantiations, instead of defining specializations for specific ones. r=bholley
authorBotond Ballo <botond@mozilla.com>
Fri, 29 Jul 2016 16:40:08 -0400
changeset 347472 891c4b4e27971caacede5e669a668bd5e9f1a3e4
parent 347471 19417c63e17e44cbd53d45d45bbfe3e1cd3ce053
child 347473 cf46248f894fb1e6785f8e8e8d9c3d67bd6612c8
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1289608
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1289608 - Define XrayWrapper<...>::singleton for all instantiations, instead of defining specializations for specific ones. r=bholley 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