Bug 1449631 part 12. Remove the Nullable smuggling from nsIDOMEventTarget. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 05 Apr 2018 13:42:42 -0400
changeset 456884 27805d201b9009bf17a508dff2c840a2e919907f
parent 456883 6cf7b2b773dbefb08a1ca8f0a63ad5d8194b2f94
child 456885 d32c2aed28868ecd1d7aa1db701df5f07a256e07
push id153
push userfmarier@mozilla.com
push dateTue, 10 Apr 2018 02:28:40 +0000
reviewerssmaug
bugs1449631
milestone61.0a1
Bug 1449631 part 12. Remove the Nullable smuggling from nsIDOMEventTarget. r=smaug MozReview-Commit-ID: 73qhRSCpr3S
dom/animation/ComputedTiming.h
dom/animation/KeyframeUtils.cpp
dom/animation/PendingAnimationTracker.cpp
dom/base/nsDOMMutationObserver.h
dom/canvas/WebGLContext.h
dom/interfaces/events/nsIDOMEventTarget.idl
gfx/layers/AnimationHelper.cpp
layout/style/AnimationCommon.h
toolkit/components/extensions/WebExtensionPolicy.h
--- a/dom/animation/ComputedTiming.h
+++ b/dom/animation/ComputedTiming.h
@@ -30,17 +30,17 @@ struct ComputedTiming
   // The effect end time in local time (i.e. an offset from the effect's
   // start time). Will equal StickyTimeDuration::Forever() if the animation
   // plays indefinitely.
   StickyTimeDuration  mEndTime;
   // Progress towards the end of the current iteration. If the effect is
   // being sampled backwards, this will go from 1.0 to 0.0.
   // Will be null if the animation is neither animating nor
   // filling at the sampled time.
-  Nullable<double>    mProgress;
+  dom::Nullable<double>    mProgress;
   // Zero-based iteration index (meaningless if mProgress is null).
   uint64_t            mCurrentIteration = 0;
   // Unlike TimingParams::mIterations, this value is
   // guaranteed to be in the range [0, Infinity].
   double              mIterations = 1.0;
   double              mIterationStart = 0.0;
   StickyTimeDuration  mDuration;
 
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -14,29 +14,32 @@
 #include "mozilla/ServoBindingTypes.h"
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/TimingParams.h"
 #include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc.
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/dom/KeyframeEffectReadOnly.h" // For PropertyValuesPair etc.
+#include "mozilla/dom/Nullable.h"
 #include "jsapi.h" // For ForOfIterator etc.
 #include "nsClassHashtable.h"
 #include "nsContentUtils.h" // For GetContextForContent, and
                             // AnimationsAPICoreEnabled
 #include "nsCSSParser.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsCSSProps.h"
 #include "nsCSSPseudoElements.h" // For CSSPseudoElementType
 #include "nsDocument.h" // For nsDocument::IsWebAnimationsEnabled
 #include "nsIScriptError.h"
 #include "nsTArray.h"
 #include <algorithm> // For std::stable_sort, std::min
 
+using mozilla::dom::Nullable;
+
 namespace mozilla {
 
 // ------------------------------------------------------------------
 //
 // Internal data types
 //
 // ------------------------------------------------------------------
 
--- a/dom/animation/PendingAnimationTracker.cpp
+++ b/dom/animation/PendingAnimationTracker.cpp
@@ -2,20 +2,21 @@
 /* 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 "PendingAnimationTracker.h"
 
 #include "mozilla/dom/AnimationTimeline.h"
+#include "mozilla/dom/Nullable.h"
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
 
-using namespace mozilla;
+using mozilla::dom::Nullable;
 
 namespace mozilla {
 
 NS_IMPL_CYCLE_COLLECTION(PendingAnimationTracker,
                          mPlayPendingSet,
                          mPausePendingSet,
                          mDocument)
 
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -16,16 +16,17 @@
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsIVariant.h"
 #include "nsContentList.h"
 #include "mozilla/dom/Element.h"
 #include "nsClassHashtable.h"
 #include "nsNodeUtils.h"
 #include "nsWrapperCache.h"
+#include "mozilla/dom/Nullable.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "mozilla/dom/MutationObserverBinding.h"
 #include "nsIDocument.h"
 #include "mozilla/dom/Animation.h"
 #include "nsIAnimationObserver.h"
 #include "nsGlobalWindow.h"
 
 class nsDOMMutationObserver;
@@ -525,18 +526,19 @@ public:
                mozilla::ErrorResult& aRv);
 
   void Disconnect();
 
   void TakeRecords(nsTArray<RefPtr<nsDOMMutationRecord> >& aRetVal);
 
   void HandleMutation();
 
-  void GetObservingInfo(nsTArray<Nullable<MutationObservingInfo>>& aResult,
-                        mozilla::ErrorResult& aRv);
+  void GetObservingInfo(
+    nsTArray<mozilla::dom::Nullable<MutationObservingInfo>>& aResult,
+    mozilla::ErrorResult& aRv);
 
   mozilla::dom::MutationCallback* MutationCallback() { return mCallback; }
 
   bool MergeAttributeRecords()
   {
     return mMergeAttributeRecords;
   }
 
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -9,16 +9,17 @@
 #include <stdarg.h>
 
 #include "GLContextTypes.h"
 #include "GLDefs.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
+#include "mozilla/dom/Nullable.h"
 #include "mozilla/dom/TypedArray.h"
 #include "mozilla/EnumeratedArray.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/UniquePtr.h"
 #include "nsCycleCollectionNoteChild.h"
 #include "nsICanvasRenderingContextInternal.h"
@@ -85,17 +86,16 @@ class WebGLTransformFeedback;
 class WebGLUniformLocation;
 class WebGLVertexArray;
 
 namespace dom {
 class Element;
 class ImageData;
 class OwningHTMLCanvasElementOrOffscreenCanvas;
 struct WebGLContextAttributes;
-template<typename> struct Nullable;
 } // namespace dom
 
 namespace gfx {
 class SourceSurface;
 class VRLayerChild;
 } // namespace gfx
 
 namespace gl {
@@ -509,17 +509,17 @@ public:
     void AssertCachedBindings() const;
     void AssertCachedGlobalState() const;
 
     dom::HTMLCanvasElement* GetCanvas() const { return mCanvasElement; }
     nsIDocument* GetOwnerDoc() const;
 
     // WebIDL WebGLRenderingContext API
     void Commit();
-    void GetCanvas(Nullable<dom::OwningHTMLCanvasElementOrOffscreenCanvas>& retval);
+    void GetCanvas(dom::Nullable<dom::OwningHTMLCanvasElementOrOffscreenCanvas>& retval);
 private:
     gfx::IntSize DrawingBufferSize(const char* funcName);
 public:
     GLsizei DrawingBufferWidth(const char* const funcName = "drawingBufferWidth") {
         return DrawingBufferSize(funcName).width;
     }
     GLsizei DrawingBufferHeight(const char* const funcName = "drawingBufferHeight") {
         return DrawingBufferSize(funcName).height;
--- a/dom/interfaces/events/nsIDOMEventTarget.idl
+++ b/dom/interfaces/events/nsIDOMEventTarget.idl
@@ -1,16 +1,11 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "domstubs.idl"
 
-%{C++
-#include "mozilla/dom/Nullable.h"
-using mozilla::dom::Nullable;
-%}
-
 [uuid(9a78ac3c-9507-4d00-b2d6-10b508d2ec31)]
 interface nsIDOMEventTarget : nsISupports
 {
 };
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -4,16 +4,17 @@
  * 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 "AnimationHelper.h"
 #include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction
 #include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for dom::FillMode
 #include "mozilla/dom/KeyframeEffectBinding.h" // for dom::IterationComposite
 #include "mozilla/dom/KeyframeEffectReadOnly.h" // for dom::KeyFrameEffectReadOnly
+#include "mozilla/dom/Nullable.h" // for dom::Nullable
 #include "mozilla/layers/CompositorThread.h" // for CompositorThreadHolder
 #include "mozilla/layers/LayerAnimationUtils.h" // for TimingFunctionToComputedTimingFunction
 #include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc
 #include "nsDeviceContext.h"            // for AppUnitsPerCSSPixel
 #include "nsDisplayList.h"              // for nsDisplayTransform, etc
 
 namespace mozilla {
 namespace layers {
@@ -178,17 +179,17 @@ AnimationHelper::SampleAnimationForEachN
       static_cast<dom::PlaybackDirection>(animation.direction()),
       static_cast<dom::FillMode>(animation.fillMode()),
       Move(AnimationUtils::TimingFunctionToComputedTimingFunction(
            animation.easingFunction()))
     };
 
     ComputedTiming computedTiming =
       dom::AnimationEffectReadOnly::GetComputedTimingAt(
-        Nullable<TimeDuration>(elapsedDuration), timing,
+        dom::Nullable<TimeDuration>(elapsedDuration), timing,
         animation.playbackRate());
 
     if (computedTiming.mProgress.IsNull()) {
       continue;
     }
 
     uint32_t segmentIndex = 0;
     size_t segmentSize = animation.segments().Length();
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -8,16 +8,17 @@
 #define mozilla_css_AnimationCommon_h
 
 #include "mozilla/AnimationCollection.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/Attributes.h" // For MOZ_NON_OWNING_REF
 #include "mozilla/Assertions.h"
 #include "mozilla/TimingParams.h"
+#include "mozilla/dom/Nullable.h"
 #include "nsContentUtils.h"
 
 class nsIFrame;
 class nsPresContext;
 
 namespace mozilla {
 enum class CSSPseudoElementType : uint8_t;
 
@@ -166,17 +167,17 @@ PhaseType GetAnimationPhaseWithoutEffect
              "Should only be called when we do not have an effect");
 
 // GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
 // GetTickCount().
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 
-  Nullable<TimeDuration> currentTime = aAnimation.GetCurrentTime();
+  dom::Nullable<TimeDuration> currentTime = aAnimation.GetCurrentTime();
   if (currentTime.IsNull()) {
     return PhaseType::Idle;
   }
 
   // If we don't have a target effect, the duration will be zero so the phase is
   // 'before' if the current time is less than zero.
   return currentTime.Value() < TimeDuration()
          ? PhaseType::Before
--- a/toolkit/components/extensions/WebExtensionPolicy.h
+++ b/toolkit/components/extensions/WebExtensionPolicy.h
@@ -2,16 +2,17 @@
 /* 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 mozilla_extensions_WebExtensionPolicy_h
 #define mozilla_extensions_WebExtensionPolicy_h
 
 #include "mozilla/dom/BindingDeclarations.h"
+#include "mozilla/dom/Nullable.h"
 #include "mozilla/dom/WebExtensionPolicyBinding.h"
 #include "mozilla/extensions/MatchPattern.h"
 
 #include "jspubtd.h"
 
 #include "mozilla/Result.h"
 #include "mozilla/WeakPtr.h"
 #include "nsCOMPtr.h"
@@ -185,17 +186,17 @@ private:
   bool mActive = false;
 
   RefPtr<WebExtensionLocalizeCallback> mLocalizeCallback;
 
   RefPtr<AtomSet> mPermissions;
   RefPtr<MatchPatternSet> mHostPermissions;
   MatchGlobSet mWebAccessiblePaths;
 
-  Nullable<nsTArray<nsString>> mBackgroundScripts;
+  dom::Nullable<nsTArray<nsString>> mBackgroundScripts;
 
   nsTArray<RefPtr<WebExtensionContentScript>> mContentScripts;
 };
 
 } // namespace extensions
 } // namespace mozilla
 
 #endif // mozilla_extensions_WebExtensionPolicy_h