diff --git a/dom/base/WindowNamedPropertiesHandler.cpp b/dom/base/WindowNamedPropertiesHandler.cpp index 4ed4655bbe61..8c564bbd9823 100644 --- a/dom/base/WindowNamedPropertiesHandler.cpp +++ b/dom/base/WindowNamedPropertiesHandler.cpp @@ -8,7 +8,6 @@ #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" diff --git a/dom/base/moz.build b/dom/base/moz.build index 81dd8e2019c8..c19d67789bc3 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -295,7 +295,6 @@ UNIFIED_SOURCES += [ 'nsDocumentEncoder.cpp', 'nsDOMAttributeMap.cpp', 'nsDOMCaretPosition.cpp', - 'nsDOMClassInfo.cpp', 'nsDOMMutationObserver.cpp', 'nsDOMNavigationTiming.cpp', 'nsDOMSerializer.cpp', diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp deleted file mode 100644 index 4847c68ea83d..000000000000 --- 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; -} diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h deleted file mode 100644 index 98f99fc8f822..000000000000 --- 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___ */ diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index c6eddcd0a00a..ab8cf069f35e 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -47,7 +47,6 @@ #include "nsIDocShellTreeItem.h" #include "nsCOMArray.h" #include "nsQueryObject.h" -#include "nsDOMClassInfo.h" #include "mozilla/Services.h" #include "nsScreen.h" #include "ChildIterator.h" diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 9c2983e703eb..8e28f3e1dec1 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -70,7 +70,6 @@ #include "nsIContentSecurityPolicy.h" #include "GeckoProfiler.h" #include "nsPluginFrame.h" -#include "nsDOMClassInfo.h" #include "nsWrapperCacheInlines.h" #include "nsDOMJSUtils.h" diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 803d9794be2f..458bd049962e 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -55,7 +55,6 @@ #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" @@ -3281,25 +3280,17 @@ CreateGlobalOptionsWithXPConnect::PostCreateGlobal(JSContext* aCx, 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 */ @@ -3307,10 +3298,7 @@ bool CreateGlobalOptions::PostCreateGlobal(JSContext* aCx, JS::Handle aGlobal) { - nsresult rv = RegisterDOMNames(); - if (NS_FAILED(rv)) { - return Throw(aCx, rv); - } + RegisterDOMNames(); return CreateGlobalOptionsWithXPConnect::PostCreateGlobal(aCx, aGlobal); } diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 83f417af23d5..1c0de8443a21 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -3126,9 +3126,6 @@ struct CreateGlobalOptions static bool PostCreateGlobal(JSContext* aCx, JS::Handle aGlobal); }; -nsresult -RegisterDOMNames(); - // The return value is true if we created and successfully performed our part of // the setup for the global, false otherwise. // diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 7968fbda905a..0e014b47cf10 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -9,7 +9,6 @@ #include "xpcprivate.h" #include "XPCWrapper.h" #include "WrapperFactory.h" -#include "nsDOMClassInfo.h" #include "nsWrapperCacheInlines.h" #include "mozilla/dom/BindingUtils.h" diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 5d12f8f451d2..9fef56f7a7d5 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -106,7 +106,6 @@ #include "mozilla/dom/Selection.h" #include "nsCharsetSource.h" #include "nsIStringBundle.h" -#include "nsDOMClassInfo.h" #include "nsFocusManager.h" #include "nsIFrame.h" #include "nsIContent.h" diff --git a/dom/xbl/nsXBLBinding.cpp b/dom/xbl/nsXBLBinding.cpp index 4de8a67da4b5..afcfd77b1fd7 100644 --- a/dom/xbl/nsXBLBinding.cpp +++ b/dom/xbl/nsXBLBinding.cpp @@ -49,10 +49,6 @@ #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" diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 7a1d2472a7a5..34cbca7dae15 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -32,7 +32,6 @@ #include "mozilla/Scheduler.h" #include "nsZipArchive.h" #include "nsWindowMemoryReporter.h" -#include "nsDOMClassInfo.h" #include "ShimInterfaceInfo.h" #include "nsIException.h" #include "nsIScriptError.h" diff --git a/js/xpconnect/src/XPCRuntimeService.cpp b/js/xpconnect/src/XPCRuntimeService.cpp index b82f9d684526..b3b8afe76f2e 100644 --- a/js/xpconnect/src/XPCRuntimeService.cpp +++ b/js/xpconnect/src/XPCRuntimeService.cpp @@ -8,7 +8,6 @@ #include "nsContentUtils.h" #include "BackstagePass.h" -#include "nsDOMClassInfo.h" #include "nsIPrincipal.h" #include "mozilla/dom/BindingUtils.h" diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index 144ec0346143..1f33f6f67def 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -25,7 +25,6 @@ #include "nsCSSRendering.h" #include "nsGenericHTMLFrameElement.h" #include "mozilla/dom/Attr.h" -#include "nsDOMClassInfo.h" #include "mozilla/EventListenerManager.h" #include "nsFrame.h" #include "nsGlobalWindow.h" @@ -367,7 +366,6 @@ nsLayoutStatics::Shutdown() ShutdownJSEnvironment(); nsGlobalWindowInner::ShutDown(); nsGlobalWindowOuter::ShutDown(); - nsDOMClassInfo::ShutDown(); WebIDLGlobalNameHash::Shutdown(); nsListControlFrame::Shutdown(); nsXBLService::Shutdown(); diff --git a/storage/mozStorageAsyncStatement.cpp b/storage/mozStorageAsyncStatement.cpp index 46b76d5e0b60..e94c0985a01a 100644 --- a/storage/mozStorageAsyncStatement.cpp +++ b/storage/mozStorageAsyncStatement.cpp @@ -23,7 +23,6 @@ #include "mozStoragePrivateHelpers.h" #include "mozStorageStatementRow.h" #include "mozStorageStatement.h" -#include "nsDOMClassInfo.h" #include "mozilla/Logging.h" diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp index 9552b0cc6776..ca812e45616a 100644 --- a/storage/mozStorageStatement.cpp +++ b/storage/mozStorageStatement.cpp @@ -23,7 +23,6 @@ #include "mozStorageStatementRow.h" #include "mozStorageStatement.h" #include "GeckoProfiler.h" -#include "nsDOMClassInfo.h" #include "mozilla/Logging.h" #include "mozilla/Printf.h"