summaryrefslogtreecommitdiffstats
path: root/tools/profiler/core/ThreadInfo.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /tools/profiler/core/ThreadInfo.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'tools/profiler/core/ThreadInfo.h')
-rw-r--r--tools/profiler/core/ThreadInfo.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/profiler/core/ThreadInfo.h b/tools/profiler/core/ThreadInfo.h
new file mode 100644
index 000000000..1cb4e5dc8
--- /dev/null
+++ b/tools/profiler/core/ThreadInfo.h
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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/. */
+
+#ifndef MOZ_THREAD_INFO_H
+#define MOZ_THREAD_INFO_H
+
+#include "platform.h"
+
+class ThreadInfo {
+ public:
+ ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread, PseudoStack* aPseudoStack, void* aStackTop);
+
+ virtual ~ThreadInfo();
+
+ const char* Name() const { return mName; }
+ int ThreadId() const { return mThreadId; }
+
+ bool IsMainThread() const { return mIsMainThread; }
+ PseudoStack* Stack() const { return mPseudoStack; }
+
+ void SetProfile(ThreadProfile* aProfile) { mProfile = aProfile; }
+ ThreadProfile* Profile() const { return mProfile; }
+
+ PlatformData* GetPlatformData() const { return mPlatformData; }
+ void* StackTop() const { return mStackTop; }
+
+ virtual void SetPendingDelete();
+ bool IsPendingDelete() const { return mPendingDelete; }
+
+#ifndef SPS_STANDALONE
+ /**
+ * May be null for the main thread if the profiler was started during startup
+ */
+ nsIThread* GetThread() const { return mThread.get(); }
+
+#endif
+
+ bool CanInvokeJS() const;
+
+ private:
+ char* mName;
+ int mThreadId;
+ const bool mIsMainThread;
+ PseudoStack* mPseudoStack;
+ PlatformData* mPlatformData;
+ ThreadProfile* mProfile;
+ void* mStackTop;
+#ifndef SPS_STANDALONE
+ nsCOMPtr<nsIThread> mThread;
+#endif
+ bool mPendingDelete;
+};
+
+// Just like ThreadInfo, but owns a reference to the PseudoStack.
+class StackOwningThreadInfo : public ThreadInfo {
+ public:
+ StackOwningThreadInfo(const char* aName, int aThreadId, bool aIsMainThread, PseudoStack* aPseudoStack, void* aStackTop);
+ virtual ~StackOwningThreadInfo();
+
+ virtual void SetPendingDelete();
+};
+
+#endif