summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <git-repo@palemoon.org>2020-02-20 16:50:49 +0100
committerGitHub <noreply@github.com>2020-02-20 16:50:49 +0100
commit7832dded378423f245cb8cf8ef66c4c16a39f6e8 (patch)
tree8942443c378dfbe069af0bab196fa63a212adc83 /dom
parent0e9957c412002000067479e7ce582e8d625e21c0 (diff)
parentd53b11c9dc34d0a8c3bb4ad862cff1e0ce566457 (diff)
downloaduxp-7832dded378423f245cb8cf8ef66c4c16a39f6e8.tar.gz
Merge pull request #1458 from MoonchildProductions/316
Fix buildability of builds without devtools-server
Diffstat (limited to 'dom')
-rw-r--r--dom/performance/Performance.h2
-rw-r--r--dom/performance/PerformanceMainThread.cpp9
-rw-r--r--dom/performance/PerformanceMainThread.h4
-rw-r--r--dom/performance/PerformanceWorker.h2
-rw-r--r--dom/webidl/Performance.webidl2
-rw-r--r--dom/webidl/moz.build2
6 files changed, 20 insertions, 1 deletions
diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h
index 4debecc90f..c40dd8affa 100644
--- a/dom/performance/Performance.h
+++ b/dom/performance/Performance.h
@@ -96,8 +96,10 @@ public:
IMPL_EVENT_HANDLER(resourcetimingbufferfull)
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) = 0;
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const = 0;
diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp
index 5a84f5fb11..b95a91ea67 100644
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -11,6 +11,7 @@
namespace mozilla {
namespace dom {
+
NS_IMPL_CYCLE_COLLECTION_CLASS(PerformanceMainThread)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PerformanceMainThread,
@@ -18,8 +19,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PerformanceMainThread,
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTiming,
mNavigation,
mDocEntry)
+#ifdef MOZ_DEVTOOLS_SERVER
tmp->mMozMemory = nullptr;
mozilla::DropJSObjects(this);
+#endif
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PerformanceMainThread,
@@ -31,7 +34,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(PerformanceMainThread,
Performance)
+#ifdef MOZ_DEVTOOLS_SERVER
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mMozMemory)
+#endif
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_ADDREF_INHERITED(PerformanceMainThread, Performance)
@@ -55,9 +60,12 @@ PerformanceMainThread::PerformanceMainThread(nsPIDOMWindowInner* aWindow,
PerformanceMainThread::~PerformanceMainThread()
{
+#ifdef MOZ_DEVTOOLS_SERVER
mozilla::DropJSObjects(this);
+#endif
}
+#ifdef MOZ_DEVTOOLS_SERVER
void
PerformanceMainThread::GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj)
@@ -71,6 +79,7 @@ PerformanceMainThread::GetMozMemory(JSContext *aCx,
aObj.set(mMozMemory);
}
+#endif
PerformanceTiming*
PerformanceMainThread::Timing()
diff --git a/dom/performance/PerformanceMainThread.h b/dom/performance/PerformanceMainThread.h
index 9f0e185fcf..a90a535206 100644
--- a/dom/performance/PerformanceMainThread.h
+++ b/dom/performance/PerformanceMainThread.h
@@ -34,8 +34,10 @@ public:
DOMHighResTimeStamp CreationTime() const override;
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) override;
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const override
{
@@ -79,7 +81,9 @@ protected:
nsCOMPtr<nsITimedChannel> mChannel;
RefPtr<PerformanceTiming> mTiming;
RefPtr<PerformanceNavigation> mNavigation;
+#ifdef MOZ_DEVTOOLS_SERVER
JS::Heap<JSObject*> mMozMemory;
+#endif
};
} // namespace dom
diff --git a/dom/performance/PerformanceWorker.h b/dom/performance/PerformanceWorker.h
index 346bdd0260..ffe2a1998a 100644
--- a/dom/performance/PerformanceWorker.h
+++ b/dom/performance/PerformanceWorker.h
@@ -43,11 +43,13 @@ public:
DOMHighResTimeStamp CreationTime() const override;
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) override
{
MOZ_CRASH("This should not be called on workers.");
}
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const override
{
diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl
index 0bd2677df7..e811e1cee2 100644
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -55,12 +55,14 @@ partial interface Performance {
attribute EventHandler onresourcetimingbufferfull;
};
+#ifdef MOZ_DEVTOOLS_SERVER
// GC microbenchmarks, pref-guarded, not for general use (bug 1125412)
[Exposed=Window]
partial interface Performance {
[Pref="dom.enable_memory_stats"]
readonly attribute object mozMemory;
};
+#endif
// http://www.w3.org/TR/user-timing/
[Exposed=(Window,Worker)]
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index 89c149db79..156da302dd 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -12,6 +12,7 @@ PREPROCESSED_WEBIDL_FILES = [
'HTMLMediaElement.webidl',
'Navigator.webidl',
'Node.webidl',
+ 'Performance.webidl',
'Window.webidl',
]
@@ -329,7 +330,6 @@ WEBIDL_FILES = [
'PaintRequestList.webidl',
'PannerNode.webidl',
'ParentNode.webidl',
- 'Performance.webidl',
'PerformanceEntry.webidl',
'PerformanceMark.webidl',
'PerformanceMeasure.webidl',