Commit bc9290f7 authored by Gabriele Svelto's avatar Gabriele Svelto
Browse files

Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan

The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
parent 4be2734c
......@@ -36,7 +36,6 @@
#include "nsCSSPseudoElements.h" // For PseudoStyleType
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsIFrame.h"
#include "nsIScriptError.h"
#include "nsPresContextInlines.h"
#include "nsRefreshDriver.h"
......
......@@ -8,7 +8,6 @@
#include "nsContentUtils.h"
#include "mozilla/dom/Document.h"
#include "nsPIDOMWindow.h"
#include "nsIURI.h"
using namespace mozilla::dom;
......
......@@ -13,7 +13,6 @@
#include "mozilla/Unused.h"
#include "nsContentUtils.h"
#include "nsIScriptSecurityManager.h"
#include "nsISupportsPrimitives.h"
#include "nsThreadUtils.h"
#include "nsHashPropertyBag.h"
......
......@@ -8,7 +8,6 @@
#include "mozilla/dom/BarPropBinding.h"
#include "nsContentUtils.h"
#include "nsGlobalWindow.h"
#include "nsIDocShell.h"
#include "nsIScrollable.h"
#include "nsIWebBrowserChrome.h"
......
......@@ -23,7 +23,6 @@
#include "mozilla/dom/Document.h"
#include "nsReadableUtils.h"
#include "mozilla/InternalMutationEvent.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#include "nsDOMString.h"
#include "nsChangeHint.h"
......
......@@ -13,8 +13,6 @@
#include "nsFrameMessageManager.h"
#include "nsIScriptContext.h"
#include "nsIScriptContext.h"
#include "nsIClassInfo.h"
#include "nsIRunnable.h"
#include "nsServiceManagerUtils.h"
#include "nsWeakReference.h"
#include "nsWrapperCache.h"
......
......@@ -12,8 +12,6 @@
#include "SystemPrincipal.h"
#include "nsIStreamListener.h"
#include "nsStringStream.h"
#include "nsIScriptError.h"
#include "nsIScriptSecurityManager.h"
#include "nsCRT.h"
#include "nsStreamUtils.h"
#include "nsContentUtils.h"
......
......@@ -8,7 +8,6 @@
#include "mozilla/AbstractThread.h"
#include "mozilla/SchedulerGroup.h"
#include "nsINamed.h"
using namespace mozilla;
using namespace mozilla::dom;
......
......@@ -12,7 +12,6 @@
#include "mozilla/ThrottledEventQueue.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/Telemetry.h"
#include "nsIDocShell.h"
#include "nsDOMMutationObserver.h"
#include "nsProxyRelease.h"
#if defined(XP_WIN)
......
......@@ -138,7 +138,6 @@
#include "mozilla/dom/PromiseNativeHandler.h"
#include "mozilla/dom/TreeWalker.h"
 
#include "nsIServiceManager.h"
#include "mozilla/dom/ServiceWorkerManager.h"
#include "imgLoader.h"
 
......@@ -176,7 +175,6 @@
 
#include "nsPIDOMWindow.h"
#include "nsFocusManager.h"
#include "nsICookiePermission.h"
#include "nsICookieService.h"
 
#include "nsBidiUtils.h"
......@@ -198,7 +196,6 @@
#include "nsDOMCID.h"
 
#include "jsapi.h"
#include "nsIXPConnect.h"
#include "xpcpublic.h"
#include "nsCCUncollectableMarker.h"
#include "nsIContentPolicy.h"
......@@ -256,7 +253,6 @@
 
#include "mozilla/Preferences.h"
 
#include "imgILoader.h"
#include "imgRequestProxy.h"
#include "nsWrapperCacheInlines.h"
#include "nsSandboxFlags.h"
......@@ -295,12 +291,10 @@
#include "nsIDocumentEncoder.h"
#include "nsIDocumentActivity.h"
#include "nsIStructuredCloneContainer.h"
#include "nsIMutableArray.h"
#include "mozilla/dom/DOMStringList.h"
#include "nsWindowSizes.h"
#include "mozilla/dom/Location.h"
#include "mozilla/dom/FontFaceSet.h"
#include "nsISupportsPrimitives.h"
#include "mozilla/ServoStyleSet.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
......
......@@ -30,10 +30,8 @@
#include "nsIProgressEventSink.h"
#include "nsIRadioGroupContainer.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr)
#include "nsIServiceManager.h"
#include "nsIURI.h" // for use in inline functions
#include "nsIUUIDGenerator.h"
#include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr)
#include "nsIURI.h" // for use in inline functions
#include "nsIWebProgressListener.h" // for nsIWebProgressListener
#include "nsIWeakReferenceUtils.h" // for nsWeakPtr
#include "nsPIDOMWindow.h" // for use in inline functions
......@@ -88,7 +86,6 @@ class imgIRequest;
class nsCachableElementsByNameNodeList;
class nsCommandManager;
class nsContentList;
class nsIDocShell;
class nsDocShell;
class nsDOMNavigationTiming;
class nsFrameLoader;
......
......@@ -13,7 +13,6 @@
#include "nsCOMPtr.h"
#include "nsDOMString.h"
#include "nsNodeInfoManager.h"
#include "nsIXPConnect.h"
#include "xpcpublic.h"
#include "nsWrapperCacheInlines.h"
#include "mozilla/dom/DocumentTypeBinding.h"
......
......@@ -35,7 +35,6 @@
#include "nsFlexContainerFrame.h"
#include "nsFocusManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsIURL.h"
#include "nsContainerFrame.h"
#include "nsIAnonymousContentCreator.h"
#include "nsPresContext.h"
......@@ -43,7 +42,6 @@
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
#include "nsDOMCSSAttrDeclaration.h"
#include "nsNameSpaceManager.h"
#include "nsContentList.h"
......@@ -51,7 +49,6 @@
#include "nsDOMTokenList.h"
#include "nsError.h"
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "mozilla/dom/AnimatableBinding.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/HTMLDivElement.h"
......@@ -103,16 +100,11 @@
#include "nsGkAtoms.h"
#include "ChildIterator.h"
#include "nsIDOMEventListener.h"
#include "nsIWebNavigation.h"
#include "nsIBaseWindow.h"
#include "nsIWidget.h"
#include "nsNodeInfoManager.h"
#include "nsICategoryManager.h"
#include "nsGenericHTMLElement.h"
#include "nsContentCreatorFunctions.h"
#include "nsIControllers.h"
#include "nsView.h"
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
......@@ -164,7 +156,6 @@
#include "nsIAutoCompletePopup.h"
#include "nsISpeculativeConnect.h"
#include "nsIIOService.h"
#include "nsBlockFrame.h"
#include "DOMMatrix.h"
......
......@@ -39,7 +39,6 @@
#include "nsIThreadRetargetableRequest.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIScriptError.h"
#include "nsIContentSecurityPolicy.h"
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"
#include "xpcpublic.h"
......
......@@ -16,12 +16,6 @@
#include "mozilla/Attributes.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsIObserver.h"
#include "nsIStreamListener.h"
#include "nsIChannelEventSink.h"
#include "nsIInterfaceRequestor.h"
#include "nsITimer.h"
#include "nsIHttpChannel.h"
#include "nsDeque.h"
class nsIGlobalObject;
......
......@@ -39,7 +39,6 @@
#include "nsIDocumentEncoder.h"
#include "nsFocusManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsIFrame.h"
#include "nsIAnonymousContentCreator.h"
......@@ -48,14 +47,12 @@
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
#include "nsDOMCSSAttrDeclaration.h"
#include "nsNameSpaceManager.h"
#include "nsContentList.h"
#include "nsDOMTokenList.h"
#include "nsError.h"
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/MouseEvents.h"
#include "nsAttrValueOrString.h"
......@@ -78,16 +75,11 @@
#include "nsContentCID.h"
#include "nsWindowSizes.h"
#include "nsIDOMEventListener.h"
#include "nsIWebNavigation.h"
#include "nsIBaseWindow.h"
#include "nsIWidget.h"
#include "nsNodeInfoManager.h"
#include "nsICategoryManager.h"
#include "nsGenericHTMLElement.h"
#include "nsContentCreatorFunctions.h"
#include "nsIControllers.h"
#include "nsView.h"
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
......@@ -104,7 +96,6 @@
#include "nsWrapperCacheInlines.h"
#include "nsCycleCollector.h"
#include "xpcpublic.h"
#include "nsIScriptError.h"
#include "mozilla/Telemetry.h"
#include "mozilla/CORSMode.h"
......
......@@ -8,7 +8,6 @@
#include "nsJSEnvironment.h"
#include "js/GCAPI.h"
#include "mozIDOMWindow.h"
#include "mozilla/dom/KeyboardEvent.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/TextEvents.h"
......
......@@ -13,7 +13,6 @@
#include "mozilla/dom/WindowBinding.h"
#include "nsComponentManagerUtils.h"
#include "nsGlobalWindow.h"
#include "nsISupportsPrimitives.h"
#include "nsPIDOMWindow.h"
namespace mozilla {
......
......@@ -14,7 +14,6 @@
#include "nsCycleCollectionParticipant.h"
#include "nsDOMNavigationTiming.h"
#include "nsICancelableRunnable.h"
#include "nsIRunnable.h"
#include "nsString.h"
class nsPIDOMWindowInner;
......
......@@ -7,10 +7,7 @@
#include "InProcessBrowserChildMessageManager.h"
#include "nsContentUtils.h"
#include "nsDocShell.h"
#include "nsIScriptSecurityManager.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsComponentManagerUtils.h"
#include "nsFrameLoader.h"
#include "nsFrameLoaderOwner.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment