webengine/osswebengine/WebKit/s60/webview/WmlResourceLoaderClient.cpp
changeset 11 c8a366e56285
parent 0 dd21522fd290
equal deleted inserted replaced
10:a359256acfc6 11:c8a366e56285
   143     TInt chunkIndex = 0;     
   143     TInt chunkIndex = 0;     
   144     if(m_contentLength > length && m_restLength){
   144     if(m_contentLength > length && m_restLength){
   145         chunkIndex++;     
   145         chunkIndex++;     
   146     }
   146     }
   147 
   147 
   148     if (m_contentType && m_charset && m_url) {
   148     if (m_contentType && m_charset && m_url && m_wmldispatcher) {
   149         m_wmldispatcher->WmlParameters( data, length, *m_contentType, *m_charset, m_httpStatus, chunkIndex, *m_url);        
   149         m_wmldispatcher->WmlParameters( data, length, *m_contentType, *m_charset, m_httpStatus, chunkIndex, *m_url);        
   150     }
   150     }
   151     
   151     
   152     m_restLength = m_contentLength - length;   
   152     m_restLength = m_contentLength - length;   
   153 }
   153 }
   154 
   154 
   155 void WmlResourceLoaderClient::didFinishLoading()
   155 void WmlResourceLoaderClient::didFinishLoading()
   156 {
   156 {
   157     TInt chunkIndex = -1;      // last chunk
   157     TInt chunkIndex = -1;      // last chunk
   158     if (m_contentType && m_charset && m_url) {
   158     if (m_contentType && m_charset && m_url && m_wmldispatcher) {
   159         m_wmldispatcher->WmlParameters( NULL, 0, *m_contentType, *m_charset, m_httpStatus, chunkIndex, *m_url );
   159         m_wmldispatcher->WmlParameters( NULL, 0, *m_contentType, *m_charset, m_httpStatus, chunkIndex, *m_url );
   160     }
   160     }
   161     m_wmldispatcher->HandleError(0,KErrCompletion);
   161     if ( m_wmldispatcher ) {
       
   162         m_wmldispatcher->HandleError(0,KErrCompletion);
       
   163     }
   162 }
   164 }
   163 
   165 
   164 void WmlResourceLoaderClient::didFail(const WebCore::ResourceError& error)
   166 void WmlResourceLoaderClient::didFail(const WebCore::ResourceError& error)
   165 {    
   167 {    
   166     m_wmldispatcher->HandleError(0,error.errorCode());
   168     if ( m_wmldispatcher ) {
       
   169         m_wmldispatcher->HandleError(0,error.errorCode());
       
   170     }
   167 }
   171 }
   168 
   172 
   169 void WmlResourceLoaderClient::didCancel(const WebCore::ResourceError& error)
   173 void WmlResourceLoaderClient::didCancel(const WebCore::ResourceError& error)
   170 {
   174 {
   171     m_wmldispatcher->HandleError(0,error.errorCode());
   175     if ( m_wmldispatcher ) {
       
   176         m_wmldispatcher->HandleError(0,error.errorCode());
       
   177     }
   172 }
   178 }
   173 
   179 
   174 // End of File
   180 // End of File
   175 
   181