diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-17 16:14:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-17 16:52:34 +0100 |
commit | ab3acb7ef79fcae8776b8d1ce0e81da5698ef516 (patch) | |
tree | 0dad3a5d6c6897887cc8ff5c6837d83b7e89a070 /framework/source/dispatch | |
parent | Remove unused framework::WriteGuard::getMode (diff) | |
download | core-ab3acb7ef79fcae8776b8d1ce0e81da5698ef516.tar.gz core-ab3acb7ef79fcae8776b8d1ce0e81da5698ef516.zip |
Consolidate framework::{Read,Write}Guard
...now that it is obvious that they both do the same
Change-Id: I6878acca4750ef4204fe32a695b6d9e1c5140115
Diffstat (limited to 'framework/source/dispatch')
-rw-r--r-- | framework/source/dispatch/closedispatcher.cxx | 19 | ||||
-rw-r--r-- | framework/source/dispatch/dispatchinformationprovider.cxx | 5 | ||||
-rw-r--r-- | framework/source/dispatch/dispatchprovider.cxx | 11 | ||||
-rw-r--r-- | framework/source/dispatch/interceptionhelper.cxx | 11 | ||||
-rw-r--r-- | framework/source/dispatch/loaddispatcher.cxx | 5 | ||||
-rw-r--r-- | framework/source/dispatch/mailtodispatcher.cxx | 4 | ||||
-rw-r--r-- | framework/source/dispatch/oxt_handler.cxx | 2 | ||||
-rw-r--r-- | framework/source/dispatch/popupmenudispatcher.cxx | 5 | ||||
-rw-r--r-- | framework/source/dispatch/servicehandler.cxx | 4 | ||||
-rw-r--r-- | framework/source/dispatch/startmoduledispatcher.cxx | 7 | ||||
-rw-r--r-- | framework/source/dispatch/systemexec.cxx | 4 | ||||
-rw-r--r-- | framework/source/dispatch/windowcommanddispatch.cxx | 9 |
12 files changed, 38 insertions, 48 deletions
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 042250975ecc..f21ec96b9395 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -19,8 +19,7 @@ #include <dispatch/closedispatcher.hxx> #include <pattern/frame.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <framework/framelistanalyzer.hxx> #include <services.h> #include <general.h> @@ -150,7 +149,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // This reference indicates, that we was already called before and // our asynchronous process was not finished yet. @@ -260,7 +259,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback) sal_Bool bControllerSuspended = sal_False; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // Closing of all views, related to the same document, is allowed // only if the dispatched URL was ".uno:CloseDoc"! @@ -411,7 +410,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback) implts_notifyResultListener(xListener, nState, css::uno::Any()); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // This method was called asynchronous from our main thread by using a pointer. // We reached this method only, by using a reference to ourself :-) @@ -450,7 +449,7 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc if (bCloseAllOtherViewsToo) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -490,7 +489,7 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc sal_Bool CloseDispatcher::implts_closeFrame() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -506,7 +505,7 @@ sal_Bool CloseDispatcher::implts_closeFrame() return sal_False; // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xCloseFrame = css::uno::WeakReference< css::frame::XFrame >(); aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -518,7 +517,7 @@ sal_Bool CloseDispatcher::implts_closeFrame() sal_Bool CloseDispatcher::implts_establishBackingMode() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); @@ -549,7 +548,7 @@ sal_Bool CloseDispatcher::implts_establishBackingMode() sal_Bool CloseDispatcher::implts_terminateApplication() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx index 84eb4316ab87..0c7a7494a6b7 100644 --- a/framework/source/dispatch/dispatchinformationprovider.cxx +++ b/framework/source/dispatch/dispatchinformationprovider.cxx @@ -19,8 +19,7 @@ #include <dispatch/dispatchinformationprovider.hxx> #include <dispatch/closedispatcher.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <stdtypes.h> #include <services.h> @@ -132,7 +131,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > DispatchInformationProvider::implts_getAllSubProvider() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx index 2f855dfd5e10..7fc0208d9ea2 100644 --- a/framework/source/dispatch/dispatchprovider.cxx +++ b/framework/source/dispatch/dispatchprovider.cxx @@ -27,8 +27,7 @@ #include <pattern/window.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <dispatchcommands.h> #include <protocols.h> #include <services.h> @@ -107,7 +106,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL DispatchProvider::queryDis css::uno::Reference< css::frame::XDispatch > xDispatcher; /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::frame::XFrame > xOwner( m_xFrame.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); /* } SAFE */ @@ -492,7 +491,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_searchProt if (m_aProtocolHandlerCache.search(aURL,&aHandler)) { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // create it css::uno::Reference< css::frame::XDispatchProvider > xHandler; @@ -568,7 +567,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat css::uno::Reference< css::frame::XDispatch > xDispatchHelper; /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); /* } SAFE */ @@ -580,7 +579,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat // Attention: Such menue dispatcher must be a singleton for this frame - means our owner frame. // Otherwhise he can make some trouble. /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( ! m_xMenuDispatcher.is() ) { MenuDispatcher* pDispatcher = new MenuDispatcher( xContext, xOwner ); diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 370d07674063..6bed175da04c 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/interceptionhelper.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/frame/XInterceptorInfo.hpp> @@ -53,7 +52,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD throw(css::uno::RuntimeException, std::exception) { // SAFE { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // a) first search an interceptor, which match to this URL by it's URL pattern registration // Note: if it return NULL - it does not mean an empty interceptor list automaticly! @@ -126,7 +125,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: } // SAFE { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // a) no interceptor at all - set this instance as master for given interceptor // and set our slave as it's slave - and put this interceptor to the list. @@ -191,7 +190,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css:: throw css::uno::RuntimeException("NULL references not allowed as in parameter", xThis); // SAFE { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // search this interceptor ... // If it could be located inside cache - @@ -235,7 +234,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent { #ifdef FORCE_DESTRUCTION_OF_INTERCEPTION_CHAIN // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // check calli ... we accept such disposing call's only from our onwer frame. css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); diff --git a/framework/source/dispatch/loaddispatcher.cxx b/framework/source/dispatch/loaddispatcher.cxx index b028e5fd9f80..3d90d03b786d 100644 --- a/framework/source/dispatch/loaddispatcher.cxx +++ b/framework/source/dispatch/loaddispatcher.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/loaddispatcher.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/frame/DispatchResultState.hpp> @@ -87,7 +86,7 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL, css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::frame::XNotifyingDispatch* >(this), css::uno::UNO_QUERY); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // We are the only client of this load env object ... but // may a dispatch request before is still in progress (?!). diff --git a/framework/source/dispatch/mailtodispatcher.cxx b/framework/source/dispatch/mailtodispatcher.cxx index 72df6a7bd7b1..0be69d9e06c0 100644 --- a/framework/source/dispatch/mailtodispatcher.cxx +++ b/framework/source/dispatch/mailtodispatcher.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/mailtodispatcher.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -202,7 +202,7 @@ sal_Bool MailToDispatcher::implts_dispatch( const css::util::URL& css::uno::Reference< css::uno::XComponentContext > xContext; /* SAFE */{ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); xContext = m_xContext; /* SAFE */} diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx index dfaea211947e..de0fa0bdc3cb 100644 --- a/framework/source/dispatch/oxt_handler.cxx +++ b/framework/source/dispatch/oxt_handler.cxx @@ -19,8 +19,6 @@ #include <dispatch/oxt_handler.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> #include <services.h> #include <unotools/mediadescriptor.hxx> diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx index bc12aa3c9d1d..1419cfe050aa 100644 --- a/framework/source/dispatch/popupmenudispatcher.cxx +++ b/framework/source/dispatch/popupmenudispatcher.cxx @@ -21,9 +21,8 @@ #include <general.h> #include <framework/menuconfiguration.hxx> #include <framework/addonmenu.hxx> -#include <threadhelp/readguard.hxx> #include <threadhelp/resetableguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <properties.h> @@ -150,7 +149,7 @@ throw( css::uno::Exception, css::uno::RuntimeException, std::exception) css::uno::Reference< css::frame::XFrame > xFrame; /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); for (int a=0; a<lArguments.getLength(); ++a) { diff --git a/framework/source/dispatch/servicehandler.cxx b/framework/source/dispatch/servicehandler.cxx index 766009f421d0..66a7c99d84c6 100644 --- a/framework/source/dispatch/servicehandler.cxx +++ b/framework/source/dispatch/servicehandler.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/servicehandler.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -200,7 +200,7 @@ css::uno::Reference< css::uno::XInterface > ServiceHandler::implts_dispatch( con const css::uno::Sequence< css::beans::PropertyValue >& /*lArguments*/ ) throw( css::uno::RuntimeException ) { /* SAFE */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; aReadLock.unlock(); /* SAFE */ diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx index 90c5b6e613c4..ce08b00f8af6 100644 --- a/framework/source/dispatch/startmoduledispatcher.cxx +++ b/framework/source/dispatch/startmoduledispatcher.cxx @@ -21,8 +21,7 @@ #include <dispatch/startmoduledispatcher.hxx> #include <pattern/frame.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <framework/framelistanalyzer.hxx> #include <dispatchcommands.h> #include <targets.h> @@ -133,7 +132,7 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere return sal_False; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -164,7 +163,7 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere ::sal_Bool StartModuleDispatcher::implts_establishBackingMode() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/dispatch/systemexec.cxx b/framework/source/dispatch/systemexec.cxx index 183304506098..97a30ecd57c6 100644 --- a/framework/source/dispatch/systemexec.cxx +++ b/framework/source/dispatch/systemexec.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/systemexec.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -123,7 +123,7 @@ void SAL_CALL SystemExec::dispatchWithNotification( const css::util::URL& OUString sSystemURLWithVariables = aURL.Complete.copy(PROTOCOL_LENGTH, c); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index d19695d0bd69..51b88ff18ea5 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/windowcommanddispatch.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <targets.h> #include <services.h> @@ -59,7 +58,7 @@ WindowCommandDispatch::~WindowCommandDispatch() void WindowCommandDispatch::impl_startListening() { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); @@ -79,7 +78,7 @@ void WindowCommandDispatch::impl_startListening() void WindowCommandDispatch::impl_stopListening() { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); @@ -153,7 +152,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand) try { // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); |