imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp
changeset 39 1a8af2cd6858
parent 34 1c05ae5a7e41
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Fri Aug 06 09:40:38 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailfetchedchecker.cpp	Mon Aug 23 13:32:17 2010 +0300
@@ -17,6 +17,11 @@
 
 #include "thumbnailfetchedchecker.h"
 #include "thumbnaillog.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "thumbnailfetchedcheckerTraces.h"
+#endif
+
 
 const int KMaxStoredEntries = 100;
 
@@ -53,6 +58,7 @@
 TInt CThumbnailFetchedChecker::LastFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize )
     {
     TN_DEBUG3( "CThumbnailFetchedChecker::LastFetchResult(aUri=%S aThumbnailSize=%d)", &aUri, aThumbnailSize);
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_LASTFETCHRESULT, "CThumbnailFetchedChecker::LastFetchResult;aUri=%S;aThumbnailSize=%hu", aUri, aThumbnailSize );
 
     CEntry* entry = NULL;
     TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, KErrNone ) );
@@ -62,6 +68,7 @@
         if ( ret != KErrNotFound )
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> error found");
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_LASTFETCHRESULT, "CThumbnailFetchedChecker::LastFetchResult  - error found" );
             delete entry;
             entry = NULL;
             return iNotFetched[ ret ]->iError;
@@ -81,6 +88,7 @@
 void CThumbnailFetchedChecker::SetFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError )
     {
     TN_DEBUG4( "CThumbnailFetchedChecker::SetFetchResult(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError);
+    OstTraceExt3( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
     if ( aError == KErrNone )
         {
         // Remove successful results from store
@@ -92,6 +100,7 @@
             if ( i >= 0 )
                 {
                 TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Remove successful results from store %d",  iNotFetched.Count() );
+                OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;iNotFetched.Count()=%d", iNotFetched.Count() );
                 delete iNotFetched[ i ];
                 iNotFetched[ i ] = NULL;
                 iNotFetched.Remove( i );
@@ -106,6 +115,7 @@
         // Add or update
         CEntry* entry = NULL;
         TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, aError ) );
+        OstTraceExt3( TRACE_NORMAL, DUP4_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
         if ( !err && entry )
             {
             err = iNotFetched.Find( entry );
@@ -116,6 +126,7 @@
                 if ( i >= 0 )
                     {
                     TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> Update fetched tn error" );
+                    OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult - Update fetched tn error" );
                     iNotFetched[ i ]->iError = aError;
                     }
                 }
@@ -128,6 +139,7 @@
                     if ( err == KErrNone )
                         {
                         TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Inserted new fetched tn error %d", iNotFetched.Count());	
+                        OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILFETCHEDCHECKER_SETFETCHRESULT, "CThumbnailFetchedChecker::SetFetchResult;iNotFetched.Count()=%d", iNotFetched.Count() );
                         entry = NULL; // owned by array now
                         }
                     }
@@ -146,6 +158,7 @@
 void CThumbnailFetchedChecker::DeleteFetchResult( const TDesC& aUri )
     {
     TN_DEBUG2( "CThumbnailFetchedChecker::DeleteFetchResult(%S)", &aUri);
+    OstTraceExt1( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_DELETEFETCHRESULT, "CThumbnailFetchedChecker::DeleteFetchResult;aUri=%S", aUri );
     // delete all entries of passed uri
     TInt ret;
     do
@@ -154,6 +167,7 @@
         if ( ret >= 0 )
             {
             TN_DEBUG1( "CThumbnailFetchedChecker::DeleteFetchResult() -> Deteled URI from fetched list" );	
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_DELETEFETCHRESULT, "CThumbnailFetchedChecker::DeleteFetchResult - Deteled URI from fetched list" );
             delete iNotFetched[ ret ];
             iNotFetched[ ret ] = NULL;
             iNotFetched.Remove( ret );
@@ -170,6 +184,7 @@
 void CThumbnailFetchedChecker::RenameFetchResultL( const TDesC& aNewUri, const TDesC& aOldUri )
     {
     TN_DEBUG3( "CThumbnailFetchedChecker::RenameFetchResult(aNewUri=%S aOldUri=%S)", &aNewUri, &aOldUri);
+    OstTraceExt2( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_RENAMEFETCHRESULTL, "CThumbnailFetchedChecker::RenameFetchResultL;aNewUri=%S;aOldUri=%S", aNewUri, aOldUri );
     // change every occurence of passed uri
     TInt ret;
     do
@@ -182,6 +197,7 @@
 
             iNotFetched[ ret ]->iUri = aNewUri.AllocL();
             TN_DEBUG1( "CThumbnailFetchedChecker::RenameeFetchResult() -> Renamed URI in fetched list" );	
+            OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILFETCHEDCHECKER_RENAMEFETCHRESULTL, "CThumbnailFetchedChecker::RenameFetchResultL - Renamed URI in fetched list" );
             }
         }
     while(ret != KErrNotFound );
@@ -195,6 +211,7 @@
 void CThumbnailFetchedChecker::Reset()
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::Reset()");
+    OstTrace0( TRACE_NORMAL, CTHUMBNAILFETCHEDCHECKER_RESET, "CThumbnailFetchedChecker::Reset" );
     iNotFetched.ResetAndDestroy();
     }
 
@@ -206,6 +223,7 @@
         const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError )
     {
     TN_DEBUG4( "CThumbnailFetchedChecker::CEntry::NewL(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError);
+    OstTraceExt3( TRACE_NORMAL, CENTRY_NEWL, "CEntry::NewL;aUri=%S;aThumbnailSize=%u;aError=%d", aUri, aThumbnailSize, aError );
     CEntry* self  = new (ELeave) CEntry();
     if ( self )
         {
@@ -229,6 +247,7 @@
         const CThumbnailFetchedChecker::CEntry& aEntry, const CThumbnailFetchedChecker::CEntry& aEntry1 )
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::FindCB");
+    OstTrace0( TRACE_NORMAL, CENTRY_FINDCB, "CEntry::FindCB" );
     if( aEntry1.iSize == aEntry.iSize)
         {
         // return index if size and uri matches
@@ -248,6 +267,7 @@
         const TDesC* aUri, const CThumbnailFetchedChecker::CEntry& aEntry )
     {
     TN_DEBUG2( "CThumbnailFetchedChecker::CEntry::FindCBUri(aUri=%S", &aUri);
+    OstTrace0( TRACE_NORMAL, CENTRY_FINDCBURI, "CEntry::FindCBUri" );
     return aUri->CompareF( *( aEntry.iUri ) );
     }
 
@@ -260,6 +280,7 @@
         const CThumbnailFetchedChecker::CEntry& aEntry2 )
     {
     TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::InsertCB");
+    OstTrace0( TRACE_NORMAL, CENTRY_INSERTCB, "CEntry::InsertCB" );
     if( aEntry1.iSize == aEntry2.iSize)
         {
         // return index if size and uri matches