/* -*- Mode: C++; tab-width: 8; 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/. */
ProfilerBacktrace::ProfilerBacktrace( constchar* aName,
mozilla::UniquePtr<mozilla::ProfileChunkedBuffer>
aProfileChunkedBufferStorage,
mozilla::UniquePtr<ProfileBuffer>
aProfileBufferStorageOrNull /* = nullptr */)
: mName(aName),
mOptionalProfileChunkedBufferStorage(
std::move(aProfileChunkedBufferStorage)),
mProfileChunkedBuffer(mOptionalProfileChunkedBufferStorage.get()),
mOptionalProfileBufferStorage(std::move(aProfileBufferStorageOrNull)),
mProfileBuffer(mOptionalProfileBufferStorage.get()) {
MOZ_COUNT_CTOR(ProfilerBacktrace); if (mProfileBuffer) {
MOZ_RELEASE_ASSERT(mProfileChunkedBuffer, "If we take ownership of a ProfileBuffer, we must also " "receive ownership of a ProfileChunkedBuffer");
MOZ_RELEASE_ASSERT(
mProfileChunkedBuffer == &mProfileBuffer->UnderlyingChunkedBuffer(), "If we take ownership of a ProfileBuffer, we must also receive " "ownership of its ProfileChunkedBuffer");
}
MOZ_ASSERT(
!mProfileChunkedBuffer || !mProfileChunkedBuffer->IsThreadSafe(), "ProfilerBacktrace only takes a non-thread-safe ProfileChunkedBuffer");
}
ProfilerBacktrace::ProfilerBacktrace( constchar* aName,
mozilla::ProfileChunkedBuffer* aExternalProfileChunkedBuffer,
ProfileBuffer* aExternalProfileBuffer)
: mName(aName),
mProfileChunkedBuffer(aExternalProfileChunkedBuffer),
mProfileBuffer(aExternalProfileBuffer) {
MOZ_COUNT_CTOR(ProfilerBacktrace); if (!mProfileChunkedBuffer) { if (mProfileBuffer) { // We don't have a ProfileChunkedBuffer but we have a ProfileBuffer, use // the latter's ProfileChunkedBuffer.
mProfileChunkedBuffer = &mProfileBuffer->UnderlyingChunkedBuffer();
MOZ_ASSERT(!mProfileChunkedBuffer->IsThreadSafe(), "ProfilerBacktrace only takes a non-thread-safe " "ProfileChunkedBuffer");
}
} else { if (mProfileBuffer) {
MOZ_RELEASE_ASSERT(
mProfileChunkedBuffer == &mProfileBuffer->UnderlyingChunkedBuffer(), "If we reference both ProfileChunkedBuffer and ProfileBuffer, they " "must already be connected");
}
MOZ_ASSERT(!mProfileChunkedBuffer->IsThreadSafe(), "ProfilerBacktrace only takes a non-thread-safe " "ProfileChunkedBuffer");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.