Kaydet (Commit) 74cd1675 authored tarafından Michael Meeks's avatar Michael Meeks

lok: add profile zones.

NB. outside of the often contended SolarMutexGuard.

Change-Id: Ieb651e2ed4349e692010a7588721f461af7d2b5b
Reviewed-on: https://gerrit.libreoffice.org/70848
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 26e85974
...@@ -942,6 +942,8 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d ...@@ -942,6 +942,8 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
void CallbackFlushHandler::queue(const int type, const char* data) void CallbackFlushHandler::queue(const int type, const char* data)
{ {
comphelper::ProfileZone aZone("CallbackFlushHander::queue");
CallbackData aCallbackData(type, (data ? data : "(nil)")); CallbackData aCallbackData(type, (data ? data : "(nil)"));
const std::string& payload = aCallbackData.PayloadString; const std::string& payload = aCallbackData.PayloadString;
SAL_INFO("lok", "Queue: " << type << " : " << payload); SAL_INFO("lok", "Queue: " << type << " : " << payload);
...@@ -1391,6 +1393,8 @@ void CallbackFlushHandler::queue(const int type, const char* data) ...@@ -1391,6 +1393,8 @@ void CallbackFlushHandler::queue(const int type, const char* data)
void CallbackFlushHandler::Invoke() void CallbackFlushHandler::Invoke()
{ {
comphelper::ProfileZone aZone("CallbackFlushHander::Invoke");
if (m_pCallback && !m_bEventLatch) if (m_pCallback && !m_bEventLatch)
{ {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
...@@ -1475,6 +1479,8 @@ void CallbackFlushHandler::removeViewStates(int viewId) ...@@ -1475,6 +1479,8 @@ void CallbackFlushHandler::removeViewStates(int viewId)
static void doc_destroy(LibreOfficeKitDocument *pThis) static void doc_destroy(LibreOfficeKitDocument *pThis)
{ {
comphelper::ProfileZone aZone("doc_destroy");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLODocument_Impl *pDocument = static_cast<LibLODocument_Impl*>(pThis); LibLODocument_Impl *pDocument = static_cast<LibLODocument_Impl*>(pThis);
...@@ -1564,6 +1570,8 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char ...@@ -1564,6 +1570,8 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char
static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const char* pURL, const char* pOptions) static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const char* pURL, const char* pOptions)
{ {
comphelper::ProfileZone aZone("lo_documentLoadWithOptions");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -1672,6 +1680,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, ...@@ -1672,6 +1680,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL) static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
{ {
comphelper::ProfileZone aZone("lo_runMacro");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -1758,12 +1768,14 @@ static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL) ...@@ -1758,12 +1768,14 @@ static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
} }
static bool lo_signDocument(LibreOfficeKit* /*pThis*/, static bool lo_signDocument(LibreOfficeKit* /*pThis*/,
const char* pURL, const char* pURL,
const unsigned char* pCertificateBinary, const unsigned char* pCertificateBinary,
const int nCertificateBinarySize, const int nCertificateBinarySize,
const unsigned char* pPrivateKeyBinary, const unsigned char* pPrivateKeyBinary,
const int nPrivateKeyBinarySize) const int nPrivateKeyBinarySize)
{ {
comphelper::ProfileZone aZone("lo_signDocument");
OUString aURL(getAbsoluteURL(pURL)); OUString aURL(getAbsoluteURL(pURL));
if (aURL.isEmpty()) if (aURL.isEmpty())
return false; return false;
...@@ -1838,6 +1850,8 @@ static void lo_registerCallback (LibreOfficeKit* pThis, ...@@ -1838,6 +1850,8 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions) static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{ {
comphelper::ProfileZone aZone("doc_saveAs");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2137,6 +2151,8 @@ static void doc_iniUnoCommands () ...@@ -2137,6 +2151,8 @@ static void doc_iniUnoCommands ()
static int doc_getDocumentType (LibreOfficeKitDocument* pThis) static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getDocumentType");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2177,6 +2193,8 @@ static int doc_getDocumentType (LibreOfficeKitDocument* pThis) ...@@ -2177,6 +2193,8 @@ static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
static int doc_getParts (LibreOfficeKitDocument* pThis) static int doc_getParts (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getParts");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
ITiledRenderable* pDoc = getTiledRenderable(pThis); ITiledRenderable* pDoc = getTiledRenderable(pThis);
...@@ -2191,6 +2209,8 @@ static int doc_getParts (LibreOfficeKitDocument* pThis) ...@@ -2191,6 +2209,8 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
static int doc_getPart (LibreOfficeKitDocument* pThis) static int doc_getPart (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getPart");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2207,6 +2227,8 @@ static int doc_getPart (LibreOfficeKitDocument* pThis) ...@@ -2207,6 +2227,8 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_setPart");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2223,6 +2245,8 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2223,6 +2245,8 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartInfo");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
ITiledRenderable* pDoc = getTiledRenderable(pThis); ITiledRenderable* pDoc = getTiledRenderable(pThis);
if (!pDoc) if (!pDoc)
...@@ -2242,6 +2266,8 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2242,6 +2266,8 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart)
static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getPartPageRectangles");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2264,6 +2290,8 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) ...@@ -2264,6 +2290,8 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartName");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2286,6 +2314,8 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2286,6 +2314,8 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartHash");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2309,6 +2339,8 @@ static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2309,6 +2339,8 @@ static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
static void doc_setPartMode(LibreOfficeKitDocument* pThis, static void doc_setPartMode(LibreOfficeKitDocument* pThis,
int nPartMode) int nPartMode)
{ {
comphelper::ProfileZone aZone("doc_setPartMode");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2357,6 +2389,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, ...@@ -2357,6 +2389,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
const int nTilePosX, const int nTilePosY, const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight) const int nTileWidth, const int nTileHeight)
{ {
comphelper::ProfileZone aZone("doc_paintTile");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2490,6 +2524,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, ...@@ -2490,6 +2524,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
const int nTilePosX, const int nTilePosY, const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight) const int nTileWidth, const int nTileHeight)
{ {
comphelper::ProfileZone aZone("doc_paintPartTile");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2585,6 +2621,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, ...@@ -2585,6 +2621,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
long* pWidth, long* pWidth,
long* pHeight) long* pHeight)
{ {
comphelper::ProfileZone aZone("doc_getDocumentSize");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2605,6 +2643,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, ...@@ -2605,6 +2643,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
static void doc_initializeForRendering(LibreOfficeKitDocument* pThis, static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
const char* pArguments) const char* pArguments)
{ {
comphelper::ProfileZone aZone("doc_initializeForRendering");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2721,6 +2761,8 @@ static char* getRulerState(LibreOfficeKitDocument* pThis) ...@@ -2721,6 +2761,8 @@ static char* getRulerState(LibreOfficeKitDocument* pThis)
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode) static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
{ {
comphelper::ProfileZone aZone("doc_postKeyEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2737,6 +2779,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar ...@@ -2737,6 +2779,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText) static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText)
{ {
comphelper::ProfileZone aZone("doc_postWindowExtTextInputEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
VclPtr<vcl::Window> pWindow; VclPtr<vcl::Window> pWindow;
if (nWindowId == 0) if (nWindowId == 0)
...@@ -2777,6 +2821,8 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig ...@@ -2777,6 +2821,8 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode) static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode)
{ {
comphelper::ProfileZone aZone("doc_postWindowKeyEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2806,6 +2852,8 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n ...@@ -2806,6 +2852,8 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n
static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput) static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput)
{ {
comphelper::ProfileZone aZone("doc_renderShapeSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2910,6 +2958,8 @@ public: ...@@ -2910,6 +2958,8 @@ public:
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
{ {
comphelper::ProfileZone aZone("doc_postUnoCommand");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2989,6 +3039,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma ...@@ -2989,6 +3039,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{ {
comphelper::ProfileZone aZone("doc_postMouseEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3005,6 +3057,8 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, ...@@ -3005,6 +3057,8 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{ {
comphelper::ProfileZone aZone("doc_postWindowMouseEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3043,6 +3097,8 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned ...@@ -3043,6 +3097,8 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, const char* pType, int nX, int nY, int nOffset) static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, const char* pType, int nX, int nY, int nOffset)
{ {
comphelper::ProfileZone aZone("doc_postWindowGestureEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3080,6 +3136,8 @@ static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsign ...@@ -3080,6 +3136,8 @@ static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsign
static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY) static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
{ {
comphelper::ProfileZone aZone("doc_setTextSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3096,6 +3154,8 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n ...@@ -3096,6 +3154,8 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n
static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMimeType, char** pUsedMimeType) static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMimeType, char** pUsedMimeType)
{ {
comphelper::ProfileZone aZone("doc_getTextSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3127,6 +3187,8 @@ static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi ...@@ -3127,6 +3187,8 @@ static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi
static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, const char* pData, size_t nSize) static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, const char* pData, size_t nSize)
{ {
comphelper::ProfileZone aZone("doc_paste");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3164,6 +3226,8 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons ...@@ -3164,6 +3226,8 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY) static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
{ {
comphelper::ProfileZone aZone("doc_setGraphicSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3180,6 +3244,8 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in ...@@ -3180,6 +3244,8 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in
static void doc_resetSelection(LibreOfficeKitDocument* pThis) static void doc_resetSelection(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_resetSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3564,6 +3630,8 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis) ...@@ -3564,6 +3630,8 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis)
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand) static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand)
{ {
comphelper::ProfileZone aZone("doc_getCommandValues");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3738,6 +3806,8 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo ...@@ -3738,6 +3806,8 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth, int nTilePixelHeight, static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth, int nTilePixelHeight,
int nTileTwipWidth, int nTileTwipHeight) int nTileTwipWidth, int nTileTwipHeight)
{ {
comphelper::ProfileZone aZone("doc_setClientZoom");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3754,6 +3824,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth ...@@ -3754,6 +3824,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth
static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight) static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight)
{ {
comphelper::ProfileZone aZone("doc_setClientVisibleArea");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3771,6 +3843,8 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int ...@@ -3771,6 +3843,8 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int
static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden) static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden)
{ {
comphelper::ProfileZone aZone("doc_setOutlineState");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3787,6 +3861,8 @@ static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int ...@@ -3787,6 +3861,8 @@ static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int
static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{ {
comphelper::ProfileZone aZone("doc_createView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3796,6 +3872,8 @@ static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/ ...@@ -3796,6 +3872,8 @@ static int doc_createView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/
static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
{ {
comphelper::ProfileZone aZone("doc_destroyView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3805,6 +3883,8 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis ...@@ -3805,6 +3883,8 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis
static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
{ {
comphelper::ProfileZone aZone("doc_setView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3814,6 +3894,8 @@ static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, ...@@ -3814,6 +3894,8 @@ static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/,
static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{ {
comphelper::ProfileZone aZone("doc_getView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3823,6 +3905,8 @@ static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) ...@@ -3823,6 +3905,8 @@ static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{ {
comphelper::ProfileZone aZone("doc_getViewsCount");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3832,6 +3916,8 @@ static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThi ...@@ -3832,6 +3916,8 @@ static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThi
static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int* pArray, size_t nSize) static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int* pArray, size_t nSize)
{ {
comphelper::ProfileZone aZone("doc_getViewsIds");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3841,6 +3927,8 @@ static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis* ...@@ -3841,6 +3927,8 @@ static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*
static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const char* language) static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const char* language)
{ {
comphelper::ProfileZone aZone("doc_setViewLanguage");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3849,11 +3937,13 @@ static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p ...@@ -3849,11 +3937,13 @@ static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p
} }
unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/,
const char* pFontName, const char* pFontName,
const char* pChar, const char* pChar,
int* pFontWidth, int* pFontWidth,
int* pFontHeight) int* pFontHeight)
{ {
comphelper::ProfileZone aZone("doc_renderFont");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3967,6 +4057,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW ...@@ -3967,6 +4057,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
const int nWidth, const int nHeight, const int nWidth, const int nHeight,
const double fDPIScale) const double fDPIScale)
{ {
comphelper::ProfileZone aZone("doc_paintWindowDPI");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4031,6 +4123,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW ...@@ -4031,6 +4123,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction) static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction)
{ {
comphelper::ProfileZone aZone("doc_postWindow");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4056,6 +4150,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis, ...@@ -4056,6 +4150,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis,
const unsigned char* pCertificateBinary, const int nCertificateBinarySize, const unsigned char* pCertificateBinary, const int nCertificateBinarySize,
const unsigned char* pPrivateKeyBinary, const int nPrivateKeySize) const unsigned char* pPrivateKeyBinary, const int nPrivateKeySize)
{ {
comphelper::ProfileZone aZone("doc_insertCertificate");
if (!xContext.is()) if (!xContext.is())
return false; return false;
...@@ -4126,6 +4222,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis, ...@@ -4126,6 +4222,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis,
static bool doc_addCertificate(LibreOfficeKitDocument* pThis, static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
const unsigned char* pCertificateBinary, const int nCertificateBinarySize) const unsigned char* pCertificateBinary, const int nCertificateBinarySize)
{ {
comphelper::ProfileZone aZone("doc_addCertificate");
if (!xContext.is()) if (!xContext.is())
return false; return false;
...@@ -4181,6 +4279,8 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis, ...@@ -4181,6 +4279,8 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
static int doc_getSignatureState(LibreOfficeKitDocument* pThis) static int doc_getSignatureState(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getSignatureState");
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
if (!pDocument->mxComponent.is()) if (!pDocument->mxComponent.is())
...@@ -4203,6 +4303,8 @@ static int doc_getSignatureState(LibreOfficeKitDocument* pThis) ...@@ -4203,6 +4303,8 @@ static int doc_getSignatureState(LibreOfficeKitDocument* pThis)
static char* lo_getError (LibreOfficeKit *pThis) static char* lo_getError (LibreOfficeKit *pThis)
{ {
comphelper::ProfileZone aZone("lo_getError");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -4260,6 +4362,8 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis) ...@@ -4260,6 +4362,8 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis)
static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features) static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features)
{ {
comphelper::ProfileZone aZone("lo_setOptionalFeatures");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4279,6 +4383,8 @@ static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long con ...@@ -4279,6 +4383,8 @@ static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long con
static void lo_setDocumentPassword(LibreOfficeKit* pThis, static void lo_setDocumentPassword(LibreOfficeKit* pThis,
const char* pURL, const char* pPassword) const char* pURL, const char* pPassword)
{ {
comphelper::ProfileZone aZone("lo_setDocumentPassword");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4411,6 +4517,8 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: ...@@ -4411,6 +4517,8 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
/// Used only by LibreOfficeKit when used by Online to pre-initialize /// Used only by LibreOfficeKit when used by Online to pre-initialize
static void preloadData() static void preloadData()
{ {
comphelper::ProfileZone aZone("preload data");
// Create user profile in the temp directory for loading the dictionaries // Create user profile in the temp directory for loading the dictionaries
OUString sUserPath; OUString sUserPath;
rtl::Bootstrap::get("UserInstallation", sUserPath); rtl::Bootstrap::get("UserInstallation", sUserPath);
...@@ -4675,8 +4783,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char ...@@ -4675,8 +4783,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
if (eStage == PRE_INIT) if (eStage == PRE_INIT)
{ {
std::cerr << "Init vcl\n"; {
InitVCL(); comphelper::ProfileZone aInit("Init vcl");
std::cerr << "Init vcl\n";
InitVCL();
}
// pre-load all component libraries. // pre-load all component libraries.
if (!xContext.is()) if (!xContext.is())
...@@ -4696,10 +4807,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char ...@@ -4696,10 +4807,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
// 1) defaultBootstrap_InitialComponentContext() // 1) defaultBootstrap_InitialComponentContext()
// 2) comphelper::setProcessServiceFactory(xSFactory); // 2) comphelper::setProcessServiceFactory(xSFactory);
// 3) InitVCL() // 3) InitVCL()
aService->initialize({css::uno::makeAny<OUString>("preload")}); {
// Force load some modules comphelper::ProfileZone aInit("preload");
VclBuilder::preload(); aService->initialize({css::uno::makeAny<OUString>("preload")});
VclAbstractDialogFactory::Create(); }
{ // Force load some modules
comphelper::ProfileZone aInit("preload modules");
VclBuilder::preload();
VclAbstractDialogFactory::Create();
}
preloadData(); preloadData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment