webengine/osswebengine/WebCore/platform/network/symbian/DataConnection.cpp
branchRCL_3
changeset 49 919f36ff910f
parent 48 79859ed3eea9
--- a/webengine/osswebengine/WebCore/platform/network/symbian/DataConnection.cpp	Tue Aug 31 16:17:46 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/DataConnection.cpp	Wed Sep 01 12:28:30 2010 +0100
@@ -11,16 +11,15 @@
 *
 * Contributors:
 *
-* Description:
+* Description:  
 *
 */
 
 #include <f32file.h>
 #include <uri8.h>
-#include <escapeutils.h>
+#include <EscapeUtils.h>
 #include <apmrec.h>
 #include <apgcli.h>
-//#include <imcvcodc.h>
 #include <tconvbase64.h>
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
@@ -149,9 +148,7 @@
                 body = HBufC8::NewLC( 2 * data.Length() );
                 TPtr8 decodedBody( body->Des() );
                 // urlPtr8
-                //TImCodecB64 codec;
-                //codec.Initialise();
-                TBase64 codec;
+                TBase64 codec; 
                 ok = codec.Decode( data, decodedBody );
             }
             if( !ok ) { // if not base64, simple copy
@@ -162,7 +159,8 @@
             }
         }
     }
-    m_maxSize = body->Length();
+    if(body != NULL)
+        m_maxSize = body->Length();
 }
 
 void DataConnection::cancel()
@@ -178,7 +176,11 @@
                               const WebCore::ResourceRequest& request,
                               const WebCore::ResourceResponse& response)
 {
-    __ASSERT_ALWAYS(EFalse, User::Panic(_L("Resource Loader"), KErrArgument));
+// This routine would implement the handling of a sisx file in   
+   //  <iframe src="data:x-epoc/x-sis-x;base64, ...."> type element    
+        // This is not yet implemented so the ASSERT below is commented out to prevent   
+        //   an assert crash.  
+        //  __ASSERT_ALWAYS(EFalse, User::Panic(_L("Resource Loader"), KErrArgument));  
 }
 
 TInt DataConnection::sendResponseCb(TAny* aPtr)
@@ -201,12 +203,17 @@
     HBufC8* encoding = NULL;
     HBufC8* body = NULL;
     parseUrlLC(contentType, encoding, body);
-
-    ResourceResponse response(m_handle->request().url().des(), contentType->Des(), body->Length(), encoding->Des(), String() );
-    CResourceHandleManager::self()->receivedResponse(m_handle, response, this);
-    CResourceHandleManager::self()->receivedData(m_handle, body->Des(), body->Length(), this);
+    if(body != NULL)
+        {
+        ResourceResponse response(m_handle->request().url().des(), contentType->Des(), body->Length(), encoding->Des(), String() );
+        CResourceHandleManager::self()->receivedResponse(m_handle, response, this);
+        CResourceHandleManager::self()->receivedData(m_handle, body->Des(), body->Length(), this);
+        }
     CResourceHandleManager::self()->receivedFinished(m_handle, KErrNone, this);
-    CleanupStack::PopAndDestroy(3); // contentType, encoding, body
+    if(body != NULL)
+        CleanupStack::PopAndDestroy(3); // contentType, encoding, body
+    else
+        CleanupStack::PopAndDestroy(2); // contentType, encoding
     derefHandle();
     }