diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-04-27 10:48:09 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-04-29 10:37:22 +0200 |
commit | 3ed51f7b24eac38e4263da8d5bfa10ab6e6d3161 (patch) | |
tree | 546752b267db5fecef368492d02c487275acaa8c /comphelper | |
parent | 27c89553b3a02a8d00b19d0a2e305553e270348a (diff) |
Move some static functions from ProfileZone to TraceEvent where they belong
Change-Id: I35f3d5d8c0a69a224cf7d3a2decba9c8e13c7dc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114792
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/traceevent.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx index aa99e8bf7e39..6e86c3f03993 100644 --- a/comphelper/source/misc/traceevent.cxx +++ b/comphelper/source/misc/traceevent.cxx @@ -67,14 +67,30 @@ void TraceEvent::addInstantEvent(const char* sProfileId) + OUString::number(osl_getThreadIdentifier(nullptr)) + "},"); } -void ProfileZone::startRecording() +void TraceEvent::startRecording() { ::osl::MutexGuard aGuard(g_aMutex); s_nNesting = 0; s_bRecording = true; } -void ProfileZone::stopRecording() { s_bRecording = false; } +void TraceEvent::stopRecording() { s_bRecording = false; } + +css::uno::Sequence<OUString> TraceEvent::getRecordingAndClear() +{ + bool bRecording; + std::vector<OUString> aRecording; + { + ::osl::MutexGuard aGuard(g_aMutex); + bRecording = s_bRecording; + stopRecording(); + aRecording.swap(g_aRecording); + } + // reset start time and nesting level + if (bRecording) + startRecording(); + return ::comphelper::containerToSequence(aRecording); +} void ProfileZone::addRecording() { @@ -104,22 +120,6 @@ void ProfileZone::addRecording() + OUString::number(osl_getThreadIdentifier(nullptr)) + "},"); } -css::uno::Sequence<OUString> ProfileZone::getRecordingAndClear() -{ - bool bRecording; - std::vector<OUString> aRecording; - { - ::osl::MutexGuard aGuard(g_aMutex); - bRecording = s_bRecording; - stopRecording(); - aRecording.swap(g_aRecording); - } - // reset start time and nesting level - if (bRecording) - startRecording(); - return ::comphelper::containerToSequence(aRecording); -} - void ProfileZone::startConsole() { m_nCreateTime = osl_getGlobalTimer(); } void ProfileZone::stopConsole() |