2018-01-30 12:10:25 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_workers_MessageEventRunnable_h
|
|
|
|
#define mozilla_dom_workers_MessageEventRunnable_h
|
|
|
|
|
|
|
|
#include "WorkerCommon.h"
|
|
|
|
#include "WorkerRunnable.h"
|
|
|
|
#include "mozilla/dom/StructuredCloneHolder.h"
|
|
|
|
|
2018-01-30 12:14:00 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class DOMEventTargetHelper;
|
|
|
|
|
|
|
|
namespace dom {
|
2018-01-30 12:10:25 +03:00
|
|
|
|
2018-10-22 18:46:04 +03:00
|
|
|
class MessageEventRunnable final : public WorkerDebuggeeRunnable,
|
2018-01-30 12:10:25 +03:00
|
|
|
public StructuredCloneHolder {
|
|
|
|
public:
|
2018-01-31 10:24:08 +03:00
|
|
|
MessageEventRunnable(WorkerPrivate* aWorkerPrivate,
|
2018-01-30 12:10:25 +03:00
|
|
|
TargetAndBusyBehavior aBehavior);
|
|
|
|
|
2018-01-31 10:24:08 +03:00
|
|
|
bool DispatchDOMEvent(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
2018-01-30 12:10:25 +03:00
|
|
|
DOMEventTargetHelper* aTarget, bool aIsMainThread);
|
|
|
|
|
|
|
|
private:
|
2018-01-31 10:24:08 +03:00
|
|
|
bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override;
|
2018-01-30 12:10:25 +03:00
|
|
|
|
|
|
|
void DispatchError(JSContext* aCx, DOMEventTargetHelper* aTarget);
|
|
|
|
};
|
|
|
|
|
2018-01-30 12:14:00 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2018-01-30 12:10:25 +03:00
|
|
|
|
|
|
|
#endif // mozilla_dom_workers_MessageEventRunnable_h
|