imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp
branchRCL_3
changeset 21 6257223ede8a
parent 19 f759b6186ab5
child 22 9d4d3445ce6e
equal deleted inserted replaced
20:2b4b06654caa 21:6257223ede8a
    23 #include "thumbnailprovider.h"
    23 #include "thumbnailprovider.h"
    24 #include "thumbnaillog.h"
    24 #include "thumbnaillog.h"
    25 #include "thumbnailpanic.h"
    25 #include "thumbnailpanic.h"
    26 #include "thumbnailserversession.h"  // ConvertSqlErrToE32Err()
    26 #include "thumbnailserversession.h"  // ConvertSqlErrToE32Err()
    27 #include "thumbnailmanagerconstants.h"
    27 #include "thumbnailmanagerconstants.h"
       
    28 #include "OstTraceDefinitions.h"
       
    29 #ifdef OST_TRACE_COMPILER_IN_USE
       
    30 #include "thumbnailtaskTraces.h"
       
    31 #endif
       
    32 
    28 
    33 
    29 // ======== MEMBER FUNCTIONS ========
    34 // ======== MEMBER FUNCTIONS ========
    30 
    35 
    31 // ---------------------------------------------------------------------------
    36 // ---------------------------------------------------------------------------
    32 // CThumbnailTask::CThumbnailTask()
    37 // CThumbnailTask::CThumbnailTask()
    83 // ---------------------------------------------------------------------------
    88 // ---------------------------------------------------------------------------
    84 //
    89 //
    85 void CThumbnailTask::StartL()
    90 void CThumbnailTask::StartL()
    86     {
    91     {
    87     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartL() iState == %d ", this, iState );
    92     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartL() iState == %d ", this, iState );
       
    93     OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_STARTL, "CThumbnailTask::StartL;this=%o", this );
       
    94     OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_STARTL, "CThumbnailTask::StartL;iState=%u", iState );
       
    95     
    88     __ASSERT_DEBUG(( iState != ERunning ), ThumbnailPanic( EThumbnailAlreadyRunning ));
    96     __ASSERT_DEBUG(( iState != ERunning ), ThumbnailPanic( EThumbnailAlreadyRunning ));
    89     iState = ERunning;
    97     iState = ERunning;
    90     }
    98     }
    91 
    99 
    92 
   100 
   106 //
   114 //
   107 void CThumbnailTask::Complete( TInt aReason )
   115 void CThumbnailTask::Complete( TInt aReason )
   108     {
   116     {
   109     TN_DEBUG4( "CThumbnailTask(0x%08x)::Complete(aReason=%d) iState was %d",
   117     TN_DEBUG4( "CThumbnailTask(0x%08x)::Complete(aReason=%d) iState was %d",
   110         this, aReason, iState );
   118         this, aReason, iState );
       
   119     OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_COMPLETE, "CThumbnailTask::Complete;this=%o", this );
       
   120     OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_COMPLETE, "CThumbnailTask::Complete;aReason=%d;iState=%u", aReason, iState );
   111     
   121     
   112     if ( iState != EComplete )
   122     if ( iState != EComplete )
   113         {
   123         {
   114         iState = EComplete;
   124         iState = EComplete;
   115         
   125         
   154 void CThumbnailTask::StartError( TInt aError )
   164 void CThumbnailTask::StartError( TInt aError )
   155     {
   165     {
   156     // This is called if StartL() left. Complete this task with an error and
   166     // This is called if StartL() left. Complete this task with an error and
   157     // continue processing.
   167     // continue processing.
   158     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartError(aError=%d)", this, aError );
   168     TN_DEBUG3( "CThumbnailTask(0x%08x)::StartError(aError=%d)", this, aError );
       
   169     OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_STARTERROR, "CThumbnailTask::StartError;this=%o", this );
       
   170     OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_STARTERROR, "CThumbnailTask::StartError;aError=%d", aError );
       
   171     
   159     Complete( aError );
   172     Complete( aError );
   160     }
   173     }
   161 
   174 
   162 
   175 
   163 // ---------------------------------------------------------------------------
   176 // ---------------------------------------------------------------------------
   187         iClientThread.Duplicate(aClientThread);
   200         iClientThread.Duplicate(aClientThread);
   188         }
   201         }
   189     else
   202     else
   190         {
   203         {
   191         TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - message null", this);
   204         TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - message null", this);
       
   205         OstTrace1( TRACE_NORMAL, CTHUMBNAILTASK_SETMESSAGEDATA, "CThumbnailTask::SetMessageData - message null;this=%o", this );
   192         }
   206         }
   193     }
   207     }
   194 
   208 
   195 // ---------------------------------------------------------------------------
   209 // ---------------------------------------------------------------------------
   196 // CThumbnailTask::SetMessageData()
   210 // CThumbnailTask::SetMessageData()
   245 // ---------------------------------------------------------------------------
   259 // ---------------------------------------------------------------------------
   246 //
   260 //
   247 TBool CThumbnailTask::ClientThreadAlive(const TBool aGetThread)
   261 TBool CThumbnailTask::ClientThreadAlive(const TBool aGetThread)
   248     {
   262     {
   249     TN_DEBUG1( "CThumbnailTask::ClientThreadAlive()");
   263     TN_DEBUG1( "CThumbnailTask::ClientThreadAlive()");
       
   264     OstTrace0( TRACE_NORMAL, CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive" );
   250     
   265     
   251     if ( iMessage.Handle())
   266     if ( iMessage.Handle())
   252         {
   267         {
   253         if (aGetThread)
   268         if (aGetThread)
   254             {
   269             {
   255             // get client thread
   270             // get client thread
   256             TInt err = iMessage.Client( iClientThread );
   271             TInt err = iMessage.Client( iClientThread );
   257             if (err != KErrNone)
   272             if (err != KErrNone)
   258                 {
   273                 {
   259                 TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread not found", this);
   274                 TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread not found", this);
       
   275                 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive - client thread not found;this=%o", this );
   260             
   276             
   261                 ResetMessageData();
   277                 ResetMessageData();
   262                 
   278                 
   263                 return EFalse;
   279                 return EFalse;
   264                 }
   280                 }
   267         // check if client thread alive
   283         // check if client thread alive
   268         TExitType exitType = iClientThread.ExitType();
   284         TExitType exitType = iClientThread.ExitType();
   269         if( exitType != EExitPending )
   285         if( exitType != EExitPending )
   270             {
   286             {
   271             TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread died", this);
   287             TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread died", this);
       
   288             OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILTASK_CLIENTTHREADALIVE, "CThumbnailTask::ClientThreadAlive -  client thread died;this=%o", this );
   272         
   289         
   273             ResetMessageData();
   290             ResetMessageData();
   274             
   291             
   275             return EFalse;
   292             return EFalse;
   276             }
   293             }