Bug 1529345 - Part 1: Handle some missing includes. r=jimb
authorLogan Smyth <loganfsmyth@gmail.com>
Mon, 17 Jun 2019 04:36:02 +0000
changeset 541911 2cd3642e09439146f04f8fa0df888a6c67151460
parent 541910 5c58b59524413e9cabe781105e2c48c6d8a6e463
child 541912 e074fcc399d1090a72a35383a8158b4ab8b4e155
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1529345
milestone69.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 1529345 - Part 1: Handle some missing includes. r=jimb Differential Revision: https://phabricator.services.mozilla.com/D31902
dom/base/Attr.h
dom/base/DirectionalityUtils.cpp
dom/base/NodeUbiReporting.h
dom/base/ThirdPartyUtil.cpp
dom/base/ThirdPartyUtil.h
dom/base/nsDOMAttributeMap.h
dom/base/nsDataDocumentContentPolicy.cpp
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -7,16 +7,17 @@
 /*
  * Implementation of DOM Core's Attr node.
  */
 
 #ifndef mozilla_dom_Attr_h
 #define mozilla_dom_Attr_h
 
 #include "mozilla/Attributes.h"
+#include "nsDOMAttributeMap.h"
 #include "nsINode.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
 
 namespace mozilla {
 class EventChainPreVisitor;
--- a/dom/base/DirectionalityUtils.cpp
+++ b/dom/base/DirectionalityUtils.cpp
@@ -219,16 +219,17 @@
 #include "nsTextFragment.h"
 #include "nsAttrValue.h"
 #include "nsTextNode.h"
 #include "nsCheapSets.h"
 
 namespace mozilla {
 
 using mozilla::dom::Element;
+using mozilla::dom::HTMLSlotElement;
 using mozilla::dom::ShadowRoot;
 
 static nsIContent* GetParentOrHostOrSlot(
     nsIContent* aContent, bool* aCrossedShadowBoundary = nullptr) {
   mozilla::dom::HTMLSlotElement* slot = aContent->GetAssignedSlot();
   if (slot) {
     if (aCrossedShadowBoundary) {
       *aCrossedShadowBoundary = true;
--- a/dom/base/NodeUbiReporting.h
+++ b/dom/base/NodeUbiReporting.h
@@ -2,16 +2,18 @@
  * 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 dom_NodeUbiReporting_h
 #define dom_NodeUbiReporting_h
 
+#include "Attr.h"
+#include "Document.h"
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "nsINode.h"
 #include "js/UbiNode.h"
 
 /*
  * This file defines specializations of JS::ubi::Concrete for DOM nodes
  * so that the JS memory tools, which operate on the UbiNode graph, can
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -13,19 +13,21 @@
 #include "nsIDOMWindow.h"
 #include "nsILoadContext.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIURI.h"
 #include "nsReadableUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/ClearOnShutdown.h"
+#include "mozilla/dom/Document.h"
 #include "mozilla/Logging.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Unused.h"
+#include "nsGlobalWindowOuter.h"
 #include "nsPIDOMWindow.h"
 
 NS_IMPL_ISUPPORTS(ThirdPartyUtil, mozIThirdPartyUtil)
 
 //
 // MOZ_LOG=thirdPartyUtil:5
 //
 static mozilla::LazyLogModule gThirdPartyLog("thirdPartyUtil");
@@ -87,16 +89,26 @@ nsresult ThirdPartyUtil::IsThirdPartyInt
   LOG(("ThirdPartyUtil::IsThirdPartyInternal %s =? %s", aFirstDomain.get(),
        secondDomain.get()));
   if (NS_FAILED(rv)) return rv;
 
   *aResult = IsThirdPartyInternal(aFirstDomain, secondDomain);
   return NS_OK;
 }
 
+nsCString ThirdPartyUtil::GetBaseDomainFromWindow(nsPIDOMWindowOuter* aWindow) {
+  mozilla::dom::Document* doc = aWindow ? aWindow->GetExtantDoc() : nullptr;
+
+  if (!doc) {
+    return EmptyCString();
+  }
+
+  return doc->GetBaseDomain();
+}
+
 NS_IMETHODIMP
 ThirdPartyUtil::GetPrincipalFromWindow(mozIDOMWindowProxy* aWin,
                                        nsIPrincipal** result) {
   nsCOMPtr<nsIScriptObjectPrincipal> scriptObjPrin = do_QueryInterface(aWin);
   if (!scriptObjPrin) {
     return NS_ERROR_INVALID_ARG;
   }
 
--- a/dom/base/ThirdPartyUtil.h
+++ b/dom/base/ThirdPartyUtil.h
@@ -9,16 +9,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsEffectiveTLDService.h"
 #include "mozilla/Attributes.h"
 
 class nsIURI;
+class nsPIDOMWindowOuter;
 
 class ThirdPartyUtil final : public mozIThirdPartyUtil {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_MOZITHIRDPARTYUTIL
 
   nsresult Init();
 
@@ -31,22 +32,14 @@ class ThirdPartyUtil final : public mozI
   bool IsThirdPartyInternal(const nsCString& aFirstDomain,
                             const nsCString& aSecondDomain) {
     // Check strict equality.
     return aFirstDomain != aSecondDomain;
   }
   nsresult IsThirdPartyInternal(const nsCString& aFirstDomain,
                                 nsIURI* aSecondURI, bool* aResult);
 
-  nsCString GetBaseDomainFromWindow(nsPIDOMWindowOuter* aWindow) {
-    mozilla::dom::Document* doc = aWindow ? aWindow->GetExtantDoc() : nullptr;
-
-    if (!doc) {
-      return EmptyCString();
-    }
-
-    return doc->GetBaseDomain();
-  }
+  nsCString GetBaseDomainFromWindow(nsPIDOMWindowOuter* aWindow);
 
   RefPtr<nsEffectiveTLDService> mTLDService;
 };
 
 #endif
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -7,28 +7,32 @@
 /*
  * Implementation of the |attributes| property of DOM Core's Element object.
  */
 
 #ifndef nsDOMAttributeMap_h
 #define nsDOMAttributeMap_h
 
 #include "mozilla/MemoryReporting.h"
-#include "mozilla/dom/Attr.h"
 #include "mozilla/ErrorResult.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "nsWrapperCache.h"
 
 class nsAtom;
+class nsINode;
 
 namespace mozilla {
 namespace dom {
+class Attr;
 class DocGroup;
+class Document;
+class Element;
+class NodeInfo;
 }  // namespace dom
 }  // namespace mozilla
 
 /**
  * Structure used as a key for caching Attrs in nsDOMAttributeMap's
  * mAttributeCache.
  */
 class nsAttrKey {
--- a/dom/base/nsDataDocumentContentPolicy.cpp
+++ b/dom/base/nsDataDocumentContentPolicy.cpp
@@ -6,16 +6,17 @@
 
 /*
  * Content policy implementation that prevents all loads of images,
  * subframes, etc from documents loaded as data (eg documents loaded
  * via XMLHttpRequest).
  */
 
 #include "nsContentUtils.h"
+#include "nsContentPolicyUtils.h"
 #include "nsDataDocumentContentPolicy.h"
 #include "nsNetUtil.h"
 #include "nsIProtocolHandler.h"
 #include "nsScriptSecurityManager.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/ScopeExit.h"
 #include "nsINode.h"
 #include "nsIDOMWindow.h"
@@ -35,17 +36,17 @@ static bool HasFlags(nsIURI* aURI, uint3
 // If you change DataDocumentContentPolicy, make sure to check that
 // CHECK_PRINCIPAL_AND_DATA in nsContentPolicyUtils is still valid.
 // nsContentPolicyUtils may not pass all the parameters to ShouldLoad.
 NS_IMETHODIMP
 nsDataDocumentContentPolicy::ShouldLoad(nsIURI* aContentLocation,
                                         nsILoadInfo* aLoadInfo,
                                         const nsACString& aMimeGuess,
                                         int16_t* aDecision) {
-  auto setBlockingReason = MakeScopeExit([&]() {
+  auto setBlockingReason = mozilla::MakeScopeExit([&]() {
     if (NS_CP_REJECTED(*aDecision)) {
       NS_SetRequestBlockingReason(
           aLoadInfo, nsILoadInfo::BLOCKING_REASON_CONTENT_POLICY_DATA_DOCUMENT);
     }
   });
 
   uint32_t contentType = aLoadInfo->GetExternalContentPolicyType();
   nsCOMPtr<nsISupports> requestingContext = aLoadInfo->GetLoadingContext();