[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

Michael Meeks michael.meeks at collabora.com
Wed Nov 25 15:25:13 PST 2015


 include/vcl/scheduler.hxx    |    1 +
 vcl/inc/saltimer.hxx         |    3 +++
 vcl/source/app/scheduler.cxx |   20 +++++++-------------
 3 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit 87d41e3b7d0cf000346ec412ae5af10a6d162849
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Nov 25 21:38:34 2015 +0000

    vcl: cleanup scheduler debug name usage.
    
    Change-Id: I94975d220452ca91cbbd9db5e7895fa0b3a88e4a

diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index da9af64..6dd8030 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -75,6 +75,7 @@ public:
     SchedulerPriority GetPriority() const { return mePriority; }
 
     void            SetDebugName( const sal_Char *pDebugName ) { mpDebugName = pDebugName; }
+    const char     *GetDebugName() { return mpDebugName; }
 
     // Call handler
     virtual void    Invoke() = 0;
diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx
index 04427ad..6bd3e07 100644
--- a/vcl/inc/saltimer.hxx
+++ b/vcl/inc/saltimer.hxx
@@ -67,6 +67,9 @@ struct ImplSchedulerData
 
     void Invoke();
 
+    const char *GetDebugName() const
+        { return mpScheduler && mpScheduler->GetDebugName() ?
+                mpScheduler->GetDebugName() : "unknown"; }
     static ImplSchedulerData *GetMostImportantTask( bool bTimer );
 };
 
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 265d6f6..210281f 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -164,11 +164,7 @@ void Scheduler::ProcessTaskScheduling( bool bTimerOnly )
     // tdf#91727 - NB. bTimerOnly is ultimately not used
     if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimerOnly)))
     {
-        // FIXME: move into a helper.
-        const char *pSchedulerName = pSchedulerData->mpScheduler->mpDebugName;
-        if (!pSchedulerName)
-            pSchedulerName = "unknown";
-        SAL_INFO("vcl.schedule", "Invoke task " << pSchedulerName);
+        SAL_INFO("vcl.schedule", "Invoke task " << pSchedulerData->GetDebugName());
 
         pSchedulerData->mnUpdateTime = tools::Time::GetSystemTicks();
         pSchedulerData->Invoke();
@@ -208,22 +204,20 @@ sal_uInt64 Scheduler::CalculateMinimumTimeout( bool &bHasActiveIdles )
         {
             if (!pSchedulerData->mbInScheduler)
             {
-                // FIXME: move into a helper.
-                const char *pSchedulerName = pSchedulerData->mpScheduler->mpDebugName;
-                if (!pSchedulerName)
-                    pSchedulerName = "unknown";
-
                 if ( !pSchedulerData->mpScheduler->IsIdle() )
                 {
                     sal_uInt64 nOldMinPeriod = nMinPeriod;
                     nMinPeriod = pSchedulerData->mpScheduler->UpdateMinPeriod(
                                                                 nOldMinPeriod, nTime );
-                    SAL_INFO("vcl.schedule", "Have active timer " << pSchedulerName <<
-                        "update min period from " << nOldMinPeriod << " to " << nMinPeriod);
+                    SAL_INFO("vcl.schedule", "Have active timer " <<
+                             pSchedulerData->GetDebugName() <<
+                             "update min period from " << nOldMinPeriod <<
+                             " to " << nMinPeriod);
                 }
                 else
                 {
-                    SAL_INFO("vcl.schedule", "Have active idle " << pSchedulerName);
+                    SAL_INFO("vcl.schedule", "Have active idle " <<
+                             pSchedulerData->GetDebugName());
                     bHasActiveIdles = true;
                 }
             }


More information about the Libreoffice-commits mailing list