Bug 1204442 nsIDragService::FireDragEventAtSource() shouldn't be available from script because it takes a value of mozilla::EventMessage r=smaug, sr=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 15 Sep 2015 00:18:29 +0900
changeset 294975 13dc20d39faec37148234c5e2eb493be3a407ba5
parent 294974 c425e00cb6c5431550756a50aeb93230117b53da
child 294976 10ca891f6c35ffe97dfe6212460abe17b4d1e4b8
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, smaug
bugs1204442
milestone43.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 1204442 nsIDragService::FireDragEventAtSource() shouldn't be available from script because it takes a value of mozilla::EventMessage r=smaug, sr=smaug
widget/nsBaseDragService.cpp
widget/nsIDragService.idl
--- a/widget/nsBaseDragService.cpp
+++ b/widget/nsBaseDragService.cpp
@@ -391,27 +391,27 @@ nsBaseDragService::EndDragSession(bool a
   mScreenY = -1;
   mEndDragPoint = nsIntPoint(0, 0);
   mInputSource = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseDragService::FireDragEventAtSource(uint32_t aMsg)
+nsBaseDragService::FireDragEventAtSource(EventMessage aEventMessage)
 {
   if (mSourceNode && !mSuppressLevel) {
     nsCOMPtr<nsIDocument> doc = do_QueryInterface(mSourceDocument);
     if (doc) {
       nsCOMPtr<nsIPresShell> presShell = doc->GetShell();
       if (presShell) {
         nsEventStatus status = nsEventStatus_eIgnore;
-        WidgetDragEvent event(true, static_cast<EventMessage>(aMsg), nullptr);
+        WidgetDragEvent event(true, aEventMessage, nullptr);
         event.inputSource = mInputSource;
-        if (aMsg == eDragEnd) {
+        if (aEventMessage == eDragEnd) {
           event.refPoint.x = mEndDragPoint.x;
           event.refPoint.y = mEndDragPoint.y;
           event.userCancelled = mUserCancelled;
         }
 
         nsCOMPtr<nsIContent> content = do_QueryInterface(mSourceNode);
         return presShell->HandleDOMEventWithTarget(content, &event, &status);
       }
--- a/widget/nsIDragService.idl
+++ b/widget/nsIDragService.idl
@@ -11,26 +11,29 @@
 
 
 interface nsIDOMNode;
 interface nsIDOMDragEvent;
 interface nsIDOMDataTransfer;
 interface nsISelection;
 
 %{C++
+#include "mozilla/EventForwards.h"
+
 namespace mozilla {
 namespace dom {
 class ContentParent;
 } // namespace dom
 } // namespace mozilla
 %}
 
 [ptr] native ContentParentPtr(mozilla::dom::ContentParent);
+native EventMessage(mozilla::EventMessage);
 
-[scriptable, uuid(009d4489-4568-4896-9442-19717dd00f15), builtinclass]
+[scriptable, uuid(ebd6b3a2-af16-43af-a698-3091a087dd62), builtinclass]
 interface nsIDragService : nsISupports
 {
   const long DRAGDROP_ACTION_NONE = 0;
   const long DRAGDROP_ACTION_COPY = 1;
   const long DRAGDROP_ACTION_MOVE = 2;
   const long DRAGDROP_ACTION_LINK = 4;
   const long DRAGDROP_ACTION_UNINITIALIZED = 64;
 
@@ -109,17 +112,17 @@ interface nsIDragService : nsISupports
     * If aDoneDrag is true, the drag has finished, otherwise the drag has
     * just left the window.
     */
   void endDragSession ( in boolean aDoneDrag ) ;
 
   /**
    * Fire a drag event at the source of the drag
    */
-  void fireDragEventAtSource ( in unsigned long aMsg );
+  [noscript] void fireDragEventAtSource(in EventMessage aEventMessage);
 
   /**
    * Increase/decrease dragging suppress level by one.
    * If level is greater than one, dragging is disabled.
    */
   void suppress();
   void unsuppress();