Bug 1435263 - Get rid of WorkerPrivateParent template - part 6 - ScriptURL and WorkerName, r=bkelly

This commit is contained in:
Andrea Marchesini 2018-02-08 09:33:33 +01:00
Родитель 707fce6000
Коммит d10bc7b6cb
2 изменённых файлов: 19 добавлений и 17 удалений

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

@ -1552,8 +1552,6 @@ WorkerPrivateParent<Derived>::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)

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

@ -130,9 +130,6 @@ protected:
nsTArray<RefPtr<WorkerRunnable>> mPreStartRunnables;
private:
nsString mScriptURL;
// This is the worker name for shared workers and dedicated workers.
nsString mWorkerName;
Atomic<bool> 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<RefPtr<SharedWorker>>& aSharedWorkers);
@ -462,6 +447,11 @@ class WorkerPrivate : public WorkerPrivateParent<WorkerPrivate>
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
{