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-01-31 10:22:56 +03:00
|
|
|
class MessageEventRunnable final : public WorkerRunnable
|
2018-01-30 12:10:25 +03:00
|
|
|
, public StructuredCloneHolder
|
|
|
|
{
|
|
|
|
public:
|
2018-01-31 10:22:28 +03:00
|
|
|
MessageEventRunnable(workers::WorkerPrivate* aWorkerPrivate,
|
2018-01-30 12:10:25 +03:00
|
|
|
TargetAndBusyBehavior aBehavior);
|
|
|
|
|
|
|
|
bool
|
2018-01-31 10:22:28 +03:00
|
|
|
DispatchDOMEvent(JSContext* aCx, workers::WorkerPrivate* aWorkerPrivate,
|
2018-01-30 12:10:25 +03:00
|
|
|
DOMEventTargetHelper* aTarget, bool aIsMainThread);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool
|
2018-01-31 10:22:28 +03:00
|
|
|
WorkerRun(JSContext* aCx, workers::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
|
|
|
} // dom namespace
|
|
|
|
} // mozilla namespace
|
2018-01-30 12:10:25 +03:00
|
|
|
|
|
|
|
#endif // mozilla_dom_workers_MessageEventRunnable_h
|