зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1309139 - Get rid of NS_NewDOMMessageEvent, r=smaug
This commit is contained in:
Родитель
19a783cce8
Коммит
4f20f137bf
|
@ -1078,8 +1078,7 @@ EventSource::DispatchAllMessageEvents()
|
|||
// create an event that uses the MessageEvent interface,
|
||||
// which does not bubble, is not cancelable, and has no default action
|
||||
|
||||
RefPtr<MessageEvent> event =
|
||||
NS_NewDOMMessageEvent(this, nullptr, nullptr);
|
||||
RefPtr<MessageEvent> event = new MessageEvent(this, nullptr, nullptr);
|
||||
|
||||
event->InitMessageEvent(nullptr, message->mEventName, false, false, jsData,
|
||||
mOrigin, message->mLastEventID, nullptr, nullptr);
|
||||
|
|
|
@ -2005,7 +2005,7 @@ WebSocket::CreateAndDispatchMessageEvent(const nsACString& aData,
|
|||
// create an event that uses the MessageEvent interface,
|
||||
// which does not bubble, is not cancelable, and has no default action
|
||||
|
||||
RefPtr<MessageEvent> event = NS_NewDOMMessageEvent(this, nullptr, nullptr);
|
||||
RefPtr<MessageEvent> event = new MessageEvent(this, nullptr, nullptr);
|
||||
|
||||
event->InitMessageEvent(nullptr, NS_LITERAL_STRING("message"), false, false,
|
||||
jsData, mImpl->mUTF16Origin, EmptyString(), nullptr,
|
||||
|
|
|
@ -402,7 +402,7 @@ nsDOMDataChannel::DoOnMessageAvailable(const nsACString& aData,
|
|||
jsData.setString(jsString);
|
||||
}
|
||||
|
||||
RefPtr<MessageEvent> event = NS_NewDOMMessageEvent(this, nullptr, nullptr);
|
||||
RefPtr<MessageEvent> event = new MessageEvent(this, nullptr, nullptr);
|
||||
|
||||
event->InitMessageEvent(nullptr, NS_LITERAL_STRING("message"), false, false,
|
||||
jsData, mOrigin, EmptyString(), nullptr, nullptr);
|
||||
|
|
|
@ -995,7 +995,8 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
|
|||
}
|
||||
if (aEventType.LowerCaseEqualsLiteral("messageevent")) {
|
||||
LOG_EVENT_CREATION(MESSAGEEVENT);
|
||||
return NS_NewDOMMessageEvent(aOwner, aPresContext, nullptr);
|
||||
RefPtr<Event> event = new MessageEvent(aOwner, aPresContext, nullptr);
|
||||
return event.forget();
|
||||
}
|
||||
if (aEventType.LowerCaseEqualsLiteral("notifypaintevent")) {
|
||||
LOG_EVENT_CREATION(NOTIFYPAINTEVENT);
|
||||
|
|
|
@ -205,15 +205,3 @@ MessageEvent::SetSource(mozilla::dom::MessagePort* aPort)
|
|||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
already_AddRefed<MessageEvent>
|
||||
NS_NewDOMMessageEvent(EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent)
|
||||
{
|
||||
RefPtr<MessageEvent> it = new MessageEvent(aOwner, aPresContext, aEvent);
|
||||
return it.forget();
|
||||
}
|
||||
|
|
|
@ -97,9 +97,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
already_AddRefed<mozilla::dom::MessageEvent>
|
||||
NS_NewDOMMessageEvent(mozilla::dom::EventTarget* aOwner,
|
||||
nsPresContext* aPresContext,
|
||||
mozilla::WidgetEvent* aEvent);
|
||||
|
||||
#endif // mozilla_dom_MessageEvent_h_
|
||||
|
|
|
@ -575,8 +575,7 @@ PresentationConnection::DispatchMessageEvent(JS::Handle<JS::Value> aData)
|
|||
return rv;
|
||||
}
|
||||
|
||||
RefPtr<MessageEvent> messageEvent =
|
||||
NS_NewDOMMessageEvent(this, nullptr, nullptr);
|
||||
RefPtr<MessageEvent> messageEvent = new MessageEvent(this, nullptr, nullptr);
|
||||
|
||||
messageEvent->InitMessageEvent(nullptr,
|
||||
NS_LITERAL_STRING("message"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче