Bug 1329467 - Drop non-SPS version of AutoProfilerRegister. r?mstange
MozReview-Commit-ID: 9lZLPAi5ZZT
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -242,29 +242,16 @@ static inline void profiler_js_operation
static inline double profiler_time() { return 0; }
static inline double profiler_time(const mozilla::TimeStamp& aTime) { return 0; }
static inline bool profiler_in_privacy_mode() { return false; }
static inline void profiler_log(const char *str) {}
static inline void profiler_log(const char *fmt, va_list args) {}
-namespace mozilla {
-
-class AutoProfilerRegister final MOZ_STACK_CLASS
-{
-public:
- explicit AutoProfilerRegister(const char* aName) {}
-private:
- AutoProfilerRegister(const AutoProfilerRegister&) = delete;
- AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
-};
-
-} // namespace mozilla
-
#else
#include "GeckoProfilerImpl.h"
#endif
namespace mozilla {
@@ -337,11 +324,31 @@ public:
}
protected:
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
const char* mCategory;
const char* mInfo;
};
+/**
+ * Convenience class to register and unregister a thread with the profiler.
+ * Needs to be the first object on the stack of the thread.
+ */
+class MOZ_STACK_CLASS AutoProfilerRegister final
+{
+public:
+ explicit AutoProfilerRegister(const char* aName)
+ {
+ profiler_register_thread(aName, this);
+ }
+ ~AutoProfilerRegister()
+ {
+ profiler_unregister_thread();
+ }
+private:
+ AutoProfilerRegister(const AutoProfilerRegister&) = delete;
+ AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
+};
+
} // namespace mozilla
#endif // ifndef SAMPLER_H
--- a/tools/profiler/public/GeckoProfilerImpl.h
+++ b/tools/profiler/public/GeckoProfilerImpl.h
@@ -427,36 +427,16 @@ public:
~SamplerStackFramePrintfRAII() {
mozilla_sampler_call_exit(mHandle);
}
private:
char mDest[SAMPLER_MAX_STRING];
void* mHandle;
};
-/**
- * Convenience class to register and unregister a thread with the profiler.
- * Needs to be the first object on the stack of the thread.
- */
-class MOZ_STACK_CLASS AutoProfilerRegister final
-{
-public:
- explicit AutoProfilerRegister(const char* aName)
- {
- profiler_register_thread(aName, this);
- }
- ~AutoProfilerRegister()
- {
- profiler_unregister_thread();
- }
-private:
- AutoProfilerRegister(const AutoProfilerRegister&) = delete;
- AutoProfilerRegister& operator=(const AutoProfilerRegister&) = delete;
-};
-
} // namespace mozilla
inline PseudoStack* mozilla_get_pseudo_stack(void)
{
if (!stack_key_initialized)
return nullptr;
return tlsPseudoStack.get();
}