summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav-curl/CurlSession.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/webdav-curl/CurlSession.cxx')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index e60bd6ef1d36..a80c19f6d690 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -14,9 +14,13 @@
#include "UCBDeadPropertyValue.hxx"
#include "webdavresponseparser.hxx"
+#include <cppuhelper/implbase.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/attributelist.hxx>
#include <comphelper/scopeguard.hxx>
#include <comphelper/string.hxx>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <o3tl/safeint.hxx>
#include <o3tl/string_view.hxx>
@@ -26,6 +30,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/io/Pipe.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/io/SequenceInputStream.hpp>
#include <com/sun/star/io/SequenceOutputStream.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
@@ -2430,4 +2435,42 @@ auto CurlSession::NonInteractive_UNLOCK(OUString const& rURI) -> void
} // namespace http_dav_ucp
+namespace
+{
+/// Manage lifecycle of global DAV worker threads
+class WebDAVManager : public cppu::WeakImplHelper<css::lang::XServiceInfo>,
+ public comphelper::LibreOfficeKit::ThreadJoinable
+{
+public:
+ WebDAVManager() {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override
+ {
+ return "com.sun.star.comp.WebDAVManager";
+ }
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
+ {
+ return { "com.sun.star.ucb.WebDAVManager" };
+ }
+
+ // comphelper::LibreOfficeKit::ThreadJoinable
+ virtual bool joinThreads() override { return g_Init.LockStore.joinThreads(); }
+
+ virtual void startThreads() override { g_Init.LockStore.startThreads(); }
+};
+
+} // anonymous namespace
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_webdav_manager_get_implementation(css::uno::XComponentContext*,
+ css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new WebDAVManager());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */