Bug 1170771 - Remove now-empty nsDOMClassInfo. r=bz
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Thu, 05 Apr 2018 14:20:44 +0200
changeset 465757 2ae59181b9de1efbdb20cffc773fb4b1329c5a38
parent 465756 5e6526a99bc98ffc6a5c2fb6b352d9f4a797e30d
child 465773 22542265bb30870639c3908d9e1cf299be25e7ea
child 465776 de56f4d73e12b2f52594b2865a7fcf8d14db621f
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1170771
milestone61.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 1170771 - Remove now-empty nsDOMClassInfo. r=bz MozReview-Commit-ID: 7XsiPD1kTt9
dom/base/WindowNamedPropertiesHandler.cpp
dom/base/moz.build
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfo.h
dom/base/nsDocument.cpp
dom/base/nsObjectLoadingContent.cpp
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/DOMJSProxyHandler.cpp
dom/html/nsHTMLDocument.cpp
dom/xbl/nsXBLBinding.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCRuntimeService.cpp
layout/build/nsLayoutStatics.cpp
storage/mozStorageAsyncStatement.cpp
storage/mozStorageStatement.cpp
--- a/dom/base/WindowNamedPropertiesHandler.cpp
+++ b/dom/base/WindowNamedPropertiesHandler.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WindowNamedPropertiesHandler.h"
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "nsContentUtils.h"
-#include "nsDOMClassInfo.h"
 #include "nsDOMWindowList.h"
 #include "nsGlobalWindow.h"
 #include "nsHTMLDocument.h"
 #include "nsJSUtils.h"
 #include "xpcprivate.h"
 
 namespace mozilla {
 namespace dom {
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -290,17 +290,16 @@ UNIFIED_SOURCES += [
     'nsContentPolicy.cpp',
     'nsContentSink.cpp',
     'nsCopySupport.cpp',
     'nsDataDocumentContentPolicy.cpp',
     'nsDocument.cpp',
     'nsDocumentEncoder.cpp',
     'nsDOMAttributeMap.cpp',
     'nsDOMCaretPosition.cpp',
-    'nsDOMClassInfo.cpp',
     'nsDOMMutationObserver.cpp',
     'nsDOMNavigationTiming.cpp',
     'nsDOMSerializer.cpp',
     'nsDOMTokenList.cpp',
     'nsDOMWindowList.cpp',
     'nsFocusManager.cpp',
     'nsFrameLoader.cpp',
     'nsGenConImageContent.cpp',
deleted file mode 100644
--- a/dom/base/nsDOMClassInfo.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/ArrayUtils.h"
-
-// JavaScript includes
-#include "jsapi.h"
-#include "jsfriendapi.h"
-#include "WrapperFactory.h"
-#include "AccessCheck.h"
-#include "XrayWrapper.h"
-
-#include "xpcpublic.h"
-#include "xpcprivate.h"
-#include "xpc_make_class.h"
-#include "XPCWrapper.h"
-
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/dom/RegisterBindings.h"
-
-#include "nscore.h"
-#include "nsDOMClassInfo.h"
-#include "nsIDOMClassInfo.h"
-#include "nsCRT.h"
-#include "nsCRTGlue.h"
-#include "nsICategoryManager.h"
-#include "nsIComponentRegistrar.h"
-#include "nsXPCOM.h"
-#include "nsISimpleEnumerator.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIXPConnect.h"
-#include "xptcall.h"
-#include "nsTArray.h"
-
-// General helper includes
-#include "nsGlobalWindow.h"
-#include "nsIContent.h"
-#include "nsIDocument.h"
-#include "nsIDOMDocument.h"
-#include "nsIDOMEvent.h"
-#include "nsIDOMEventListener.h"
-#include "nsContentUtils.h"
-#include "nsIDOMGlobalPropertyInitializer.h"
-#include "mozilla/Attributes.h"
-#include "mozilla/Telemetry.h"
-
-// DOM base includes
-#include "nsIDOMWindow.h"
-#include "nsPIDOMWindow.h"
-
-// DOM core includes
-#include "nsError.h"
-
-// Event related includes
-#include "nsIDOMEventTarget.h"
-
-// CSS related includes
-#include "nsMemory.h"
-
-// includes needed for the prototype chain interfaces
-
-#include "nsIEventListenerService.h"
-
-#include "mozilla/dom/TouchEvent.h"
-
-#include "nsWrapperCacheInlines.h"
-#include "mozilla/dom/HTMLCollectionBinding.h"
-
-#include "nsDebug.h"
-
-#include "mozilla/dom/BindingUtils.h"
-#include "mozilla/Likely.h"
-#include "nsIInterfaceInfoManager.h"
-
-#ifdef MOZ_TIME_MANAGER
-#include "TimeManager.h"
-#endif
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-bool nsDOMClassInfo::sIsInitialized = false;
-
-// static
-nsresult
-nsDOMClassInfo::Init()
-{
-  /* Errors that can trigger early returns are done first,
-     otherwise nsDOMClassInfo is left in a half inited state. */
-  static_assert(sizeof(uintptr_t) == sizeof(void*),
-                "BAD! You'll need to adjust the size of uintptr_t to the "
-                "size of a pointer on your platform.");
-
-  NS_ENSURE_TRUE(!sIsInitialized, NS_ERROR_ALREADY_INITIALIZED);
-
-  sIsInitialized = true;
-
-  return NS_OK;
-}
-
-// static
-void
-nsDOMClassInfo::ShutDown()
-{
-  sIsInitialized = false;
-}
deleted file mode 100644
--- a/dom/base/nsDOMClassInfo.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsDOMClassInfo_h___
-#define nsDOMClassInfo_h___
-
-#include "mozilla/Attributes.h"
-#include "nsIXPCScriptable.h"
-#include "nsIScriptGlobalObject.h"
-#include "js/Class.h"
-#include "js/Id.h"
-#include "nsIXPConnect.h"
-
-class nsDOMClassInfo
-{
-public:
-  static nsresult Init();
-  static void ShutDown();
-
-protected:
-  static bool sIsInitialized;
-};
-
-#endif /* nsDOMClassInfo_h___ */
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -42,17 +42,16 @@
 #include "nsIBaseWindow.h"
 #include "mozilla/css/Loader.h"
 #include "mozilla/css/ImageLoader.h"
 #include "nsDocShell.h"
 #include "nsDocShellLoadTypes.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsCOMArray.h"
 #include "nsQueryObject.h"
-#include "nsDOMClassInfo.h"
 #include "mozilla/Services.h"
 #include "nsScreen.h"
 #include "ChildIterator.h"
 
 #include "mozilla/dom/AboutCapabilitiesBinding.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventListenerManager.h"
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -65,17 +65,16 @@
 // Concrete classes
 #include "nsFrameLoader.h"
 
 #include "nsObjectLoadingContent.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIContentSecurityPolicy.h"
 #include "GeckoProfiler.h"
 #include "nsPluginFrame.h"
-#include "nsDOMClassInfo.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsDOMJSUtils.h"
 
 #include "nsWidgetsCID.h"
 #include "nsContentCID.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/Element.h"
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -50,17 +50,16 @@
 #include "mozilla/dom/XULElementBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ResolveSystemBinding.h"
 #include "mozilla/dom/WebIDLGlobalNameHash.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/dom/XrayExpandoClass.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
-#include "nsDOMClassInfo.h"
 #include "ipc/ErrorIPCUtils.h"
 #include "mozilla/UseCounter.h"
 #include "mozilla/dom/DocGroup.h"
 #include "nsXULElement.h"
 
 namespace mozilla {
 namespace dom {
 
@@ -3276,46 +3275,35 @@ CreateGlobalOptionsWithXPConnect::PostCr
   // Invoking the XPCWrappedNativeScope constructor automatically hooks it
   // up to the compartment of aGlobal.
   (void) new XPCWrappedNativeScope(aCx, aGlobal);
   return true;
 }
 
 static bool sRegisteredDOMNames = false;
 
-nsresult
+static void
 RegisterDOMNames()
 {
   if (sRegisteredDOMNames) {
-    return NS_OK;
+    return;
   }
 
   // Register new DOM bindings
   WebIDLGlobalNameHash::Init();
 
-  nsresult rv = nsDOMClassInfo::Init();
-  if (NS_FAILED(rv)) {
-    NS_ERROR("Could not initialize nsDOMClassInfo");
-    return rv;
-  }
-
   sRegisteredDOMNames = true;
-
-  return NS_OK;
 }
 
 /* static */
 bool
 CreateGlobalOptions<nsGlobalWindowInner>::PostCreateGlobal(JSContext* aCx,
                                                            JS::Handle<JSObject*> aGlobal)
 {
-  nsresult rv = RegisterDOMNames();
-  if (NS_FAILED(rv)) {
-    return Throw(aCx, rv);
-  }
+  RegisterDOMNames();
 
   return CreateGlobalOptionsWithXPConnect::PostCreateGlobal(aCx, aGlobal);
 }
 
 #ifdef DEBUG
 void
 AssertReturnTypeMatchesJitinfo(const JSJitInfo* aJitInfo,
                                JS::Handle<JS::Value> aValue)
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -3121,19 +3121,16 @@ template <>
 struct CreateGlobalOptions<nsGlobalWindowInner>
   : public CreateGlobalOptionsWithXPConnect
 {
   static constexpr ProtoAndIfaceCache::Kind ProtoAndIfaceCacheKind =
     ProtoAndIfaceCache::WindowLike;
   static bool PostCreateGlobal(JSContext* aCx, JS::Handle<JSObject*> aGlobal);
 };
 
-nsresult
-RegisterDOMNames();
-
 // The return value is true if we created and successfully performed our part of
 // the setup for the global, false otherwise.
 //
 // Typically this method's caller will want to ensure that
 // xpc::InitGlobalObjectOptions is called before, and xpc::InitGlobalObject is
 // called after, this method, to ensure that this global object and its
 // compartment are consistent with other global objects.
 template <class T, ProtoHandleGetter GetProto>
--- a/dom/bindings/DOMJSProxyHandler.cpp
+++ b/dom/bindings/DOMJSProxyHandler.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/DOMJSProxyHandler.h"
 #include "xpcpublic.h"
 #include "xpcprivate.h"
 #include "XPCWrapper.h"
 #include "WrapperFactory.h"
-#include "nsDOMClassInfo.h"
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/BindingUtils.h"
 
 #include "jsapi.h"
 
 using namespace JS;
 
 namespace mozilla {
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -101,17 +101,16 @@
 #include "nsHtml5Parser.h"
 #include "nsSandboxFlags.h"
 #include "nsIImageDocument.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/HTMLDocumentBinding.h"
 #include "mozilla/dom/Selection.h"
 #include "nsCharsetSource.h"
 #include "nsIStringBundle.h"
-#include "nsDOMClassInfo.h"
 #include "nsFocusManager.h"
 #include "nsIFrame.h"
 #include "nsIContent.h"
 #include "nsLayoutStylesheetCache.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/Unused.h"
 
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -44,20 +44,16 @@
 #include "nsXBLBinding.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "mozilla/dom/XBLChildrenElement.h"
 
 #include "nsNodeUtils.h"
 #include "nsJSUtils.h"
 
-// Nasty hack.  Maybe we could move some of the classinfo utility methods
-// (e.g. WrapNative) over to nsContentUtils?
-#include "nsDOMClassInfo.h"
-
 #include "mozilla/DeferredFinalize.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/ShadowRoot.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -27,17 +27,16 @@
 #include "mozilla/dom/DOMException.h"
 #include "mozilla/dom/DOMExceptionBinding.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/Scheduler.h"
 #include "nsZipArchive.h"
 #include "nsWindowMemoryReporter.h"
-#include "nsDOMClassInfo.h"
 #include "ShimInterfaceInfo.h"
 #include "nsIException.h"
 #include "nsIScriptError.h"
 #include "nsISimpleEnumerator.h"
 #include "nsPIDOMWindow.h"
 #include "nsGlobalWindow.h"
 #include "nsScriptError.h"
 #include "GeckoProfiler.h"
--- a/js/xpconnect/src/XPCRuntimeService.cpp
+++ b/js/xpconnect/src/XPCRuntimeService.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcprivate.h"
 
 #include "nsContentUtils.h"
 #include "BackstagePass.h"
-#include "nsDOMClassInfo.h"
 #include "nsIPrincipal.h"
 #include "mozilla/dom/BindingUtils.h"
 
 NS_IMPL_ISUPPORTS(BackstagePass,
                   nsIXPCScriptable,
                   nsIGlobalObject,
                   nsIClassInfo,
                   nsIScriptObjectPrincipal,
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/css/ErrorReporter.h"
 #include "nsCSSKeywords.h"
 #include "nsCSSParser.h"
 #include "nsCSSProps.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSRendering.h"
 #include "nsGenericHTMLFrameElement.h"
 #include "mozilla/dom/Attr.h"
-#include "nsDOMClassInfo.h"
 #include "mozilla/EventListenerManager.h"
 #include "nsFrame.h"
 #include "nsGlobalWindow.h"
 #include "nsGkAtoms.h"
 #include "nsImageFrame.h"
 #include "nsLayoutStylesheetCache.h"
 #include "nsRange.h"
 #include "nsRegion.h"
@@ -362,17 +361,16 @@ nsLayoutStatics::Shutdown()
 
   nsAttrValue::Shutdown();
   nsContentUtils::Shutdown();
   nsLayoutStylesheetCache::Shutdown();
 
   ShutdownJSEnvironment();
   nsGlobalWindowInner::ShutDown();
   nsGlobalWindowOuter::ShutDown();
-  nsDOMClassInfo::ShutDown();
   WebIDLGlobalNameHash::Shutdown();
   nsListControlFrame::Shutdown();
   nsXBLService::Shutdown();
   nsAutoCopyListener::Shutdown();
   FrameLayerBuilder::Shutdown();
 
   CubebUtils::ShutdownLibrary();
   AsyncLatencyLogger::ShutdownLogger();
--- a/storage/mozStorageAsyncStatement.cpp
+++ b/storage/mozStorageAsyncStatement.cpp
@@ -18,17 +18,16 @@
 
 #include "mozStorageBindingParams.h"
 #include "mozStorageConnection.h"
 #include "mozStorageAsyncStatementJSHelper.h"
 #include "mozStorageAsyncStatementParams.h"
 #include "mozStoragePrivateHelpers.h"
 #include "mozStorageStatementRow.h"
 #include "mozStorageStatement.h"
-#include "nsDOMClassInfo.h"
 
 #include "mozilla/Logging.h"
 
 extern mozilla::LazyLogModule gStorageLog;
 
 namespace mozilla {
 namespace storage {
 
--- a/storage/mozStorageStatement.cpp
+++ b/storage/mozStorageStatement.cpp
@@ -18,17 +18,16 @@
 #include "mozStorageBindingParams.h"
 #include "mozStorageConnection.h"
 #include "mozStorageStatementJSHelper.h"
 #include "mozStoragePrivateHelpers.h"
 #include "mozStorageStatementParams.h"
 #include "mozStorageStatementRow.h"
 #include "mozStorageStatement.h"
 #include "GeckoProfiler.h"
-#include "nsDOMClassInfo.h"
 
 #include "mozilla/Logging.h"
 #include "mozilla/Printf.h"
 
 
 extern mozilla::LazyLogModule gStorageLog;
 
 namespace mozilla {