diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index ac66978e228a..73e4e4fa0f96 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1552,8 +1552,6 @@ WorkerPrivateParent::WorkerPrivateParent( WorkerLoadInfo& aLoadInfo) : mMutex("WorkerPrivateParent Mutex"), mCondVar(mMutex, "WorkerPrivateParent CondVar"), - mScriptURL(aScriptURL), - mWorkerName(aWorkerName), mLoadingWorkerScript(false), mParentWindowPausedDepth(0), mWorkerType(aWorkerType) { @@ -2709,6 +2707,8 @@ WorkerPrivate::WorkerPrivate(WorkerPrivate* aParent, aWorkerName, aServiceWorkerScope, aLoadInfo) , mParent(aParent) + , mScriptURL(aScriptURL) + , mWorkerName(aWorkerName) , mDebuggerRegistered(false) , mDebugger(nullptr) , mJSContext(nullptr) diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index f32fb9af219a..234586f93697 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -130,9 +130,6 @@ protected: nsTArray> mPreStartRunnables; private: - nsString mScriptURL; - // This is the worker name for shared workers and dedicated workers. - nsString mWorkerName; Atomic mLoadingWorkerScript; @@ -303,12 +300,6 @@ public: return mParentWindowPausedDepth > 0; } - const nsString& - ScriptURL() const - { - return mScriptURL; - } - // This is used to handle importScripts(). When the worker is first loaded // and executed, it happens in a sync loop. At this point it sets // mLoadingWorkerScript to true. importScripts() calls that occur during the @@ -394,12 +385,6 @@ public: } } - const nsString& - WorkerName() const - { - return mWorkerName; - } - void GetAllSharedWorkers(nsTArray>& aSharedWorkers); @@ -462,6 +447,11 @@ class WorkerPrivate : public WorkerPrivateParent WorkerPrivate* mParent; + nsString mScriptURL; + + // This is the worker name for shared workers and dedicated workers. + nsString mWorkerName; + // The worker is owned by its thread, which is represented here. This is set // in Constructor() and emptied by WorkerFinishedRunnable, and conditionally // traversed by the cycle collector if the busy count is zero. @@ -1122,6 +1112,18 @@ public: return mParentFrozen; } + const nsString& + ScriptURL() const + { + return mScriptURL; + } + + const nsString& + WorkerName() const + { + return mWorkerName; + } + nsIScriptContext* GetScriptContext() const {