michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __SYNCPROFILE_H michael@0: #define __SYNCPROFILE_H michael@0: michael@0: #include "ProfileEntry.h" michael@0: michael@0: struct LinkedUWTBuffer; michael@0: michael@0: class SyncProfile : public ThreadProfile michael@0: { michael@0: public: michael@0: SyncProfile(const char* aName, int aEntrySize, PseudoStack *aStack, michael@0: Thread::tid_t aThreadId, bool aIsMainThread); michael@0: ~SyncProfile(); michael@0: michael@0: bool SetUWTBuffer(LinkedUWTBuffer* aBuff); michael@0: LinkedUWTBuffer* GetUWTBuffer() { return mUtb; } michael@0: michael@0: virtual void EndUnwind(); michael@0: virtual SyncProfile* AsSyncProfile() { return this; } michael@0: michael@0: private: michael@0: friend class ProfilerBacktrace; michael@0: michael@0: enum OwnerState michael@0: { michael@0: REFERENCED, // ProfilerBacktrace has a pointer to this but doesn't own michael@0: OWNED, // ProfilerBacktrace is responsible for destroying this michael@0: OWNER_DESTROYING, // ProfilerBacktrace owns this and is destroying michael@0: ORPHANED // No owner, we must destroy ourselves michael@0: }; michael@0: michael@0: bool ShouldDestroy(); michael@0: michael@0: OwnerState mOwnerState; michael@0: LinkedUWTBuffer* mUtb; michael@0: }; michael@0: michael@0: #endif // __SYNCPROFILE_H michael@0: