Bug 1432963 - Fixing workers headers - part 1 - no workers namespace for SharedWorker, r=smaug

This commit is contained in:
Andrea Marchesini 2018-01-31 08:19:10 +01:00
parent 04332d008f
commit c08095be82
6 changed files with 18 additions and 19 deletions

View File

@ -762,11 +762,6 @@ DOMInterfaces = {
'implicitJSContext': [ 'pushManager' ],
},
'SharedWorker': {
'nativeType': 'mozilla::dom::workers::SharedWorker',
'headerFile': 'mozilla/dom/workers/bindings/SharedWorker.h',
},
'SharedWorkerGlobalScope': {
'headerFile': 'mozilla/dom/WorkerScope.h',
'implicitJSContext': [ 'close' ],

View File

@ -19,9 +19,14 @@
class nsITimer;
class nsPIDOMWindowInner;
namespace mozilla {
namespace dom {
class SharedWorker;
}
}
BEGIN_WORKERS_NAMESPACE
class SharedWorker;
struct WorkerLoadInfo;
class WorkerThread;

View File

@ -29,8 +29,8 @@ using mozilla::dom::Optional;
using mozilla::dom::Sequence;
using mozilla::dom::MessagePort;
using namespace mozilla;
USING_WORKERS_NAMESPACE
using namespace mozilla::dom;
using namespace mozilla::dom::workers;
SharedWorker::SharedWorker(nsPIDOMWindowInner* aWindow,
WorkerPrivate* aWorkerPrivate,

View File

@ -25,22 +25,20 @@ class EventChainPreVisitor;
namespace dom {
class MessagePort;
class StringOrWorkerOptions;
}
} // namespace mozilla
BEGIN_WORKERS_NAMESPACE
namespace workers {
class RuntimeService;
class WorkerPrivate;
}
class SharedWorker final : public DOMEventTargetHelper
{
friend class RuntimeService;
friend class workers::RuntimeService;
typedef mozilla::ErrorResult ErrorResult;
typedef mozilla::dom::GlobalObject GlobalObject;
RefPtr<WorkerPrivate> mWorkerPrivate;
RefPtr<workers::WorkerPrivate> mWorkerPrivate;
RefPtr<MessagePort> mMessagePort;
nsTArray<nsCOMPtr<nsIDOMEvent>> mFrozenEvents;
bool mFrozen;
@ -82,7 +80,7 @@ public:
virtual nsresult
GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
WorkerPrivate*
workers::WorkerPrivate*
GetWorkerPrivate() const
{
return mWorkerPrivate;
@ -91,7 +89,7 @@ public:
private:
// This class can only be created from the RuntimeService.
SharedWorker(nsPIDOMWindowInner* aWindow,
WorkerPrivate* aWorkerPrivate,
workers::WorkerPrivate* aWorkerPrivate,
MessagePort* aMessagePort);
// This class is reference-counted and will be destroyed from Release().
@ -103,6 +101,7 @@ private:
const Sequence<JSObject*>& aTransferable, ErrorResult& aRv);
};
END_WORKERS_NAMESPACE
} // dom namespace
} // mozilla namespace
#endif // mozilla_dom_workers_sharedworker_h__

View File

@ -36,6 +36,7 @@ class Function;
class MessagePort;
class MessagePortIdentifier;
class PerformanceStorage;
class SharedWorker;
class WorkerDebuggerGlobalScope;
class WorkerErrorReport;
class WorkerGlobalScope;
@ -46,7 +47,6 @@ struct WorkerOptions;
BEGIN_WORKERS_NAMESPACE
class SharedWorker;
class WorkerControlRunnable;
class WorkerDebugger;
class WorkerEventTarget;

View File

@ -9,6 +9,7 @@ with Files("**"):
# Public stuff.
EXPORTS.mozilla.dom += [
'SharedWorker.h',
'WorkerLocation.h',
'WorkerNavigator.h',
'WorkerPrivate.h',
@ -26,7 +27,6 @@ EXPORTS.mozilla.dom.workers += [
# Stuff needed for the bindings, not really public though.
EXPORTS.mozilla.dom.workers.bindings += [
'SharedWorker.h',
'WorkerHolder.h',
'WorkerHolderToken.h',
]