Bug 1492014 replace WorkletLoadInfo::mDumpEnabled with StaticPrefs r=baku
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 24 Sep 2018 17:19:09 +0000
changeset 494597 17f44e6e8f49
parent 494596 cb3fa704e175
child 494613 994badb573ef
child 494619 31015657ecfb
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
17f44e6e8f49 / 64.0a1 / 20180929100556 / files
nightly linux64
17f44e6e8f49 / 64.0a1 / 20180929100556 / files
nightly mac
17f44e6e8f49 / 64.0a1 / 20180929100556 / files
nightly win32
17f44e6e8f49 / 64.0a1 / 20180929100556 / files
nightly win64
17f44e6e8f49 / 64.0a1 / 20180929100556 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492014 replace WorkletLoadInfo::mDumpEnabled with StaticPrefs r=baku Depends on D6382 Differential Revision: https://phabricator.services.mozilla.com/D6383
dom/worklet/WorkletGlobalScope.cpp
dom/worklet/WorkletImpl.cpp
dom/worklet/WorkletImpl.h
--- a/dom/worklet/WorkletGlobalScope.cpp
+++ b/dom/worklet/WorkletGlobalScope.cpp
@@ -3,16 +3,17 @@
 /* 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/. */
 
 #include "WorkletGlobalScope.h"
 #include "mozilla/dom/WorkletGlobalScopeBinding.h"
 #include "mozilla/dom/WorkletImpl.h"
 #include "mozilla/dom/Console.h"
+#include "mozilla/StaticPrefs.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(WorkletGlobalScope)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(WorkletGlobalScope)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -67,17 +68,17 @@ WorkletGlobalScope::GetConsole(JSContext
   return console.forget();
 }
 
 void
 WorkletGlobalScope::Dump(const Optional<nsAString>& aString) const
 {
   WorkletThread::AssertIsOnWorkletThread();
 
-  if (!mImpl->LoadInfo().DumpEnabled()) {
+  if (!StaticPrefs::browser_dom_window_dump_enabled()) {
     return;
   }
 
   if (!aString.WasPassed()) {
     return;
   }
 
   NS_ConvertUTF16toUTF8 str(aString.Value());
--- a/dom/worklet/WorkletImpl.cpp
+++ b/dom/worklet/WorkletImpl.cpp
@@ -5,28 +5,26 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 #include "WorkletImpl.h"
 
 #include "Worklet.h"
 #include "WorkletThread.h"
 
 #include "mozilla/BasePrincipal.h"
-#include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/RegisterWorkletBindings.h"
 #include "mozilla/dom/WorkletBinding.h"
 
 namespace mozilla {
 
 // ---------------------------------------------------------------------------
 // WorkletLoadInfo
 
 WorkletLoadInfo::WorkletLoadInfo(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
   : mInnerWindowID(aWindow->WindowID())
-  , mDumpEnabled(dom::DOMPrefs::DumpEnabled())
   , mOriginAttributes(BasePrincipal::Cast(aPrincipal)->OriginAttributesRef())
   , mPrincipal(aPrincipal)
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsPIDOMWindowOuter* outerWindow = aWindow->GetOuterWindow();
   if (outerWindow) {
     mOuterWindowID = outerWindow->WindowID();
   } else {
--- a/dom/worklet/WorkletImpl.h
+++ b/dom/worklet/WorkletImpl.h
@@ -27,34 +27,32 @@ class WorkletThread;
 class WorkletLoadInfo
 {
 public:
   WorkletLoadInfo(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal);
   ~WorkletLoadInfo();
 
   uint64_t OuterWindowID() const { return mOuterWindowID; }
   uint64_t InnerWindowID() const { return mInnerWindowID; }
-  bool DumpEnabled() const { return mDumpEnabled; }
 
   const OriginAttributes& OriginAttributesRef() const
   {
     return mOriginAttributes;
   }
 
   nsIPrincipal* Principal() const
   {
     MOZ_ASSERT(NS_IsMainThread());
     return mPrincipal;
   }
 
 private:
   // Modified only in constructor.
   uint64_t mOuterWindowID;
   const uint64_t mInnerWindowID;
-  const bool mDumpEnabled;
   const OriginAttributes mOriginAttributes;
   // Accessed on only worklet parent thread.
   nsCOMPtr<nsIPrincipal> mPrincipal;
 
   friend class WorkletImpl;
   friend class WorkletThread;
 };