diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-07 15:09:30 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2024-05-07 20:58:27 +0200 |
commit | d7505494725414f4720b282d9b0b91b03d71e60d (patch) | |
tree | b6e4679d7cb4f29701dc50172edc3968bbac80aa /desktop/inc | |
parent | 83269aa84a0af8b9a32424af6b01815aaad4f42a (diff) |
Restore "flush CallbackFlushHandler queue via PostUserEvent..."
This reverts commit 041516806bdaa351ec22846754cf030905be53da.
which turns out not to be the problem, where the real problem was
a genuine failure of coolwsd to start, see:
https: //github.com/CollaboraOnline/online/pull/8983
Change-Id: Id344c6f007f290da430cbba8131d427300df1643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167286
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'desktop/inc')
-rw-r--r-- | desktop/inc/lib/init.hxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 323a508098f5..536faf00aff9 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -93,12 +93,11 @@ namespace desktop { }; /// One instance of this per view, handles flushing callbacks - class DESKTOP_DLLPUBLIC CallbackFlushHandler final : public Idle, public SfxLokCallbackInterface + class DESKTOP_DLLPUBLIC CallbackFlushHandler final : public SfxLokCallbackInterface { public: explicit CallbackFlushHandler(LibreOfficeKitDocument* pDocument, LibreOfficeKitCallback pCallback, void* pData); virtual ~CallbackFlushHandler() override; - virtual void Invoke() override; // TODO This should be dropped and the binary libreOfficeKitViewCallback() variants should be called? void queue(const int type, const OString& data); @@ -189,7 +188,8 @@ namespace desktop { typedef std::vector<int> queue_type1; typedef std::vector<CallbackData> queue_type2; - void startTimer(); + void scheduleFlush(); + void invoke(); bool removeAll(int type); bool removeAll(int type, const std::function<bool (const CallbackData&)>& rTestFunc); bool processInvalidateTilesEvent(int type, CallbackData& aCallbackData); @@ -200,6 +200,8 @@ namespace desktop { void enqueueUpdatedTypes(); void enqueueUpdatedType( int type, const SfxViewShell* sourceViewShell, int viewId ); + void stop(); + /** we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly. */ queue_type1 m_queue1; @@ -230,18 +232,12 @@ namespace desktop { LibreOfficeKitDocument* m_pDocument; int m_viewId = -1; // view id of the associated SfxViewShell LibreOfficeKitCallback m_pCallback; + ImplSVEvent* m_pFlushEvent; void *m_pData; int m_nDisableCallbacks; std::recursive_mutex m_mutex; - class TimeoutIdle : public Timer - { - public: - TimeoutIdle( CallbackFlushHandler* handler ); - virtual void Invoke() override; - private: - CallbackFlushHandler* mHandler; - }; - TimeoutIdle m_TimeoutIdle; + + DECL_LINK(FlushQueue, void*, void); }; struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public _LibreOfficeKitDocument |