webengine/osswebengine/cache/src/HttpCacheFileWriteHandler.cpp
changeset 10 a359256acfc6
child 11 c8a366e56285
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of CHttpCacheFileWriteHandler
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "HttpCacheFileWriteHandler.h"
       
    20 #include "HttpCacheEntry.h"
       
    21 #include "HttpCacheHandler.h"
       
    22 #include "HttpCacheStreamHandler.h"
       
    23 #include "HttpCachePostponeWriteUtilities.h"
       
    24 #include "HttpCacheUtil.h"
       
    25 #include <HttpCacheManagerInternalCRKeys.h>
       
    26 #include <centralrepository.h>
       
    27 #include <hal.h>
       
    28 #include <f32file.h>
       
    29 
       
    30 // EXTERNAL DATA STRUCTURES
       
    31 
       
    32 // EXTERNAL FUNCTION PROTOTYPES
       
    33 
       
    34 // CONSTANTS
       
    35 const TInt KMaxCollectCount = 5;    // collect a max of 5 items.
       
    36 
       
    37 // MACROS
       
    38 
       
    39 // LOCAL CONSTANTS AND MACROS
       
    40 
       
    41 // MODULE DATA STRUCTURES
       
    42 
       
    43 // LOCAL FUNCTION PROTOTYPES
       
    44 
       
    45 void CHttpCacheFileWriteHandler::OutputQueueContentToDebug()
       
    46     {
       
    47 #ifdef __CACHELOG__
       
    48     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:  %d objects on queue. Contents:"), iObjectQueue.Count());
       
    49     TBuf<80> txt;
       
    50     TInt totalSize=0;
       
    51     for(TInt tmploop = 0; tmploop <iObjectQueue.Count(); tmploop++)
       
    52         {
       
    53         CHttpCacheEntry* entry = iObjectQueue[tmploop];
       
    54         txt.Format(_L("CACHEPOSTPONE:    %d:  %d bytes - Cache:%08x -"), tmploop, entry->BodySize(), entry );
       
    55         totalSize+=entry->BodySize();
       
    56         HttpCacheUtil::WriteUrlToLog( 0, txt, entry->Url() );
       
    57         }
       
    58     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:    %d bytes cached"), totalSize);
       
    59 #endif
       
    60     }
       
    61 
       
    62 // FORWARD DECLARATIONS
       
    63 
       
    64 // ============================ MEMBER FUNCTIONS ===============================
       
    65 // -----------------------------------------------------------------------------
       
    66 // CHttpCacheFileWriteHandler::CHttpCacheFileWriteHandler
       
    67 // C++ default constructor can NOT contain any code, that
       
    68 // might leave.
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 CHttpCacheFileWriteHandler::CHttpCacheFileWriteHandler(CHttpCacheHandler* aHandler, CHttpCacheStreamHandler* aStreamHandler, RFs& aRfs)
       
    72     : CActive(EPriorityHigh),
       
    73       iCacheHandler( aHandler ),
       
    74       iCacheStreamHandler(aStreamHandler),
       
    75       iFs(aRfs)
       
    76     {
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CHttpCacheFileWriteHandler::ConstructL
       
    81 // Symbian 2nd phase constructor can leave.
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CHttpCacheFileWriteHandler::ConstructL(const TInt aWriteTimeout)
       
    85     {
       
    86     iObjectQueue.Reset();
       
    87     iObjectQueue.ReserveL(32);
       
    88 
       
    89     iWaitTimer = CHttpCacheWriteTimeout::NewL( aWriteTimeout );
       
    90     CActiveScheduler::Add(this);
       
    91 
       
    92     MemoryManager::AddCollector(this);
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CHttpCacheFileWriteHandler::NewL
       
    97 // Two-phased constructor.
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 CHttpCacheFileWriteHandler* CHttpCacheFileWriteHandler::NewL(CHttpCacheHandler* aHandler, CHttpCacheStreamHandler* aStreamHandler, RFs& aRfs, const TInt aWriteTimeout)
       
   101     {
       
   102     CHttpCacheFileWriteHandler* self = new( ELeave ) CHttpCacheFileWriteHandler(aHandler, aStreamHandler, aRfs);
       
   103 
       
   104     CleanupStack::PushL( self );
       
   105     self->ConstructL(aWriteTimeout);
       
   106     CleanupStack::Pop();
       
   107 
       
   108     return self;
       
   109     }
       
   110 
       
   111 // -----------------------------------------------------------------------------
       
   112 // Destructor
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 CHttpCacheFileWriteHandler::~CHttpCacheFileWriteHandler()
       
   116     {
       
   117     Cancel();
       
   118 
       
   119     DumpAllObjects();
       
   120 
       
   121     if ( iWaitTimer )
       
   122         {
       
   123         iWaitTimer->Cancel();
       
   124         delete iWaitTimer;
       
   125         }
       
   126 
       
   127     MemoryManager::RemoveCollector( this );
       
   128     }
       
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 // CHttpCacheFileWriteHandler::DumpAllObjectsL
       
   132 // Emergency method - write everything to disk synchronously.
       
   133 // -----------------------------------------------------------------------------
       
   134 //
       
   135 void CHttpCacheFileWriteHandler::DumpAllObjects()
       
   136     {
       
   137 #ifdef __CACHELOG__
       
   138     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::DumpAllObjects"));
       
   139     OutputQueueContentToDebug();
       
   140 #endif
       
   141     for ( TInt i=0; i < iObjectQueue.Count(); i++ )
       
   142         {
       
   143         iCacheStreamHandler->Flush(*iObjectQueue[i]);
       
   144         }
       
   145         iObjectQueue.Reset();
       
   146 #ifdef __CACHELOG__
       
   147     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::DumpAllObjects"));
       
   148 #endif
       
   149     }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CHttpCacheFileWriteHandler::CompareHttpCacheEntrySize
       
   153 // -----------------------------------------------------------------------------
       
   154 //
       
   155 TInt CHttpCacheFileWriteHandler::CompareHttpCacheEntrySize( const CHttpCacheEntry& aFirst, const CHttpCacheEntry& aSecond )
       
   156     {
       
   157     TInt first = aFirst.BodySize();
       
   158     TInt second = aSecond.BodySize();
       
   159 
       
   160     if ( first > second )
       
   161         {
       
   162         return -1;
       
   163         }
       
   164 
       
   165     if ( second > first )
       
   166         {
       
   167         return 1;
       
   168         }
       
   169 
       
   170     return 0;
       
   171     }
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // CHttpCacheFileWriteHandler::CollectMemory
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 void CHttpCacheFileWriteHandler::CollectMemory(TUint aRequired)
       
   178     {
       
   179 #ifdef __CACHELOG__
       
   180     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::CollectMemory looking for %d bytes"), aRequired);
       
   181     OutputQueueContentToDebug();
       
   182 #endif
       
   183     if ( !iObjectQueue.Count() )
       
   184         {
       
   185         return;
       
   186         }
       
   187 
       
   188     TInt count = KMaxCollectCount;
       
   189     while ( aRequired && count && iObjectQueue.Count() )
       
   190         {
       
   191         count--;
       
   192         CHttpCacheEntry* entry = iObjectQueue[0];
       
   193         iObjectQueue.Remove(0);
       
   194         TInt size = entry->BodySize();
       
   195         iCacheStreamHandler->Flush(*entry);
       
   196         aRequired -= size;
       
   197         }
       
   198     }
       
   199 
       
   200 // -----------------------------------------------------------------------------
       
   201 // CHttpCacheFileWriteHandler::AddEntry
       
   202 // -----------------------------------------------------------------------------
       
   203 //
       
   204 TInt CHttpCacheFileWriteHandler::AddEntry(TAddStatus &aAddStatus, CHttpCacheEntry* aEntry)
       
   205     {
       
   206 #ifdef __CACHELOG__
       
   207     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::AddEntry"));
       
   208 #endif
       
   209 
       
   210     if ( iImmediateWriteThreshold && ( aEntry->BodySize() <= iImmediateWriteThreshold ) )
       
   211         {
       
   212         aAddStatus = EBodySmallerThanThreshold;
       
   213 #ifdef __CACHELOG__
       
   214     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:   File smaller than minimum"));
       
   215     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::AddEntry"));
       
   216 #endif
       
   217         return KErrNone;
       
   218         }
       
   219 
       
   220     // only ask about available system memory, deliberately conservative.
       
   221     TInt freeMem;
       
   222     HAL::Get(HALData::EMemoryRAMFree, freeMem);
       
   223 
       
   224 #ifdef __CACHELOG__
       
   225     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:  %d free memory (according to HAL)"), freeMem);
       
   226 #endif
       
   227 
       
   228     if ( freeMem < iFreeRamThreshold )
       
   229         {
       
   230         aAddStatus = ENotEnoughFreeMemory;
       
   231 #ifdef __CACHELOG__
       
   232         HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:   Not enough spare RAM to postpone"));
       
   233         HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::AddEntry"));
       
   234 #endif
       
   235         iLowMemoryState = ETrue;
       
   236 
       
   237         if ( iWaitTimer->IsActive() )
       
   238             {
       
   239             // we have some items queued for write, begin to flush them since we're going to run out of memory soon anyway.
       
   240             iWaitTimer->Cancel();
       
   241             BeginWriting();
       
   242             }
       
   243 
       
   244         return KErrNone;
       
   245         }
       
   246 
       
   247     // if we get here, we're not in low memory state any more.
       
   248     iLowMemoryState = EFalse;
       
   249 
       
   250     // add entry to queue
       
   251     TInt err = iObjectQueue.InsertInOrderAllowRepeats(aEntry, TLinearOrder<CHttpCacheEntry>(CompareHttpCacheEntrySize));
       
   252 
       
   253     #ifdef __CACHELOG__
       
   254     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE: CHttpCacheFileWriteHandler: Added object %08x to postpone queue."), aEntry);
       
   255     OutputQueueContentToDebug();
       
   256 #endif
       
   257 
       
   258     // reset timer
       
   259     if ( err == KErrNone )
       
   260         {
       
   261         aAddStatus = EAddedOk;
       
   262         iWaitTimer->Start( CHttpCacheFileWriteHandler::WriteTimeout, this );
       
   263         }
       
   264     else
       
   265         {
       
   266         aAddStatus = ECheckReturn;
       
   267         }
       
   268 
       
   269 #ifdef __CACHELOG__
       
   270     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::AddEntry"));
       
   271 #endif
       
   272 
       
   273     return err;
       
   274     }
       
   275 
       
   276 // -----------------------------------------------------------------------------
       
   277 // CHttpCacheFileWriteHandler::RemoveEntry
       
   278 // -----------------------------------------------------------------------------
       
   279 //
       
   280 CHttpCacheEntry* CHttpCacheFileWriteHandler::RemoveEntry(CHttpCacheEntry *aEntry)
       
   281     {
       
   282     CHttpCacheEntry *entry = aEntry;
       
   283 
       
   284 #ifdef __CACHELOG__
       
   285     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::RemoveEntry called for entry %08x"), aEntry);
       
   286 #endif
       
   287 
       
   288     // take object off list.
       
   289     if ( aEntry == iObjectFlushing && IsActive() )
       
   290         {
       
   291 #ifdef __CACHELOG__
       
   292         HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE: CHttpCacheFileWriteHandler::RemoveEntry - entry %08x is currently being written. Returning 'not found'."), aEntry);
       
   293 #endif
       
   294         // the object will be removed from the list when it's done writing out, so we don't need to worry about it
       
   295         entry = 0;
       
   296         // back off from flushing anything else for a bit in case we want that as well..
       
   297         iWaitTimer->Start(CHttpCacheFileWriteHandler::WriteTimeout, this);
       
   298         }
       
   299     else
       
   300         {
       
   301 #ifdef __CACHELOG__
       
   302         HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE: CHttpCacheFileWriteHandler::RemoveEntry - entry %08x not active."), aEntry);
       
   303 #endif
       
   304         TInt index = iObjectQueue.Find( aEntry );
       
   305         if ( index >= 0 )
       
   306             {
       
   307             iObjectQueue.Remove( index );
       
   308             if ( !iObjectQueue.Count() )
       
   309                 {
       
   310 #ifdef __CACHELOG__
       
   311                 HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: CHttpCacheFileWriteHandler::RemoveEntry - nothing left on list, stopping timer."));
       
   312 #endif
       
   313                 // nothing on the list, so stop the timer.
       
   314                 iWaitTimer->Cancel();
       
   315                 }
       
   316             }
       
   317         }
       
   318 
       
   319 #ifdef __CACHELOG__
       
   320     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::RemoveEntry"));
       
   321 #endif
       
   322 
       
   323     return entry;
       
   324     }
       
   325 
       
   326 // -----------------------------------------------------------------------------
       
   327 // CHttpCacheFileWriteHandler::RemoveAll
       
   328 // -----------------------------------------------------------------------------
       
   329 //
       
   330 void CHttpCacheFileWriteHandler::RemoveAll()
       
   331     {
       
   332     // empty list - note that HttpCacheEntries aren't owned.
       
   333     iObjectQueue.Reset();
       
   334     // stop us if we're active
       
   335     Cancel();
       
   336     }
       
   337 
       
   338 // -----------------------------------------------------------------------------
       
   339 // CHttpCacheFileWriteHandler::WriteTimeout
       
   340 // -----------------------------------------------------------------------------
       
   341 //
       
   342 TInt CHttpCacheFileWriteHandler::WriteTimeout(TAny* aObject)
       
   343     {
       
   344     CHttpCacheFileWriteHandler *obj = (CHttpCacheFileWriteHandler *)aObject;
       
   345 
       
   346 #ifdef __CACHELOG__
       
   347     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: FileWriteHandler::WriteTimeout expired"));
       
   348 #endif
       
   349 
       
   350     obj->BeginWriting();
       
   351     return KErrNone;
       
   352     }
       
   353 
       
   354 // -----------------------------------------------------------------------------
       
   355 // CHttpCacheFileWriteHandler::BeginWriting
       
   356 // -----------------------------------------------------------------------------
       
   357 //
       
   358 void CHttpCacheFileWriteHandler::BeginWriting()
       
   359     {
       
   360 #ifdef __CACHELOG__
       
   361     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::BeginWriting"));
       
   362 #endif
       
   363 
       
   364     if ( !IsActive() )
       
   365         {
       
   366 #ifdef __CACHELOG__
       
   367         HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:   Setting FileWriteHandler %08x to active."), this);
       
   368 #endif
       
   369         iStatus = KRequestPending;
       
   370         SetActive();
       
   371         TRequestStatus *stat = &iStatus;
       
   372         User::RequestComplete(stat, KErrNone);
       
   373         }
       
   374 #ifdef __CACHELOG__
       
   375     else
       
   376         {
       
   377         HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:   FileWriteHandler %08x already active!"), this);
       
   378         }
       
   379 
       
   380     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::BeginWriting"));
       
   381 #endif
       
   382     }
       
   383 
       
   384 // -----------------------------------------------------------------------------
       
   385 // CHttpCacheFileWriteHandler::DoCancel
       
   386 // -----------------------------------------------------------------------------
       
   387 //
       
   388 void CHttpCacheFileWriteHandler::DoCancel()
       
   389     {
       
   390     }
       
   391 
       
   392 // -----------------------------------------------------------------------------
       
   393 // CHttpCacheFileWriteHandler::RunL
       
   394 // -----------------------------------------------------------------------------
       
   395 //
       
   396 void CHttpCacheFileWriteHandler::RunL()
       
   397     {
       
   398 #ifdef __CACHELOG__
       
   399     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: >>FileWriteHandler::RunL"));
       
   400     OutputQueueContentToDebug();
       
   401 #endif
       
   402 
       
   403     TInt result = iStatus.Int();
       
   404 
       
   405     // first, see if we have been writing anything
       
   406     if ( iObjectFlushing )
       
   407         {
       
   408 #ifdef __CACHELOG__
       
   409     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:     iObjectFlushing set, been writing something."));
       
   410 #endif
       
   411 
       
   412         // should always be first item, find just in case...
       
   413         TInt index = iObjectQueue.Find(iObjectFlushing);
       
   414 
       
   415 #ifdef __CACHELOG__
       
   416         if ( index < 0 )
       
   417             HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:     iObjectFlushing (%08x) not found in object queue!"), iObjectFlushing);
       
   418 #endif
       
   419 
       
   420         if ( index >= 0 )
       
   421             {
       
   422 #ifdef __CACHELOG__
       
   423             HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:    iObjectFlushing (%08x) is at position %d in list"), iObjectFlushing, index);
       
   424 #endif
       
   425             // the object might not exist in the queue.. how can this happen?
       
   426             iObjectQueue.Remove(index);
       
   427             //
       
   428             if ( result != KErrNone )
       
   429                 {
       
   430 #ifdef __CACHELOG__
       
   431                 HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:     FileWriteHandler::RunL Failure while writing object %08x"), iObjectFlushing);
       
   432 #endif
       
   433                 // write failed.  Clean up this entry.
       
   434                 // first, remove it from the cache handler so that we won't try to reuse a dead entry
       
   435                 iCacheHandler->RemoveL( iObjectFlushing->Url() );
       
   436                 }
       
   437             }
       
   438         iObjectFlushing = 0;
       
   439         }
       
   440 
       
   441     // next, check to see if we've added anything to the cache while we've been writing out.
       
   442     TInt count = iObjectQueue.Count();
       
   443     if ( iWaitTimer->IsActive() )
       
   444         {
       
   445 #ifdef __CACHELOG__
       
   446         HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:     FileWriteHandler::RunL New entry detected on postpone queue, wait for timeout again."));
       
   447 #endif
       
   448         // something has been added to the queue, back off until it completes.
       
   449         // this case intentionally left blank...
       
   450         }
       
   451     else
       
   452         {
       
   453         // remove any items from the top of the queue which have no body data.
       
   454         while ( iObjectQueue.Count() && iObjectQueue[0]->BodySize() == 0 )
       
   455             {
       
   456             iObjectQueue.Remove(0);
       
   457             };
       
   458 
       
   459         // check to see if there is anything ready to write out
       
   460         if ( iObjectQueue.Count() )
       
   461             {
       
   462             SetActive();
       
   463             iStatus = KRequestPending;
       
   464             iCacheStreamHandler->FlushAsync( *iObjectQueue[0], iStatus );
       
   465             iObjectFlushing = iObjectQueue[0];
       
   466 #ifdef __CACHELOG__
       
   467             HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:     FileWriteHandler::RunL continue cache flush, Starting object %08x."), iObjectFlushing);
       
   468 #endif
       
   469             }
       
   470         else
       
   471             {   // nothing left to write, go idle.
       
   472     #ifdef __CACHELOG__
       
   473             HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:     FileWriteHandler::RunL complete with nothing else to write."));
       
   474     #endif
       
   475             iCacheHandler->SaveLookupTableL();
       
   476             iLowMemoryState = EFalse;
       
   477             }
       
   478         }
       
   479     }
       
   480 
       
   481 // -----------------------------------------------------------------------------
       
   482 // CHttpCacheFileWriteHandler::Collect
       
   483 // -----------------------------------------------------------------------------
       
   484 //
       
   485 TUint CHttpCacheFileWriteHandler::Collect(TUint aRequired)
       
   486     {
       
   487 #ifdef __CACHELOG__
       
   488     HttpCacheUtil::WriteFormatLog(0, _L("CACHEPOSTPONE:  >>FileWriteHandler::Collect on FileWriteHandler %08x (low memory collector)"), this);
       
   489 #endif
       
   490     if ( iWaitTimer->IsActive() )
       
   491         {
       
   492 #ifdef __CACHELOG__
       
   493         HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:    Wait timer is active, cancel it and call DumpAllObjects"));
       
   494 #endif
       
   495 
       
   496         iWaitTimer->Cancel();
       
   497         CollectMemory( aRequired );
       
   498         iLowMemoryState = ETrue;
       
   499         BeginWriting();
       
   500         }
       
   501 #ifdef __CACHELOG__
       
   502     else
       
   503         {
       
   504         HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE:    Wait timer not active."));
       
   505         }
       
   506     HttpCacheUtil::WriteLog(0, _L("CACHEPOSTPONE: <<FileWriteHandler::Collect"));
       
   507 #endif
       
   508     return 0;
       
   509     }
       
   510 
       
   511 // -----------------------------------------------------------------------------
       
   512 // CHttpCacheFileWriteHandler::Restore
       
   513 // -----------------------------------------------------------------------------
       
   514 //
       
   515 void CHttpCacheFileWriteHandler::Restore()
       
   516     {
       
   517     // not supported
       
   518     }
       
   519 
       
   520 // -----------------------------------------------------------------------------
       
   521 // CHttpCacheFileWriteHandler::Priority
       
   522 // -----------------------------------------------------------------------------
       
   523 //
       
   524 TOOMPriority CHttpCacheFileWriteHandler::Priority()
       
   525     {
       
   526     return EOOM_PriorityLow;
       
   527     }
       
   528 
       
   529 // -----------------------------------------------------------------------------
       
   530 // CHttpCacheFileWriteHandler::IsCacheEntryPostponed
       
   531 // -----------------------------------------------------------------------------
       
   532 //
       
   533 TBool CHttpCacheFileWriteHandler::IsCacheEntryPostponed(const CHttpCacheEntry* aEntry)
       
   534     {
       
   535     TInt index = iObjectQueue.Find( aEntry );
       
   536 
       
   537     if ( index >= 0 )
       
   538         {
       
   539         return ETrue;
       
   540         }
       
   541 
       
   542     return EFalse;
       
   543     }
       
   544 
       
   545 //  End of File