webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.cpp
branchRCL_3
changeset 41 4bd5176e1bc8
parent 40 8bfb9186a8b8
child 42 a1a5d4e727e8
equal deleted inserted replaced
40:8bfb9186a8b8 41:4bd5176e1bc8
    40 #include "ResourceHandleClient.h"
    40 #include "ResourceHandleClient.h"
    41 
    41 
    42 // CONSTANTS
    42 // CONSTANTS
    43 _LIT8( KHttpProtString, "HTTP/TCP" );
    43 _LIT8( KHttpProtString, "HTTP/TCP" );
    44 _LIT (KNullStr, "");
    44 _LIT (KNullStr, "");
    45 
    45 const TInt KResetRetryFlagTimeOut = 5*1000*1000;
       
    46 TInt doResetFlag(TAny*);
    46 class MBrCtlSpecialLoadObserver;
    47 class MBrCtlSpecialLoadObserver;
    47 
    48 
    48 using namespace WebCore;
    49 using namespace WebCore;
    49 
    50 
    50 HttpSessionManager::HttpSessionManager()
    51 HttpSessionManager::HttpSessionManager()
    58     m_cookieHandler = NULL;
    59     m_cookieHandler = NULL;
    59     m_httpDownload = NULL;
    60     m_httpDownload = NULL;
    60     m_SelfDownloadContentHandler = NULL;
    61     m_SelfDownloadContentHandler = NULL;
    61     m_SelfDownloadContentTypes = KNullStr().Alloc();
    62     m_SelfDownloadContentTypes = KNullStr().Alloc();
    62     retryConnectivityFlag = EFalse;
    63     retryConnectivityFlag = EFalse;
       
    64     m_resetTimer = NULL;
    63 }
    65 }
    64 
    66 
    65 HttpSessionManager::~HttpSessionManager()
    67 HttpSessionManager::~HttpSessionManager()
    66 {
    68 {
    67     delete m_cacheManager;
    69     delete m_cacheManager;
    74     m_httpDownload = NULL;
    76     m_httpDownload = NULL;
    75     delete m_SelfDownloadContentHandler;
    77     delete m_SelfDownloadContentHandler;
    76     m_SelfDownloadContentHandler = NULL;
    78     m_SelfDownloadContentHandler = NULL;
    77     delete m_SelfDownloadContentTypes;
    79     delete m_SelfDownloadContentTypes;
    78     m_SelfDownloadContentTypes = NULL;
    80     m_SelfDownloadContentTypes = NULL;
       
    81     if(m_resetTimer)
       
    82         {
       
    83         m_resetTimer->Cancel();
       
    84         delete m_resetTimer;
       
    85         m_resetTimer = NULL;
       
    86         }
    79     m_ClientAcceptHeaders.ResetAndDestroy();
    87     m_ClientAcceptHeaders.ResetAndDestroy();
    80     m_ClientAcceptHeaders.Close();
    88     m_ClientAcceptHeaders.Close();
    81     closeHttpSession();
    89     closeHttpSession();
    82 }
    90 }
    83 
    91 
   505             requests[i]->HttpTransaction()->Cancel();
   513             requests[i]->HttpTransaction()->Cancel();
   506         }
   514         }
   507     }
   515     }
   508 }
   516 }
   509 
   517 
       
   518 void HttpSessionManager::startTimer()
       
   519 {
       
   520 	RDebug::Printf("hamish HttpSessionManager::startTimer()");
       
   521     if(m_resetTimer)
       
   522         deleteTimer();
       
   523     m_resetTimer = CPeriodic::NewL(CActive::EPriorityStandard);
       
   524     m_resetTimer->Start(KResetRetryFlagTimeOut,0,TCallBack(&doResetFlag,this));
       
   525 }
       
   526 
       
   527 void HttpSessionManager::deleteTimer()
       
   528 {
       
   529     m_resetTimer->Cancel();
       
   530     delete m_resetTimer;
       
   531     m_resetTimer = NULL;
       
   532 }
       
   533     
       
   534 TInt doResetFlag(TAny* ptr)
       
   535 {
       
   536 	RDebug::Printf("hamish doResetFlag");
       
   537     HttpSessionManager* tmp = static_cast<HttpSessionManager*>(ptr);
       
   538     tmp->unSetRetryConnectivityFlag();
       
   539     tmp->deleteTimer();  
       
   540     return EFalse;
       
   541 }
       
   542 
   510 // end of file
   543 // end of file