Skip to content

Commit

Permalink
Bug 1609996 - Reorder some includes affected by the previous patches.…
Browse files Browse the repository at this point in the history
… r=froydnj

This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
emilio committed Jan 20, 2020
1 parent b4600e6 commit 256c124
Show file tree
Hide file tree
Showing 235 changed files with 1,581 additions and 1,461 deletions.
1 change: 1 addition & 0 deletions accessible/base/TextRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define mozilla_a11y_TextRange_h__

#include <utility>

#include "nsCaseTreatment.h"
#include "nsRect.h"
#include "nsTArray.h"
Expand Down
11 changes: 6 additions & 5 deletions accessible/ipc/win/COMPtrTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

#include "mozilla/a11y/COMPtrTypes.h"

#include <utility>

#include "MainThreadUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/Preferences.h"
#include "mozilla/RefPtr.h"
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/Platform.h"
#include "mozilla/a11y/HandlerProvider.h"
#include "mozilla/Assertions.h"
#include <utility>
#include "mozilla/a11y/Platform.h"
#include "mozilla/mscom/MainThreadHandoff.h"
#include "mozilla/mscom/Utils.h"
#include "mozilla/Preferences.h"
#include "mozilla/RefPtr.h"
#include "nsXULAppAPI.h"

using mozilla::mscom::MainThreadHandoff;
Expand Down
11 changes: 6 additions & 5 deletions accessible/ipc/win/HandlerProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#include "mozilla/a11y/HandlerProvider.h"

#include <memory.h>

#include <utility>

#include "Accessible2_3.h"
#include "AccessibleDocument.h"
#include "AccessibleRelation.h"
Expand All @@ -15,10 +19,10 @@
#include "HandlerData.h"
#include "HandlerData_i.c"
#include "mozilla/Assertions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/a11y/AccessibleWrap.h"
#include "mozilla/a11y/HandlerDataCleanup.h"
#include "mozilla/dom/ContentChild.h"
#include <utility>
#include "mozilla/mscom/AgileReference.h"
#include "mozilla/mscom/FastMarshaler.h"
#include "mozilla/mscom/Interceptor.h"
Expand All @@ -27,11 +31,8 @@
#include "mozilla/mscom/Ptr.h"
#include "mozilla/mscom/StructStream.h"
#include "mozilla/mscom/Utils.h"
#include "mozilla/UniquePtr.h"
#include "nsThreadUtils.h"
#include "nsTArray.h"

#include <memory.h>
#include "nsThreadUtils.h"

namespace mozilla {
namespace a11y {
Expand Down
5 changes: 2 additions & 3 deletions accessible/ipc/win/handler/AccessibleHandlerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

#include "AccessibleHandlerControl.h"

#include "AccessibleHandler.h"
#include <utility>

#include "AccessibleEventId.h"

#include <utility>
#include "AccessibleHandler.h"
#include "mozilla/RefPtr.h"

namespace mozilla {
Expand Down
6 changes: 3 additions & 3 deletions accessible/xpcom/xpcAccessibleTextRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#ifndef mozilla_a11y_xpcAccessibleTextRange_h_
#define mozilla_a11y_xpcAccessibleTextRange_h_

#include "nsIAccessibleTextRange.h"
#include "TextRange.h"

#include <utility>

#include "TextRange.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIAccessibleTextRange.h"

namespace mozilla {
namespace a11y {
Expand Down
9 changes: 5 additions & 4 deletions browser/app/winlauncher/ErrorHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@

#include "ErrorHandler.h"

#include <utility>

#include "mozilla/ArrayUtils.h"
#include "mozilla/CmdLineAndEnvUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/glue/WindowsDllServices.h"
#include "mozilla/JSONWriter.h"
#include <utility>
#include "mozilla/mscom/ProcessRuntime.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/WinTokenUtils.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/XREAppData.h"
#include "mozilla/glue/WindowsDllServices.h"
#include "mozilla/mscom/ProcessRuntime.h"
#include "nsWindowsHelpers.h"

#if defined(MOZ_LAUNCHER_PROCESS)
Expand Down
7 changes: 4 additions & 3 deletions browser/app/winlauncher/ProcThreadAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
#ifndef mozilla_ProcThreadAttributes_h
#define mozilla_ProcThreadAttributes_h

#include <windows.h>

#include <utility>

#include "mozilla/Attributes.h"
#include "mozilla/Maybe.h"
#include <utility>
#include "mozilla/UniquePtr.h"
#include "mozilla/Vector.h"

#include <windows.h>

namespace mozilla {

class MOZ_RAII ProcThreadAttributes final {
Expand Down
10 changes: 5 additions & 5 deletions browser/app/winlauncher/test/TestSameBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "SameBinary.h"
#include <stdio.h>
#include <stdlib.h>

#include <utility>

#include "SameBinary.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/CmdLineAndEnvUtils.h"
#include <utility>
#include "mozilla/NativeNt.h"
#include "mozilla/Unused.h"
#include "mozilla/Vector.h"
#include "mozilla/WinHeaderOnlyUtils.h"
#include "nsWindowsHelpers.h"

#include <stdio.h>
#include <stdlib.h>

#define EXPECT_SAMEBINARY_IS(expected, option, message) \
do { \
mozilla::LauncherResult<bool> isSame = \
Expand Down
5 changes: 3 additions & 2 deletions chrome/nsChromeRegistryChrome.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
#ifndef nsChromeRegistryChrome_h
#define nsChromeRegistryChrome_h

#include <utility>

#include "nsCOMArray.h"
#include "nsChromeRegistry.h"
#include "nsTArray.h"
#include <utility>
#include "nsClassHashtable.h"
#include "nsTArray.h"

namespace mozilla {
namespace dom {
Expand Down
5 changes: 3 additions & 2 deletions devtools/shared/heapsnapshot/DeserializedNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
#ifndef mozilla_devtools_DeserializedNode__
#define mozilla_devtools_DeserializedNode__

#include <utility>

#include "js/UbiNode.h"
#include "js/UniquePtr.h"
#include "mozilla/devtools/CoreDump.pb.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/Maybe.h"
#include <utility>
#include "mozilla/Vector.h"
#include "mozilla/devtools/CoreDump.pb.h"

// `Deserialized{Node,Edge}` translate protobuf messages from our core dump
// format into structures we can rely upon for implementing `JS::ubi::Node`
Expand Down
18 changes: 9 additions & 9 deletions devtools/shared/heapsnapshot/tests/gtest/DevTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
#ifndef mozilla_devtools_gtest_DevTools__
#define mozilla_devtools_gtest_DevTools__

#include "CoreDump.pb.h"
#include "jsapi.h"
#include "jspubtd.h"
#include "nsCRTGlue.h"
#include <utility>

#include "gtest/gtest.h"
#include "CoreDump.pb.h"
#include "gmock/gmock.h"
#include "mozilla/devtools/HeapSnapshot.h"
#include "mozilla/dom/ChromeUtils.h"
#include "mozilla/CycleCollectedJSContext.h"
#include <utility>
#include "gtest/gtest.h"
#include "js/Principals.h"
#include "js/UbiNode.h"
#include "js/UniquePtr.h"
#include "jsapi.h"
#include "jspubtd.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/devtools/HeapSnapshot.h"
#include "mozilla/dom/ChromeUtils.h"
#include "nsCRTGlue.h"

using namespace mozilla;
using namespace mozilla::devtools;
Expand Down
40 changes: 18 additions & 22 deletions docshell/base/nsDocShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,35 @@
#ifndef nsDocShell_h__
#define nsDocShell_h__

#include <utility>

#include "GeckoProfiler.h"
#include "Units.h"
#include "jsapi.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/HalScreenConfiguration.h"
#include "mozilla/LinkedList.h"
#include "mozilla/Maybe.h"
#include <utility>
#include "mozilla/ObservedDocShell.h"
#include "mozilla/ScrollbarPreferences.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/TimelineConsumers.h"
#include "mozilla/TimelineMarker.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/WeakPtr.h"

#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
#include "mozilla/gfx/Matrix.h"
#include "mozilla/dom/ChildSHistory.h"
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
#include "mozilla/dom/WindowProxyHolder.h"

#include "mozilla/gfx/Matrix.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsCharsetSource.h"
#include "nsContentPolicyUtils.h"
#include "nsContentUtils.h"
#include "nsDocLoader.h"
#include "nsIAuthPromptProvider.h"
#include "nsIBaseWindow.h"
#include "nsIDeprecationWarner.h"
Expand All @@ -36,28 +49,11 @@
#include "nsIWebNavigation.h"
#include "nsIWebPageDescriptor.h"
#include "nsIWebProgressListener.h"

#include "nsAutoPtr.h"
#include "nsCharsetSource.h"
#include "nsCOMPtr.h"
#include "nsContentPolicyUtils.h"
#include "nsContentUtils.h"
#include "nsCRT.h"
#include "nsDocLoader.h"
#include "nsPoint.h" // mCurrent/mDefaultScrollbarPreferences
#include "nsRect.h"
#include "nsString.h"
#include "nsThreadUtils.h"

#include "GeckoProfiler.h"
#include "jsapi.h"
#include "prtime.h"
#include "Units.h"

#include "mozilla/ObservedDocShell.h"
#include "mozilla/ScrollbarPreferences.h"
#include "mozilla/TimelineConsumers.h"
#include "mozilla/TimelineMarker.h"

// Interfaces Needed

Expand Down
3 changes: 2 additions & 1 deletion docshell/base/timeline/ObservedDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

#include "ObservedDocShell.h"

#include <utility>

#include "AbstractTimelineMarker.h"
#include "LayerTimelineMarker.h"
#include "MainThreadUtils.h"
#include <utility>
#include "mozilla/AutoRestore.h"

namespace mozilla {
Expand Down
19 changes: 10 additions & 9 deletions dom/animation/KeyframeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,34 @@

#include "mozilla/KeyframeUtils.h"

#include <algorithm> // For std::stable_sort, std::min
#include <utility>

#include "js/ForOfIterator.h" // For JS::ForOfIterator
#include "jsapi.h" // For most JSAPI
#include "mozilla/ComputedStyle.h"
#include "mozilla/ErrorResult.h"
#include <utility>
#include "mozilla/RangedArray.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/ServoCSSParser.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/TimingParams.h"
#include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc.
#include "mozilla/dom/Document.h" // For Document::AreWebAnimationsImplicitKeyframesEnabled
#include "mozilla/dom/Element.h"
#include "mozilla/dom/KeyframeEffectBinding.h"
#include "mozilla/dom/KeyframeEffect.h" // For PropertyValuesPair etc.
#include "mozilla/dom/KeyframeEffectBinding.h"
#include "mozilla/dom/Nullable.h"
#include "jsapi.h" // For most JSAPI
#include "js/ForOfIterator.h" // For JS::ForOfIterator
#include "nsClassHashtable.h"
#include "nsContentUtils.h" // For GetContextForContent
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h"
#include "nsCSSPseudoElements.h" // For PseudoStyleType
#include "nsClassHashtable.h"
#include "nsContentUtils.h" // For GetContextForContent
#include "nsIScriptError.h"
#include "nsPresContextInlines.h"
#include "nsTArray.h"
#include <algorithm> // For std::stable_sort, std::min

using mozilla::dom::Nullable;

Expand Down
7 changes: 3 additions & 4 deletions dom/base/IdentifierMapEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
#ifndef mozilla_IdentifierMapEntry_h
#define mozilla_IdentifierMapEntry_h

#include "PLDHashTable.h"
#include <utility>

#include "PLDHashTable.h"
#include "mozilla/MemoryReporting.h"
#include <utility>
#include "mozilla/dom/TreeOrderedArray.h"

#include "nsAtom.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsAtom.h"
#include "nsHashKeys.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
Expand Down
5 changes: 3 additions & 2 deletions dom/base/StructuredCloneHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#ifndef mozilla_dom_StructuredCloneHolder_h
#define mozilla_dom_StructuredCloneHolder_h

#include "jsapi.h"
#include <utility>

#include "js/StructuredClone.h"
#include "jsapi.h"
#include "mozilla/MemoryReporting.h"
#include <utility>
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "nsTArray.h"
Expand Down
Loading

0 comments on commit 256c124

Please sign in to comment.