imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp
branchRCL_3
changeset 21 6257223ede8a
parent 20 2b4b06654caa
child 22 9d4d3445ce6e
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Thu Aug 19 10:13:51 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp	Tue Aug 31 15:30:59 2010 +0300
@@ -19,6 +19,11 @@
 #include "thumbnailrequestqueue.h"
 #include "thumbnailrequestactive.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailrequestqueueTraces.h"
+#endif
+
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -67,10 +72,12 @@
 CThumbnailRequestQueue::~CThumbnailRequestQueue()
     {
     TN_DEBUG1( "CThumbnailRequestQueue::~CThumbnailRequestQueue()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CTHUMBNAILREQUESTQUEUE, "CThumbnailRequestQueue::~CThumbnailRequestQueue" );
     
     iRequests.ResetAndDestroy();
     
     TN_DEBUG1( "CThumbnailRequestQueue::~CThumbnailRequestQueue() - All requests deleted");
+    OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_CTHUMBNAILREQUESTQUEUE, "CThumbnailRequestQueue::~CThumbnailRequestQueue - All requests deleted" );
     }
 
 
@@ -82,6 +89,7 @@
 void CThumbnailRequestQueue::Process()
     {
     TN_DEBUG1( "CThumbnailRequestQueue::Process()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process" );
     
     while ( (iActiveRequests < KMaxClientRequests) &&
             (iRequests.Count() > iActiveRequests) )
@@ -101,6 +109,9 @@
                TN_DEBUG4( "CThumbnailRequestQueue::Process() - candidate at %d, id = %d, (0x%08x)", i, 
                        request->RequestId(), 
                        request);
+               OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;request->RequestId()=%u", request->RequestId() );
+               OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;request=%o", request );
+               
                reqPriority = request->Priority();
                if ( reqPriority > priority )
                    {
@@ -114,6 +125,7 @@
         if ( selectedRequest )
            {
            TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting next request");
+           OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process - starting next request" );
                     
            iActiveRequests++;
            
@@ -121,6 +133,7 @@
            if (err != KErrNone)
                {
                TN_DEBUG1( "CThumbnailRequestQueue::Process() - starting request failed");
+               OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process - starting request failed" );
                
                selectedRequest->StartError(err);
                }
@@ -133,6 +146,7 @@
     
     TN_DEBUG3( "CThumbnailRequestQueue::Process() end - requests: %d, active requests: %d",
                iRequests.Count(), iActiveRequests );
+    OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTQUEUE_PROCESS, "CThumbnailRequestQueue::Process;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 
@@ -148,6 +162,7 @@
     
     TN_DEBUG3( "CThumbnailRequestQueue::AddRequestL() end - requests: %d, active requests: %d",
                iRequests.Count(), iActiveRequests );
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_ADDREQUESTL, "CThumbnailRequestQueue::AddRequestL;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 void CThumbnailRequestQueue::RemoveCompleted( CThumbnailRequestActive* aRequestAO)
@@ -162,6 +177,9 @@
              {
              // delete completed task
              TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() - deleted id = %d (0x%08x)", request->RequestId(), request);
+             OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;request=%o", request );
+             OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;request->RequestId()=%u", request->RequestId() );
+             
              delete request;
              request = NULL;
              iRequests.Remove( i );
@@ -175,6 +193,7 @@
      
      TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() end - requests: %d, active requests: %d",
                     iRequests.Count(), iActiveRequests );
+     OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILREQUESTQUEUE_REMOVECOMPLETED, "CThumbnailRequestQueue::RemoveCompleted;iRequests.Count()=%d;iActiveRequests=%d", iRequests.Count(), iActiveRequests );
     }
 
 
@@ -186,6 +205,7 @@
 TInt CThumbnailRequestQueue::CancelRequest( const TThumbnailRequestId aRequestId )
     {
     TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - request ID: %d", aRequestId);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
     
     TInt res = KErrNotFound;
 
@@ -200,6 +220,7 @@
                 iRequests[i]->AsyncCancel();
                 
                 TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - canceled request ID: %d", aRequestId);
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
                 }
             else
                 {
@@ -208,6 +229,7 @@
                 iRequests.Remove( i );
                           
                 TN_DEBUG2( "CThumbnailRequestQueue::CancelRequest() - removed request ID: %d", aRequestId);
+                OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILREQUESTQUEUE_CANCELREQUEST, "CThumbnailRequestQueue::CancelRequest;aRequestId=%u", aRequestId );
                 }
 
             res = KErrNone;
@@ -232,6 +254,7 @@
                                              const TInt aNewPriority )
     {
     TN_DEBUG1( "CThumbnailRequestQueue::ChangePriority()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_CHANGEPRIORITY, "CThumbnailRequestQueue::ChangePriority" );
     
     TInt err = KErrNotFound;
     const TInt count = iRequests.Count();
@@ -259,6 +282,7 @@
 void CThumbnailRequestQueue::RequestComplete(CThumbnailRequestActive* aRequestAO)
     {
     TN_DEBUG2( "CThumbnailRequestQueue::RequestComplete(0x%08x)", aRequestAO);
+    OstTrace1( TRACE_NORMAL, CTHUMBNAILREQUESTQUEUE_REQUESTCOMPLETE, "CThumbnailRequestQueue::RequestComplete;aRequestAO=%o", aRequestAO );
     
     iActiveRequests--;
     if(iActiveRequests <= -1)