Bug 1551169 - Mark AutoHandlingUserInputStatePusher as MOZ_RAII; r=smaug
authorEdgar Chen <echen@mozilla.com>
Mon, 13 May 2019 12:11:48 +0000
changeset 532413 0236578639fa675965fb3c0c65e1e1c6984f28f0
parent 532412 8990b9990220bf229abe7c5f5ec6934802559af2
child 532414 1983145fd5e53c8d355ca980131fc0c2f6552bf0
push id11268
push usercsabou@mozilla.com
push dateTue, 14 May 2019 15:24:22 +0000
treeherdermozilla-beta@5fb7fcd568d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1551169
milestone68.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 1551169 - Mark AutoHandlingUserInputStatePusher as MOZ_RAII; r=smaug Differential Revision: https://phabricator.services.mozilla.com/D30881
dom/events/EventStateManager.h
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -1278,36 +1278,31 @@ class EventStateManager : public nsSuppo
                                                 nsIContent* aElement);
   static void sClickHoldCallback(nsITimer* aTimer, void* aESM);
 };
 
 /**
  * This class is used while processing real user input. During this time, popups
  * are allowed. For mousedown events, mouse capturing is also permitted.
  */
-class AutoHandlingUserInputStatePusher {
+class MOZ_RAII AutoHandlingUserInputStatePusher final {
  public:
   AutoHandlingUserInputStatePusher(bool aIsHandlingUserInput,
                                    WidgetEvent* aEvent,
                                    dom::Document* aDocument);
   ~AutoHandlingUserInputStatePusher();
 
  protected:
   RefPtr<dom::Document> mMouseButtonEventHandlingDocument;
   EventMessage mMessage;
   bool mIsHandlingUserInput;
 
   bool NeedsToResetFocusManagerMouseButtonHandlingState() const {
     return mMessage == eMouseDown || mMessage == eMouseUp;
   }
-
- private:
-  // Hide so that this class can only be stack-allocated
-  static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nullptr; }
-  static void operator delete(void* /*memory*/) {}
 };
 
 }  // namespace mozilla
 
 // Click and double-click events need to be handled even for content that
 // has no frame. This is required for Web compatibility.
 #define NS_EVENT_NEEDS_FRAME(event)               \
   (!(event)->HasPluginActivationEventMessage() && \