Kaydet (Commit) e36e5dcc authored tarafından Arnaud Versini's avatar Arnaud Versini Kaydeden (comit) Noel Grandin

comphelper : Simplify guards in OAccessibleContextHelper.

Change-Id: Iabc7293370c7a8b3fdccb00d6e1cdbfac4c46992
Reviewed-on: https://gerrit.libreoffice.org/39445Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c5e45348
...@@ -48,6 +48,7 @@ namespace comphelper ...@@ -48,6 +48,7 @@ namespace comphelper
:public ::cppu::BaseMutex :public ::cppu::BaseMutex
,public OAccessibleContextHelper_Base ,public OAccessibleContextHelper_Base
{ {
friend class OContextEntryGuard;
private: private:
std::unique_ptr<OContextHelper_Impl> m_pImpl; std::unique_ptr<OContextHelper_Impl> m_pImpl;
...@@ -103,21 +104,6 @@ namespace comphelper ...@@ -103,21 +104,6 @@ namespace comphelper
*/ */
virtual css::lang::Locale SAL_CALL getLocale( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override;
public:
// helper struct for granting selective access rights
struct OAccessControl
{
friend class OContextEntryGuard;
friend class OContextHelper_Impl;
friend class OExternalLockGuard;
private:
OAccessControl() { }
};
// ensures that the object is alive
inline void ensureAlive( const OAccessControl& ) const;
inline ::osl::Mutex& GetMutex( const OAccessControl& );
protected: protected:
// OComponentHelper // OComponentHelper
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;
...@@ -162,21 +148,8 @@ namespace comphelper ...@@ -162,21 +148,8 @@ namespace comphelper
}; };
inline void OAccessibleContextHelper::ensureAlive( const OAccessControl& ) const
{
ensureAlive();
}
inline ::osl::Mutex& OAccessibleContextHelper::GetMutex( const OAccessControl& )
{
return GetMutex();
}
//= OContextEntryGuard //= OContextEntryGuard
typedef ::osl::ClearableMutexGuard OContextEntryGuard_Base;
/** helper class for guarding the entry into OAccessibleContextHelper methods. /** helper class for guarding the entry into OAccessibleContextHelper methods.
<p>The class has two responsibilities: <p>The class has two responsibilities:
...@@ -189,7 +162,7 @@ namespace comphelper ...@@ -189,7 +162,7 @@ namespace comphelper
you derived class. you derived class.
</p> </p>
*/ */
class OContextEntryGuard : public OContextEntryGuard_Base class OContextEntryGuard : public ::osl::ClearableMutexGuard
{ {
public: public:
/** constructs the guard /** constructs the guard
...@@ -206,9 +179,9 @@ namespace comphelper ...@@ -206,9 +179,9 @@ namespace comphelper
inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext ) inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext )
:OContextEntryGuard_Base( _pContext->GetMutex( OAccessibleContextHelper::OAccessControl() ) ) : ::osl::ClearableMutexGuard( _pContext->GetMutex() )
{ {
_pContext->ensureAlive( OAccessibleContextHelper::OAccessControl() ); _pContext->ensureAlive();
} }
......
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