Skip to content

Commit

Permalink
Bug 1600545 - Remove useless inclusions of header files generated fro…
Browse files Browse the repository at this point in the history
…m IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ 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/D55443

--HG--
extra : moz-landing-system : lando
  • Loading branch information
gabrielesvelto committed Dec 6, 2019
1 parent ace6d10 commit 69790bc
Show file tree
Hide file tree
Showing 316 changed files with 75 additions and 585 deletions.
1 change: 0 additions & 1 deletion accessible/atk/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "nsIAccessibleEvent.h"
#include "nsIGSettingsService.h"
#include "nsIServiceManager.h"
#include "nsMai.h"
#include "AtkSocketAccessible.h"
#include "prenv.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/atk/nsMaiInterfaceImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "mozilla/Likely.h"
#include "nsMai.h"
#include "nsIAccessibleTypes.h"
#include "nsIURI.h"
#include "ProxyAccessible.h"

using namespace mozilla;
Expand Down
1 change: 0 additions & 1 deletion accessible/base/DocManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "nsAccessibilityService.h"
#include "Platform.h"
#include "RootAccessibleWrap.h"
#include "xpcAccessibleDocument.h"

#ifdef A11Y_LOG
# include "Logging.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/base/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
#include "nsDocShellLoadTypes.h"
#include "nsIChannel.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsISelectionController.h"
#include "nsTraceRefcnt.h"
#include "nsIWebProgress.h"
#include "prenv.h"
#include "nsIDocShellTreeItem.h"
#include "nsIURI.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLBodyElement.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/base/SelectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "nsEventShell.h"
#include "nsFrameSelection.h"

#include "nsIAccessibleTypes.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/Selection.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/base/nsAccCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#ifndef _nsAccCache_H_
#define _nsAccCache_H_

#include "xpcAccessibleDocument.h"

////////////////////////////////////////////////////////////////////////////////
// Accessible cache utils
////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 0 additions & 2 deletions accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "nsAttrName.h"
#include "nsDOMTokenList.h"
#include "nsEventShell.h"
#include "nsIURI.h"
#include "nsTextFormatter.h"
#include "OuterDocAccessible.h"
#include "Role.h"
Expand All @@ -38,7 +37,6 @@
#include "TextLeafAccessibleWrap.h"
#include "TreeWalker.h"
#include "xpcAccessibleApplication.h"
#include "xpcAccessibleDocument.h"

#ifdef MOZ_ACCESSIBILITY_ATK
# include "AtkSocketAccessible.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/generic/ARIAGridAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Role.h"
#include "States.h"

#include "nsIMutableArray.h"
#include "nsIPersistentProperties2.h"
#include "nsComponentManagerUtils.h"

Expand Down
3 changes: 0 additions & 3 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
#include "nsAtom.h"
#include "nsIURI.h"
#include "nsArrayUtils.h"
#include "nsIMutableArray.h"
#include "nsIObserverService.h"
#include "nsIServiceManager.h"
#include "nsWhitespaceTokenizer.h"
#include "nsAttrName.h"
#include "nsPersistentProperties.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/generic/ApplicationAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "Role.h"
#include "States.h"

#include "nsIComponentManager.h"
#include "nsIWindowMediator.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/Services.h"
#include "nsGlobalWindow.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/generic/ApplicationAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "AccessibleWrap.h"

#include "nsIMutableArray.h"
#include "nsIXULAppInfo.h"

namespace mozilla {
Expand Down
2 changes: 0 additions & 2 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "nsCommandManager.h"
#include "nsContentUtils.h"
#include "nsIMutableArray.h"
#include "nsIDocShell.h"
#include "mozilla/dom/Document.h"
#include "nsPIDOMWindow.h"
Expand All @@ -30,7 +29,6 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsImageFrame.h"
#include "nsIPersistentProperties2.h"
#include "nsIServiceManager.h"
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
#include "nsUnicharUtils.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/generic/DocAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "nsIObserver.h"
#include "nsIScrollPositionListener.h"
#include "nsITimer.h"
#include "nsIWeakReference.h"

class nsAccessiblePivot;

Expand Down
1 change: 0 additions & 1 deletion accessible/generic/HyperTextAccessible-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "nsAccUtils.h"

#include "nsIClipboard.h"
#include "nsIPersistentProperties2.h"
#include "nsFrameSelection.h"

#include "mozilla/TextEditor.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/generic/HyperTextAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsPersistentProperties.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsIMathMLFrame.h"
#include "nsRange.h"
#include "nsTextFragment.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/generic/HyperTextAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "WordMovementType.h"
#include "nsIFrame.h"

#include "nsISelectionController.h"

class nsFrameSelection;
class nsRange;
class nsIWidget;
Expand Down
1 change: 0 additions & 1 deletion accessible/generic/ImageAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/Document.h"
#include "nsIImageLoadingContent.h"
#include "nsIServiceManager.h"
#include "nsIPersistentProperties2.h"
#include "nsPIDOMWindow.h"
#include "nsIURI.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/generic/RootAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/BrowserHost.h"

#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/EventTarget.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "mozilla/dom/Document.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIPropertyBag2.h"
#include "nsIServiceManager.h"
#include "nsPIDOMWindow.h"
#include "nsIWebBrowserChrome.h"
#include "nsReadableUtils.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/html/HTMLElementAccessibles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "DocAccessible.h"
#include "nsAccUtils.h"
#include "nsIPersistentProperties2.h"
#include "nsTextEquivUtils.h"
#include "Relation.h"
#include "Role.h"
Expand Down
4 changes: 0 additions & 4 deletions accessible/html/HTMLFormControlAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
#include "nsContentList.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLTextAreaElement.h"
#include "nsIEditor.h"
#include "nsIFormControl.h"
#include "nsIPersistentProperties2.h"
#include "nsISelectionController.h"
#include "nsIServiceManager.h"
#include "nsITextControlFrame.h"
#include "nsNameSpaceManager.h"
#include "mozilla/dom/ScriptSettings.h"

#include "mozilla/EventStates.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/Preferences.h"
#include "mozilla/TextControlElement.h"
#include "mozilla/TextEditor.h"

using namespace mozilla;
Expand Down
1 change: 0 additions & 1 deletion accessible/html/HTMLImageMapAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "DocAccessible-inl.h"
#include "Role.h"

#include "nsIServiceManager.h"
#include "nsIFrame.h"
#include "nsImageFrame.h"
#include "nsImageMap.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/html/HTMLTableAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "mozilla/dom/HTMLTableElement.h"
#include "nsIHTMLCollection.h"
#include "mozilla/dom/Document.h"
#include "nsIMutableArray.h"
#include "nsIPersistentProperties2.h"
#include "nsITableCellLayout.h"
#include "nsFrameSelection.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/ProxyAccessibleBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "RelationType.h"
#include "xpcAccessibleDocument.h"

namespace mozilla {
namespace a11y {
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/other/DocAccessibleChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsIPersistentProperties2.h"
#include "nsISimpleEnumerator.h"
#include "nsAccUtils.h"
#ifdef MOZ_ACCESSIBILITY_ATK
# include "AccessibleWrap.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/other/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "mozilla/a11y/Platform.h"
#include "RelationType.h"
#include "mozilla/a11y/Role.h"
#include "xpcAccessibleDocument.h"

namespace mozilla {
namespace a11y {
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/win/COMPtrTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "mozilla/a11y/COMPtrTypes.h"

#include "Accessible2_3.h"
#include "MainThreadUtils.h"
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/Platform.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/win/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "mozilla/a11y/Platform.h"
#include "RelationType.h"
#include "mozilla/a11y/Role.h"
#include "xpcAccessibleDocument.h"

#include <comutil.h>

Expand Down
2 changes: 0 additions & 2 deletions accessible/ipc/win/ProxyAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "Accessible.h"
#include "mozilla/a11y/ProxyAccessibleBase.h"
#include "mozilla/a11y/Role.h"
#include "nsIAccessibleText.h"
#include "nsIAccessibleTypes.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsRect.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/win/handler/AccessibleHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "HandlerRelation.h"

#include "Factory.h"
#include "HandlerData.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/a11y/HandlerDataCleanup.h"
#include "mozilla/mscom/Registration.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/win/handler/HandlerDataCleanup.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define mozilla_a11y_HandlerDataCleanup_h

#include <oleauto.h>
#include "HandlerData.h"

namespace mozilla {
namespace a11y {
Expand Down
2 changes: 0 additions & 2 deletions accessible/mac/mozAccessible.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#include "Accessible-inl.h"
#include "nsAccUtils.h"
#include "nsIAccessibleRelation.h"
#include "nsIAccessibleEditableText.h"
#include "nsIPersistentProperties2.h"
#include "DocAccessibleParent.h"
#include "Relation.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/windows/ia2/ia2AccessibleHyperlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 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 "Accessible2.h"
#include "AccessibleHyperlink.h"
#include "AccessibleHyperlink_i.c"

Expand Down
1 change: 0 additions & 1 deletion accessible/windows/ia2/ia2AccessibleImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "nsIAccessibleTypes.h"

#include "nsString.h"
#include "nsIURI.h"

using namespace mozilla;
using namespace mozilla::a11y;
Expand Down
1 change: 0 additions & 1 deletion accessible/windows/ia2/ia2AccessibleTableCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "ia2AccessibleTableCell.h"

#include "Accessible2.h"
#include "AccessibleTable2_i.c"
#include "AccessibleTableCell_i.c"

Expand Down
1 change: 0 additions & 1 deletion accessible/windows/ia2/ia2AccessibleText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "ia2AccessibleText.h"

#include "Accessible2.h"
#include "AccessibleText_i.c"

#include "HyperTextAccessibleWrap.h"
Expand Down
2 changes: 0 additions & 2 deletions accessible/windows/ia2/ia2AccessibleText.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#ifndef _ACCESSIBLE_TEXT_H
#define _ACCESSIBLE_TEXT_H

#include "nsIAccessibleText.h"

#include "AccessibleText.h"

namespace mozilla {
Expand Down
3 changes: 0 additions & 3 deletions accessible/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@
# include "Logging.h"
#endif

#include "nsIMutableArray.h"
#include "nsIFrame.h"
#include "nsIScrollableFrame.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/BrowserBridgeParent.h"
#include "mozilla/dom/BrowserParent.h"
#include "nsIServiceManager.h"
#include "nsNameSpaceManager.h"
#include "nsTextFormatter.h"
#include "nsView.h"
Expand All @@ -46,7 +44,6 @@
#include "nsArrayUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/ReverseIterator.h"
#include "nsIXULRuntime.h"
#include "mozilla/mscom/AsyncInvoker.h"
#include "mozilla/mscom/Interceptor.h"

Expand Down
1 change: 0 additions & 1 deletion accessible/windows/msaa/AccessibleWrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "nsCOMPtr.h"
#include "Accessible.h"
#include "Accessible2.h"
#include "ia2Accessible.h"
#include "ia2AccessibleComponent.h"
#include "ia2AccessibleHyperlink.h"
Expand Down
1 change: 1 addition & 0 deletions accessible/windows/msaa/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "mozilla/WindowsVersion.h"
#include "mozilla/WinHeaderOnlyUtils.h"
#include "nsExceptionHandler.h"
#include "nsIXULRuntime.h"
#include "nsPrintfCString.h"
#include "nsUnicharUtils.h"
#include "nsWindowsDllInterceptor.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/windows/msaa/ImageAccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "ImageAccessibleWrap.h"
#include "nsIURI.h"

using namespace mozilla;
using namespace mozilla::a11y;
Expand Down
1 change: 0 additions & 1 deletion accessible/windows/msaa/MsaaIdGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "mozilla/StaticPtr.h"
#include "mozilla/Unused.h"
#include "nsDataHashtable.h"
#include "nsIXULRuntime.h"
#include "sdnAccessible.h"

// These constants may be adjusted to modify the proportion of the Child ID
Expand Down
Loading

0 comments on commit 69790bc

Please sign in to comment.