Bug 1492014 remove now-unused WorkletThread::mWorkletLoadInfo r=baku
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 18 Sep 2018 09:28:28 +0000
changeset 494594 66eb950c3f8298ffea27a91c6ac925c333a1b4b5
parent 494593 d952654b9cc2364056b627d1fdc9414f627c7510
child 494595 e545854fd235c9080f7b004e13b044bc7bb6d27e
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1492014
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492014 remove now-unused WorkletThread::mWorkletLoadInfo r=baku Depends on D6107 Differential Revision: https://phabricator.services.mozilla.com/D6108
dom/console/Console.cpp
dom/worklet/Worklet.cpp
dom/worklet/WorkletImpl.cpp
dom/worklet/WorkletThread.cpp
dom/worklet/WorkletThread.h
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -17,16 +17,17 @@
 #include "mozilla/dom/Performance.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/StructuredCloneHolder.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRunnable.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/dom/WorkletGlobalScope.h"
+#include "mozilla/dom/WorkletImpl.h"
 #include "mozilla/dom/WorkletThread.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/StaticPrefs.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDocument.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsGlobalWindow.h"
 #include "nsJSUtils.h"
--- a/dom/worklet/Worklet.cpp
+++ b/dom/worklet/Worklet.cpp
@@ -9,16 +9,17 @@
 
 #include "mozilla/dom/WorkletBinding.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/Response.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/ScriptLoader.h"
+#include "mozilla/dom/WorkletImpl.h"
 #include "js/CompilationAndEvaluation.h"
 #include "js/SourceBufferHolder.h"
 #include "nsIInputStreamPump.h"
 #include "nsIThreadRetargetableRequest.h"
 #include "nsNetUtil.h"
 #include "xpcprivate.h"
 
 namespace mozilla {
--- a/dom/worklet/WorkletImpl.cpp
+++ b/dom/worklet/WorkletImpl.cpp
@@ -111,17 +111,17 @@ WorkletImpl::CreateGlobalScope(JSContext
 
 dom::WorkletThread*
 WorkletImpl::GetOrCreateThread()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mWorkletThread) {
     // Thread creation. FIXME: this will change.
-    mWorkletThread = dom::WorkletThread::Create(mWorkletLoadInfo);
+    mWorkletThread = dom::WorkletThread::Create();
   }
 
   return mWorkletThread;
 }
 
 void
 WorkletImpl::TerminateThread()
 {
--- a/dom/worklet/WorkletThread.cpp
+++ b/dom/worklet/WorkletThread.cpp
@@ -254,41 +254,39 @@ public:
     mWorkletThread->TerminateInternal();
     return NS_OK;
   }
 
 private:
   RefPtr<WorkletThread> mWorkletThread;
 };
 
-WorkletThread::WorkletThread(const WorkletLoadInfo& aWorkletLoadInfo)
+WorkletThread::WorkletThread()
   : nsThread(MakeNotNull<ThreadEventQueue<mozilla::EventQueue>*>(
                MakeUnique<mozilla::EventQueue>()),
              nsThread::NOT_MAIN_THREAD, kWorkletStackSize)
-  , mWorkletLoadInfo(aWorkletLoadInfo)
   , mCreationTimeStamp(TimeStamp::Now())
   , mJSContext(nullptr)
   , mIsTerminating(false)
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsContentUtils::RegisterShutdownObserver(this);
 }
 
 WorkletThread::~WorkletThread()
 {
   // This should be gone during the termination step.
   MOZ_ASSERT(!mJSContext);
 }
 
 // static
 already_AddRefed<WorkletThread>
-WorkletThread::Create(const WorkletLoadInfo& aWorkletLoadInfo)
+WorkletThread::Create()
 {
-  RefPtr<WorkletThread> thread =
-    new WorkletThread(aWorkletLoadInfo);
+  RefPtr<WorkletThread> thread = new WorkletThread();
   if (NS_WARN_IF(NS_FAILED(thread->Init()))) {
     return nullptr;
   }
 
   RefPtr<PrimaryRunnable> runnable = new PrimaryRunnable(thread);
   if (NS_WARN_IF(NS_FAILED(thread->DispatchRunnable(runnable.forget())))) {
     return nullptr;
   }
@@ -403,22 +401,16 @@ WorkletThread::TerminateInternal()
 JSContext*
 WorkletThread::GetJSContext() const
 {
   AssertIsOnWorkletThread();
   MOZ_ASSERT(mJSContext);
   return mJSContext;
 }
 
-const WorkletLoadInfo&
-WorkletThread::GetWorkletLoadInfo() const
-{
-  return mWorkletLoadInfo;
-}
-
 /* static */ bool
 WorkletThread::IsOnWorkletThread()
 {
   CycleCollectedJSContext* ccjscx = CycleCollectedJSContext::Get();
   return ccjscx && ccjscx->GetAsWorkletJSContext();
 }
 
 /* static */ void
--- a/dom/worklet/WorkletThread.h
+++ b/dom/worklet/WorkletThread.h
@@ -4,67 +4,62 @@
  * 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_worklet_WorkletThread_h
 #define mozilla_dom_worklet_WorkletThread_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/CondVar.h"
-#include "mozilla/dom/WorkletImpl.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/TimeStamp.h"
 #include "nsThread.h"
 
 class nsIRunnable;
 
 namespace mozilla {
 namespace dom {
 
 class WorkletThread final : public nsThread, public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIOBSERVER
 
-  static already_AddRefed<WorkletThread>
-  Create(const WorkletLoadInfo& aWorkletLoadInfo);
+  static already_AddRefed<WorkletThread> Create();
 
   static WorkletThread*
   Get();
 
   static bool
   IsOnWorkletThread();
 
   static void
   AssertIsOnWorkletThread();
 
   JSContext*
   GetJSContext() const;
 
-  const WorkletLoadInfo&
-  GetWorkletLoadInfo() const;
-
   nsresult
   DispatchRunnable(already_AddRefed<nsIRunnable> aRunnable);
 
   void
   Terminate();
 
   DOMHighResTimeStamp
   TimeStampToDOMHighRes(const TimeStamp& aTimeStamp) const
   {
     MOZ_ASSERT(!aTimeStamp.IsNull());
     TimeDuration duration = aTimeStamp - mCreationTimeStamp;
     return duration.ToMilliseconds();
   }
 
 private:
-  explicit WorkletThread(const WorkletLoadInfo& aWorkletLoadInfo);
+  WorkletThread();
   ~WorkletThread();
 
   void
   RunEventLoop(JSRuntime* aParentRuntime);
   class PrimaryRunnable;
 
   void
   TerminateInternal();
@@ -76,17 +71,16 @@ private:
   Dispatch(already_AddRefed<nsIRunnable> aRunnable, uint32_t aFlags) override;
 
   NS_IMETHOD
   DispatchFromScript(nsIRunnable* aRunnable, uint32_t aFlags) override;
 
   NS_IMETHOD
   DelayedDispatch(already_AddRefed<nsIRunnable>, uint32_t) override;
 
-  const WorkletLoadInfo mWorkletLoadInfo;
   TimeStamp mCreationTimeStamp;
 
   // Touched only on the worklet thread. This is a raw pointer because it's set
   // and nullified by RunEventLoop().
   JSContext* mJSContext;
 
   bool mIsTerminating; // main thread
 };