Bug 1311324 P2 Replace usage of ServiceWorkerMessageEvent with MessageEvent. r=bz

This commit is contained in:
Ben Kelly 2017-03-09 15:35:21 -05:00
Родитель 99905d5873
Коммит 94f89a287f
4 изменённых файлов: 8 добавлений и 18 удалений

Просмотреть файл

@ -95,13 +95,8 @@ BroadcastChannelChild::RecvNotify(const ClonedMessageData& aData)
init.mOrigin = mOrigin;
init.mData = value;
ErrorResult rv;
RefPtr<MessageEvent> event =
MessageEvent::Constructor(mBC, NS_LITERAL_STRING("message"), init, rv);
if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return IPC_OK();
}
MessageEvent::Constructor(mBC, NS_LITERAL_STRING("message"), init);
event->SetTrusted(true);

Просмотреть файл

@ -105,14 +105,13 @@ MessageEvent::Constructor(const GlobalObject& aGlobal,
ErrorResult& aRv)
{
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(t, aType, aParam, aRv);
return Constructor(t, aType, aParam);
}
/* static */ already_AddRefed<MessageEvent>
MessageEvent::Constructor(EventTarget* aEventTarget,
const nsAString& aType,
const MessageEventInit& aParam,
ErrorResult& aRv)
const MessageEventInit& aParam)
{
RefPtr<MessageEvent> event = new MessageEvent(aEventTarget, nullptr, nullptr);

Просмотреть файл

@ -62,8 +62,7 @@ public:
static already_AddRefed<MessageEvent>
Constructor(EventTarget* aEventTarget,
const nsAString& aType,
const MessageEventInit& aEventInit,
ErrorResult& aRv);
const MessageEventInit& aEventInit);
void InitMessageEvent(JSContext* aCx, const nsAString& aType, bool aCanBubble,
bool aCancelable, JS::Handle<JS::Value> aData,

Просмотреть файл

@ -10,8 +10,6 @@
#include "mozilla/dom/MessageEvent.h"
#include "mozilla/dom/Navigator.h"
#include "mozilla/dom/ServiceWorkerMessageEvent.h"
#include "mozilla/dom/ServiceWorkerMessageEventBinding.h"
#include "nsGlobalWindow.h"
#include "nsIBrowserDOMWindow.h"
#include "nsIDocument.h"
@ -182,7 +180,7 @@ private:
return NS_ERROR_FAILURE;
}
RootedDictionary<ServiceWorkerMessageEventInit> init(aCx);
RootedDictionary<MessageEventInit> init(aCx);
nsCOMPtr<nsIPrincipal> principal = aTargetContainer->GetParentObject()->PrincipalOrNull();
NS_WARNING_ASSERTION(principal, "Why is the principal null here?");
@ -212,10 +210,9 @@ private:
return NS_ERROR_OUT_OF_MEMORY;
}
RefPtr<ServiceWorkerMessageEvent> event =
ServiceWorkerMessageEvent::Constructor(aTargetContainer,
NS_LITERAL_STRING("message"),
init);
RefPtr<MessageEvent> event =
MessageEvent::Constructor(aTargetContainer, NS_LITERAL_STRING("message"),
init);
event->SetTrusted(true);
bool status = false;