Revision: 201026 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 19:53:20 +0300
branchRCL_3
changeset 46 30342f40acbf
parent 44 800203832575
child 47 e1bea15f9a39
Revision: 201026 Kit: 2010127
browserutilities/browsertelservice/src/BrowserTelService.cpp
browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrClntSubSession.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiDownloadsList.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiUserInteractions.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListArray.cpp
browserutilities/downloadmgr/downloadmgruilib/Src/CDownloadsStylusPopupMenu.cpp
browserutilities/favouritesengine/ClientServer/src/FavouritesItem.cpp
browserutilities/feedsengine/FeedsServer/Server/inc/UpdateManager.h
browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp
browserutilities/webutils/conf/webutils.confml
codhandler/codeng/inc/CodEngBase.h
codhandler/codeng/src/CodEngBase.cpp
codhandler/codeng/src/HttpLoader.cpp
web_plat/browser_platform_api/inc/Browser_platform_variant.hrh
web_plat/download_path_plugin_api/inc/DownloadPathHandler.inl
webengine/osswebengine/MemoryManager/BWINS/MEMMANU.DEF
webengine/osswebengine/MemoryManager/EABI/MemManU.DEF
webengine/osswebengine/MemoryManager/Group/MemMan.mmp
webengine/osswebengine/MemoryManager/Inc/MemoryLogger.h
webengine/osswebengine/MemoryManager/Inc/MemoryManager.h
webengine/osswebengine/MemoryManager/Inc/MemoryPool.h
webengine/osswebengine/MemoryManager/Inc/StopScheduler.h
webengine/osswebengine/MemoryManager/Inc/SymbianDlHeap.h
webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp
webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp
webengine/osswebengine/MemoryManager/Src/StopScheduler.cpp
webengine/osswebengine/MemoryManager/Src/SymbianDLAllocatorWrapper.cpp
webengine/osswebengine/MemoryManager/Src/fast_malloc.cpp
webengine/osswebengine/MemoryManager/Src/heap.cpp
webengine/osswebengine/WebCore/html/HTMLTokenizer.cpp
webengine/osswebengine/WebCore/loader/Cache.cpp
webengine/osswebengine/WebCore/loader/DocumentLoader.cpp
webengine/osswebengine/WebCore/loader/FrameLoader.cpp
webengine/osswebengine/WebCore/page/FrameView.cpp
webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp
webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h
webengine/osswebengine/WebCore/rendering/RenderBR.cpp
webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h
webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp
webengine/osswebengine/WebKit/s60/webcoresupport/WebFrameLoaderClient.cpp
webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp
webengine/osswebengine/WebKit/s60/webview/BrCtl.h
webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp
webengine/osswebengine/WebKit/s60/webview/WebScrollbarDrawer.cpp
webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp
webengine/osswebengine/WebKit/s60/webview/WebSprite.cpp
webengine/osswebengine/WebKit/s60/webview/WebSurface.h
webengine/osswebengine/WebKit/s60/webview/WebView.cpp
webengine/osswebengine/cache/inc/HttpCacheUtil.h
webengine/osswebengine/cache/src/HttpCacheEntry.cpp
webengine/osswebengine/cache/src/HttpCacheUtil.cpp
webengine/webkitutils/stmgesturefw/src/stateengine.cpp
webengine/webkitutils/stmgesturefw/src/statemachine.cpp
webengine/widgetinstaller/Src/WidgetInstaller.cpp
webengine/widgetregistry/Server/src/WidgetEntry.cpp
webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp
webengine/wmlengine/src/image/src/Epoc32ImageDecoder.cpp
webengine/wrtharvester/group/wrtharvester.mmp
webengine/wrtharvester/src/wrtharvester.cpp
widgets/widgetapp/src/WidgetUiAppUi.cpp
widgets/widgetapp/src/WidgetUiWindow.cpp
widgets/widgetapp/src/WidgetUiWindowContainer.cpp
widgets/widgetapp/src/WidgetUiWindowManager.cpp
widgets/widgetapp/src/cpspublisher.cpp
widgets/widgetinstaller/src/WidgetUIOperationsWatcher.cpp
--- a/browserutilities/browsertelservice/src/BrowserTelService.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/browsertelservice/src/BrowserTelService.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -1076,18 +1076,12 @@
     {
     TELSERVICE_ENTERFN( "FindAndRipVoipParametersL()" )
 
-    HBufC* buf = NULL;    
     TInt offset = aNumber.Locate( TChar( '@' ) );
     if( offset > 0 ) // Separator is not allowed to be a first char
         {
-        __ASSERT_DEBUG( offset <= aNumber.Length(), User::Leave( KErrGeneral ) );
-        buf = aNumber.Mid( offset ).AllocL();         
+        __ASSERT_DEBUG( offset <= aNumber.Length(), User::Leave( KErrGeneral ) );         
         aNumber.SetLength( offset );           
         }
-    else
-        {
-        buf = HBufC::NewL( 0 );
-        }
 
     TELSERVICE_LEAVEFN( "FindAndRipVoipParametersL()" )
     }
@@ -1600,7 +1594,7 @@
            loopCounter = 1;
         }
                    
-        for(loopCounter; loopCounter<len; loopCounter++)
+        for(; loopCounter<len; loopCounter++)
         {
             if( (*ptr >= '0' && *ptr <= '9') || *ptr == ',')
             {
--- a/browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrClntSubSession.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrClntSubSession.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -2737,7 +2737,7 @@
     		return KErrGeneral;
     		}
     		iDlExtension->SetBoolAttribute( aAttribute, aValue);
-    		return;
+    		return KErrNone;
     	}
     	
 	if (aAttribute == EDlAttrProgressive)
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiDownloadsList.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiDownloadsList.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -2236,12 +2236,9 @@
         {
         __ASSERT_DEBUG( 0<iListModel->Count(), Panic( EUiLibPanOptionsShownWhileNoDownloads ) );
 
-        TBool isCreated     = state == EHttpDlCreated;
         // The fix of PHAN-6KVK5R makes this line no longer necessary 
         // TBool isInProgress  = state == EHttpDlInprogress;
-        TBool isPaused      = state == EHttpDlPaused;
         TBool isCompleted   = state == EHttpDlMultipleMOCompleted;
-        TBool isFailed      = state == EHttpDlMultipleMOFailed;
         TBool isDrmDownload = EFalse;
         TBool isDrmRightsOnPhone = EFalse;
         TBool isPreviewRights = EFalse;
@@ -2281,7 +2278,10 @@
         canProgHandled = docHandler->CanHandleProgressivelyL( dataType, pdPlayerUid );
         CleanupStack::PopAndDestroy( docHandler ); // docHandler              
 
-#ifndef BRDO_SINGLE_CLICK_ENABLED_FF        
+#ifndef BRDO_SINGLE_CLICK_ENABLED_FF 
+        TBool isCreated     = state == EHttpDlCreated;
+        TBool isPaused      = state == EHttpDlPaused;
+        TBool isFailed      = state == EHttpDlMultipleMOFailed;
         //delete open file manager when download is not complete
         if( !(isCompleted))
             {
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiUserInteractions.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadMgrUiUserInteractions.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -354,7 +354,6 @@
     THttpDownloadState state;
     THttpProgressState progState;
     TBool isHiddenDel = EFalse;
-    TBool isCodDownload( EFalse );
     TBool isProg (EFalse);
     // check if progressive download, if yes, will NOT delete from the list, otherwise will
     const CDownloadArray& downloadsDel = iRegistryModel.DownloadMgr().CurrentDownloads();
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListArray.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListArray.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -66,9 +66,9 @@
     iDownloadedSize( KErrNotFound ),
     iIconIndex( KErrNotFound ),
     iPausable( EFalse ),
-    iExternalMemoryStatus( KDriveAttLocal ),
     iProgressState( KErrNotFound ),
-    iNumMediaObjects( KErrNotFound )
+    iNumMediaObjects( KErrNotFound ),
+    iExternalMemoryStatus( KDriveAttLocal )
     {
     }
 
--- a/browserutilities/downloadmgr/downloadmgruilib/Src/CDownloadsStylusPopupMenu.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/downloadmgr/downloadmgruilib/Src/CDownloadsStylusPopupMenu.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -29,8 +29,6 @@
 {
     ilongtapRunning = EFalse;
     iLongTapDetector = CAknLongTapDetector::NewL(this);
-    TResourceReader readerFolder;
-    TResourceReader readerItem;
 }
 
 // -----------------------------------------------------------------------------
@@ -97,7 +95,7 @@
        iStylusPopupMenu->SetItemDimmed(EDownloadsListCmdCancel,ETrue);
        iStylusPopupMenu->SetItemDimmed(EDownloadsListCmdResume,ETrue);
        }
-    if (state == EHttpDlPaused)
+    if (state == EHttpDlPaused || state == EHttpDlMultipleMOFailed)
         {
         isAiwcall = ETrue;
         iStylusPopupMenu->SetItemDimmed(EAiwCmdContact,ETrue);
--- a/browserutilities/favouritesengine/ClientServer/src/FavouritesItem.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/favouritesengine/ClientServer/src/FavouritesItem.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -298,6 +298,7 @@
 EXPORT_C TBool CFavouritesItem::SetHidden(TBool aHidden) const
     {
     iImpl->SetHidden( aHidden );
+    return ETrue;
     }
 
 // ---------------------------------------------------------
--- a/browserutilities/feedsengine/FeedsServer/Server/inc/UpdateManager.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/Server/inc/UpdateManager.h	Thu Jul 15 19:53:20 2010 +0300
@@ -122,7 +122,7 @@
      * @since 7.1
      * @return Integer.
      */
-    TInt StartL(); 
+    void StartL(); 
 
     /**
      * This method Stop the updation;
--- a/browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -152,7 +152,7 @@
 // 
 // Handles the Update of feed
 // -----------------------------------------------------------------------------     
-TInt CUpdateManager::StartL()
+void CUpdateManager::StartL()
     {
     iCurrentFeedCount = 0;
 
@@ -362,7 +362,7 @@
 // -----------------------------------------------------------------------------
 //
 CRoamingInfo::CRoamingInfo(CUpdateManager *aUpdateManager)
-	:CActive(CActive::EPriorityStandard),iUpdateManager(aUpdateManager),iNetworkRegistrationV1Pckg(iNetworkRegistrationV1)
+	:CActive(CActive::EPriorityStandard),iNetworkRegistrationV1Pckg(iNetworkRegistrationV1),iUpdateManager(aUpdateManager)
     {
     }
 
Binary file browserutilities/webutils/conf/webutils.confml has changed
--- a/codhandler/codeng/inc/CodEngBase.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/codhandler/codeng/inc/CodEngBase.h	Thu Jul 15 19:53:20 2010 +0300
@@ -588,6 +588,11 @@
         * @return Saver object for this data type. Ownership not passed.
         */
         CCodSaver* CreateSaverL( const TDesC8& aType );
+        
+        /* Fota Saver Setting
+         * 
+         */
+       void FotaSaverSettingL();
 
     private:    // implementation
     
--- a/codhandler/codeng/src/CodEngBase.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/codhandler/codeng/src/CodEngBase.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -1702,9 +1702,6 @@
     __ASSERT_DEBUG( iData->ActiveDownload(),CodPanic( ECodInternal ));
     // 1. Data type checking.
     TInt typeErr( KErrNone );    
-#ifdef __SYNCML_DM_FOTA
-    TBool fota( EFalse );
-#endif /*def __SYNCML_DM_FOTA */
     for ( TInt i = 0; i < (*iData)[iData->ActiveDownload()]->Types().MdcaCount() && !iContentTypeCheck; i++ )
         {
         const TDataType& type( (*iData)[iData->ActiveDownload()]->Types().MdcaPoint( i ) );
@@ -1745,7 +1742,6 @@
             {
             // Accept FOTA download. Special storage (not saved to FS).
             CLOG(( ECodEng, 4, _L8("  <%S> FOTA OK"), &mime ));
-            fota = ETrue;
             }
 #endif /*def __SYNCML_DM_FOTA */
         else 
@@ -1879,10 +1875,7 @@
             CodUtil::GetIntParam( pkgId, EGenericParamFotaPkgId, *iParams );
             }
         iSaver = CFotaSaver::NewL( aType, pkgId );
-        iSaver->SetObserver( iObserver );
-        iSaver->SetParams( iParams );
-        iSaver->SetMaxSize( iData->Size() );
-        iSaver->OpenStoreL();   // TODO unneeded method, put to construction.
+        FotaSaverSettingL();
         }
 #endif /*def __SYNCML_DM_FOTA */
     else
@@ -1891,9 +1884,15 @@
         //__ASSERT_DEBUG( iFsUsed, CodPanic( ECodInternal ) );
 
         TBool contentTypeMisMatch ( ETrue );
+        TBool fotadownload(EFalse);
         for ( TInt i = 0; i < (*iData)[iData->ActiveDownload()]->Types().MdcaCount(); i++ )
             {
             const TDataType& type( (*iData)[iData->ActiveDownload()]->Types().MdcaPoint( i ) );
+            if( type.Des8().Find(KFotaPackageDataType) !=KErrNotFound )
+                {
+                 fotadownload = ETrue;
+                 break;
+                }
             if((aType.Find (type.Des8()) != KErrNotFound) || iDocHandler->CanOpenL(TDataType(aType)) || 
                             ( (type.Des8().Find(KOma1DrmMessageContentType)!= KErrNotFound) && (aType.Find(KOma1DcfContentType)!= KErrNotFound )  ))             
                 {
@@ -1901,7 +1900,18 @@
                 break;
                 }                
             }
-        if(contentTypeMisMatch)
+        if (fotadownload)
+            {
+             TInt pkgId( KCodDefaultFotaPkgId );
+             if ( iParams )
+                {
+                 CodUtil::GetIntParam( pkgId, EGenericParamFotaPkgId, *iParams );
+                }
+             iSaver = CFotaSaver::NewL(KFotaPackageDataType(), pkgId );
+             FotaSaverSettingL();
+             return iSaver;
+           }
+       if(contentTypeMisMatch)
             {
             User::Leave(KErrCodAttributeMismatch);
             }
@@ -1957,6 +1967,18 @@
     }
 
 // ---------------------------------------------------------
+// CCodEngBase::FotaSaverSettingL
+// ---------------------------------------------------------
+//
+void CCodEngBase::FotaSaverSettingL()
+    {
+    iSaver->SetObserver( iObserver );
+    iSaver->SetParams( iParams );
+    iSaver->SetMaxSize( iData->Size() );
+    iSaver->OpenStoreL();   // TODO unneeded method, put to construction.
+    }
+
+// ---------------------------------------------------------
 // CCodEngBase::SetPathsL
 // ---------------------------------------------------------
 //
--- a/codhandler/codeng/src/HttpLoader.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/codhandler/codeng/src/HttpLoader.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -48,7 +48,6 @@
 #include "CodData.h"
 
 _LIT8( KDRMOldContentType, "x-drm-old-content-type");           // old content type header to be added
-_LIT8( KAcceptRangeHeader, "bytes");
 _LIT8( KAcceptRangeHeaderNone, "none");
 
 // ================= CONSTANTS =======================
--- a/web_plat/browser_platform_api/inc/Browser_platform_variant.hrh	Mon Jun 21 16:54:17 2010 +0300
+++ b/web_plat/browser_platform_api/inc/Browser_platform_variant.hrh	Thu Jul 15 19:53:20 2010 +0300
@@ -184,6 +184,9 @@
 //To enable performance improvements done in TB9.2
 #define BRDO_PERF_IMPROVEMENTS_ENABLED_FF
 
+//To enable modified cache-control = max-age feature
+#define BRDO_CACHE_MAX_AGE
+
 /*
 * ===================
 *        S60 3.23
@@ -276,6 +279,10 @@
 #define MW_LAYER_CONNECT_SYSTEMINCLUDE SYSTEMINCLUDE  OS_LAYER_PUBLIC_EXPORT_PATH(connect)
 #endif
 
+
+//To disable modified cache-control = max-age 
+#undef BRDO_CACHE_MAX_AGE
+
 /*
 * ===================
 *        S60 5.0 S60_50
@@ -360,6 +367,11 @@
 // Defines Symbian HTTP stack parameters specific for symbian 9.3 (e.g. EHttpEnableOptimalPipelining, EHttpOptimalPipelining)
 //Flag need to be removed after this fix is supplied to Symbian 9.4
 #undef BRDO_HTTP_STACK_93
+
+
+//To disable modified cache-control = max-age 
+#undef BRDO_CACHE_MAX_AGE
+
 /*
 * ===================
 *        S60 5.0 PF5250+
@@ -418,6 +430,9 @@
 // Defines Symbian HTTP stack parameters specific for symbian 9.3 (e.g. EHttpEnableOptimalPipelining, EHttpOptimalPipelining)
 //Flag need to be removed after this fix is supplied to Symbian 9.4
 #undef BRDO_HTTP_STACK_93
+
+//To enable modified cache-control = max-age 
+#define BRDO_CACHE_MAX_AGE
 /*
 * ===================
 *        S60 5.1
@@ -464,6 +479,10 @@
 // Defines Symbian HTTP stack parameters specific for symbian 9.3 (e.g. EHttpEnableOptimalPipelining, EHttpOptimalPipelining)
 //Flag need to be removed after this fix is supplied to Symbian 9.4
 #undef BRDO_HTTP_STACK_93
+
+//To disable modified cache-control = max-age 
+#undef BRDO_CACHE_MAX_AGE
+
 /*
 * ===================
 *        S60 5.2
@@ -528,4 +547,8 @@
 #define BRDO_BROWSER_UPDATE_UI_FF 0
 #endif // KFeatureIdIAUpdate
 
+
+//To enable modified cache-control = max-age 
+#define BRDO_CACHE_MAX_AGE
+
 #endif // BROWSER_PLATFORM_VARIANT_HRH
--- a/web_plat/download_path_plugin_api/inc/DownloadPathHandler.inl	Mon Jun 21 16:54:17 2010 +0300
+++ b/web_plat/download_path_plugin_api/inc/DownloadPathHandler.inl	Thu Jul 15 19:53:20 2010 +0300
@@ -2,7 +2,7 @@
   File        : DownloadPathHandler.inl
   Part of     : web_plat / download_path_plugin_api
   Description : Music path plugin interface inline implementation file
-  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
+  Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
 
   Copyright (c) 2010 Nokia Corporation.
   This material, including documentation and any related
--- a/webengine/osswebengine/MemoryManager/BWINS/MEMMANU.DEF	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/BWINS/MEMMANU.DEF	Thu Jul 15 19:53:20 2010 +0300
@@ -30,4 +30,5 @@
 	?InitFastAllocator@MemoryManager@@SAXXZ @ 29 NONAME ; void MemoryManager::InitFastAllocator(void)
 	?InitOOMDialog@MemoryManager@@SAXXZ @ 30 NONAME ; void MemoryManager::InitOOMDialog(void)
 	?ResetOOMDialogDisplayed@MemoryManager@@SAXXZ @ 31 NONAME ; void MemoryManager::ResetOOMDialogDisplayed(void)
+	?DumpMemoryLogs@MemoryManager@@SAXXZ @ 32 NONAME ; void MemoryManager::DumpMemoryLogs(void)
 
--- a/webengine/osswebengine/MemoryManager/EABI/MemManU.DEF	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/EABI/MemManU.DEF	Thu Jul 15 19:53:20 2010 +0300
@@ -42,4 +42,5 @@
 	_ZN13MemoryManager19CreateFastAllocatorEv @ 41 NONAME
 	_ZN13MemoryManager13InitOOMDialogEv @ 42 NONAME
 	_ZN13MemoryManager23ResetOOMDialogDisplayedEv @ 43 NONAME
+	_ZN13MemoryManager14DumpMemoryLogsEv @ 44 NONAME
 
--- a/webengine/osswebengine/MemoryManager/Group/MemMan.mmp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Group/MemMan.mmp	Thu Jul 15 19:53:20 2010 +0300
@@ -26,8 +26,10 @@
 OPTION ARMCC -O3 -Otime
 UID 0x1000008D  0x10281B6D
 
+// Define these macros for OOM logs
 //MACRO OOM_LOGGING
-//MACRO DL_CHUNK_MEM_DEBUG
+//#define OOM_LOGGING 1
+
 
 MACRO USE_FAST_MALLOC
 MACRO NOKIA_CHANGES
@@ -61,4 +63,7 @@
 LIBRARY   aknnotify.lib
 LIBRARY   commonengine.lib
 
-DEBUGLIBRARY flogger.lib
+#ifdef OOM_LOGGING
+LIBRARY flogger.lib
+LIBRARY efsrv.lib
+#endif
--- a/webengine/osswebengine/MemoryManager/Inc/MemoryLogger.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Inc/MemoryLogger.h	Thu Jul 15 19:53:20 2010 +0300
@@ -36,6 +36,14 @@
 _LIT8( KTab, "\t" );
 
 // MACROS
+#define MEM_LOG_CREATE()   \
+    RFs fs; \
+    _LIT( KFilePath, "C:\\Logs\\Webcore\\"); \
+    TFileName path (KFilePath); \
+    if(fs.Connect() == KErrNone) { \
+        fs.MkDirAll( path ); \
+        fs.Close(); \
+    }
 
 #define MEM_LOG(a)		{ _LIT8(temp, a); RFileLogger::Write(KMEMLogDir, KMEMLogFile, EFileLoggingModeAppend, temp); }
 #define MEM_LOGF		FPrint
@@ -127,6 +135,7 @@
 				loggers[ i ]->_accum += _peek;
 	}
 #else // OOM_LOGGING
+#define MEM_LOG_CREATE()
 #define MEM_LOG(a)
 #define MEM_LOGF
 #define C_LOG(a)
@@ -134,4 +143,4 @@
 #endif
 
 #endif
-// END OF FILE
\ No newline at end of file
+// END OF FILE
--- a/webengine/osswebengine/MemoryManager/Inc/MemoryManager.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Inc/MemoryManager.h	Thu Jul 15 19:53:20 2010 +0300
@@ -306,7 +306,7 @@
         * @param
         * @return
         */        
-        IMPORT_C static void MemoryManager::CreateFastAllocator();
+        IMPORT_C static void CreateFastAllocator();
 
         /**
         * Initialize MemoryManager library. Special case if CreateFastAllocator is
@@ -316,7 +316,7 @@
         * @param
         * @return
         */
-        IMPORT_C static void MemoryManager::InitFastAllocator();
+        IMPORT_C static void InitFastAllocator();
 
         /**
         * initialize the OOM handler in the memorypool
@@ -337,7 +337,15 @@
         * @return
         */
         IMPORT_C static void ResetOOMDialogDisplayed();
-        
+
+        /**
+        * Dumps the memory logs i.e. heap allocated, heap free, system free, heap size etc to log
+        * file c:\logs\webcore\Memory.log
+        * @since 9.2
+        * @param
+        * @return
+        */
+        IMPORT_C static void DumpMemoryLogs();
     };
 
 #endif// !_MEMORYMANAGER_H_
--- a/webengine/osswebengine/MemoryManager/Inc/MemoryPool.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Inc/MemoryPool.h	Thu Jul 15 19:53:20 2010 +0300
@@ -364,7 +364,7 @@
         void InitOOMDialog();
         void ResetOOMDialog();
 #ifdef OOM_LOGGING         
-        void DumpHeapLogs();
+        void DumpHeapLogs(TInt aFailSize);
 #endif        
     private:
     	void InitLocal();
--- a/webengine/osswebengine/MemoryManager/Inc/StopScheduler.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Inc/StopScheduler.h	Thu Jul 15 19:53:20 2010 +0300
@@ -23,6 +23,9 @@
 #include <MemoryManager.h>
 
 // CONSTANTS
+static const TUint KGoodMemoryThreshold = ( 4*1024*1024 ); // keep checking memory levels
+static const TUint KLowMemoryThreshold = ( 2*1024*1024 ); // should stop activities
+static const TUint KStopThreshold = ( 1024*1024 );  // unsafe limit
 
 // DATA TYPES
 
@@ -91,5 +94,4 @@
         RTimer          iCheckTimer;
         TInt            iNextStop;
 	};
-
-#endif
\ No newline at end of file
+#endif
--- a/webengine/osswebengine/MemoryManager/Inc/SymbianDlHeap.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Inc/SymbianDlHeap.h	Thu Jul 15 19:53:20 2010 +0300
@@ -255,6 +255,10 @@
     void dump_large_chunk(mstate m, tchunkptr t);
     size_t iUnmappedChunkSize;
 #endif
+    
+ 	// Indicates if allocator is running under low memory.
+	// It is set(TRUE) only when acquiring new pages from system.
+    TInt isLowSystemMemory; 
 private:
      /* Dubug checks for chunk page support*/
 #ifdef DL_CHUNK_MEM_DEBUG
--- a/webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -54,13 +54,13 @@
 EXPORT_C void MemoryManager::CreateFastAllocator()
     {
     // create the right memory pool
-    MEM_LOGF(_L8("MemoryManager::CreateFastAllocator - s_pool=%x"), s_pool);
+    MEM_LOG_CREATE();    
 #ifdef __NEW_ALLOCATOR__
     CMemoryPool *pool = new CNewSymbianHeapPool();
     pool->Create();
     RSymbianDlAllocatorWrapper* allocator = new RSymbianDlAllocatorWrapper((CNewSymbianHeapPool*)pool);
+    User::SwitchAllocator(allocator);
     MEM_LOGF(_L8("MemoryManager::CreateFastAllocator - new pool=%x, allocator=%x"), pool, allocator);
-    User::SwitchAllocator(allocator);
 #endif
     }
 
@@ -86,7 +86,7 @@
 EXPORT_C RAllocator* MemoryManager::SwitchToFastAllocator()
     {
     // create the right memory pool
-    //__ASSERT_DEBUG( s_pool == 0, User::Panic( KMemManPanicDes, 0 ) );
+    __ASSERT_DEBUG( s_pool == 0, User::Panic( KMemManPanicDes, 0 ) );
     MEM_LOGF(_L8("MemoryManager::SwitchToFastAllocator - s_pool=%x"), s_pool);
 #ifdef __NEW_ALLOCATOR__
     s_pool = new CNewSymbianHeapPool();
@@ -143,7 +143,6 @@
 //-----------------------------------------------------------------------------
 EXPORT_C void MemoryManager::AddCollector( MMemoryCollector* aCollector )
     {
-    MEM_LOGF(_L8("MemoryManager::AddCollector - s_pool=%x"), s_pool);
     Pool()->AddCollector( aCollector );
     }
 
@@ -160,7 +159,6 @@
 //-----------------------------------------------------------------------------
 EXPORT_C void MemoryManager::AddStopper( MOOMStopper* aStopper )
     {
-    MEM_LOGF(_L8("MemoryManager::AddStopper - s_pool=%x"), s_pool);
     Pool()->AddStopper( aStopper );
     }
 
@@ -244,3 +242,11 @@
     return Pool()->MemorySize( aPtr );
     }
 
+
+EXPORT_C void MemoryManager::DumpMemoryLogs()
+    {
+#if defined(OOM_LOGGING) && defined (__NEW_ALLOCATOR__)
+    CNewSymbianHeapPool *hPool = (CNewSymbianHeapPool *)Pool();
+    hPool->DumpHeapLogs(0);
+#endif    
+    }
--- a/webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -32,6 +32,7 @@
 #include <avkon.rsg>
 #include <StringLoader.h>
 #include <WebKit.rsg>
+#include "MemoryLogger.h"
 
 // CONSTANTS
 
@@ -132,6 +133,7 @@
 //-----------------------------------------------------------------------------
 void CMemoryPool::CollectMemory(TUint aSize)
     {
+    MEM_LOG("CMemoryPool::CollectMemory - run");
     if( iIsCollecting ) return;
 
     iIsCollecting = ETrue;
@@ -139,11 +141,9 @@
       {
         iCollectors[i]->Collect(aSize);
       }
-
-    User::CompressAllHeaps();
     iIsCollecting = EFalse;
 	
-	if (iStopScheduler)
+	if (iStopScheduler && !iIsStopping )
 		iStopScheduler->Start( CStopScheduler::ECheckMemory, aSize );
     }
 
@@ -467,11 +467,19 @@
 //-----------------------------------------------------------------------------
 // CNewSymbianHeapPool::FreeMemory
 //-----------------------------------------------------------------------------
-TUint CNewSymbianHeapPool::FreeMemory(TFreeMem& /*aFree*/ )
+TUint CNewSymbianHeapPool::FreeMemory(TFreeMem& aFree )
     {
     // TODO: implement free_memory
-    return KMaxTUint;
-//    return free_memory( aFree.iPool, aFree.iHeap, aFree.iHal );
+    aFree.iPool = 0;
+    aFree.iHeap = 0;
+    
+    TInt freeRAM; 
+    if(HAL::Get(HALData::EMemoryRAMFree, freeRAM) == KErrNone) 
+        aFree.iHal = freeRAM;
+    else
+        aFree.iHal = 0;
+    
+    return KMaxTUint; // not fully implemented
     }
 
 //-----------------------------------------------------------------------------
@@ -480,8 +488,16 @@
 TAny* CNewSymbianHeapPool::DoAlloc( TUint aSize )
     {
     TAny *p = iAlloc->Alloc( aSize );
-    if (!p)
+    if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
+        {
+        iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
+        iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
+        }
+        
+    if (!p) {
         ShowOOMDialog();
+        MEM_LOG("CNewSymbianHeapPool::DoAlloc - failed");
+    }
     return p;
     }
 
@@ -494,7 +510,12 @@
     iMemStatus &= ~ERescueOOM;
 
     TAny* p = iAlloc->ReAlloc( aPtr, aSize );
-    
+    if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
+        {
+        iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
+        iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
+        }
+
     // check memory manager status
     if( !p || iMemStatus & ERescueOOM )
         {
@@ -510,6 +531,11 @@
         NotifyAndStop();
         }
 
+#ifdef OOM_LOGGING    
+    if(!p)
+        MEM_LOG("CNewSymbianHeapPool::ReAllocate - failed");
+#endif
+
     return p;
     }
 
@@ -585,6 +611,11 @@
 		{
 		iMemStatus |= ECheckOOM;
 		NotifyAndStop();
+
+#ifdef OOM_LOGGING		
+		MEM_LOG("CNewSymbianHeapPool::PreCheck - failed !!");
+		DumpHeapLogs(aTotalSize);
+#endif		
 		return EFalse;
 		}
 	
@@ -711,6 +742,8 @@
 
 void CNewSymbianHeapPool::ShowOOMDialog()
     {
+    MEM_LOG("CNewSymbianHeapPool::ShowOOMDialog - called");
+    
     // Don't show it if we did once already
     if (iOOMDisplayed)
         return;
@@ -739,9 +772,9 @@
     }
 
 #ifdef OOM_LOGGING   
-void CNewSymbianHeapPool::DumpHeapLogs()
+void CNewSymbianHeapPool::DumpHeapLogs(TInt aFailSize)
     {
-    iAlloc->dump_heap_logs(0);
+    iAlloc->dump_heap_logs(aFailSize);
     iAlloc->dump_dl_free_chunks();
     }
 #endif
--- a/webengine/osswebengine/MemoryManager/Src/StopScheduler.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/StopScheduler.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -18,10 +18,10 @@
 #include "StopScheduler.h"
 #include "MemoryPool.h"
 #include "fast_malloc.h"
+#include "MemoryLogger.h"
+#include <hal.h>
 
 // MEMBER FUNCTIONS
-static const TUint KLessRAM = ( 2*1024*1024 );
-static const TUint KMinimumRAM = (1024 * 1024);
 static const TTimeIntervalMicroSeconds32 KMemoryCheckIntervalSlow = 1000000;        // 1 second
 static const TTimeIntervalMicroSeconds32 KMemoryCheckIntervalFast = 500000;         // 0.5 second
 
@@ -81,26 +81,33 @@
         }
     else if( iState == ECheckMemory )
         {
-        TFreeMem freeMem;
-        TInt total = iMemoryPool.FreeMemory( freeMem );
-
-        // see if free memory is enough to restore all collectors
-        if( freeMem.iHal >= KLessRAM )
+    
+        TInt systemFreeRAM; 
+        if(HAL::Get(HALData::EMemoryRAMFree, systemFreeRAM) != KErrNone) 
+            return;        
+        
+        // case 1: Good memory levels - no worry
+        if( systemFreeRAM > KGoodMemoryThreshold ) // Above 4MB
             {
-            iMemoryPool.RestoreCollectors( EOOM_PriorityLow );
+            iMemoryPool.RestoreCollectors( EOOM_PriorityLow ); // restore all collectors
             iState = EIdle;
             iNextStop = EAllStop;
 
             // recover the rescue buffer, if it is already released.
             iMemoryPool.RestoreRescueBuffer();
+            return;
             }
-        else if( freeMem.iHal >= KMinimumRAM/2 )
+        
+        // case 2: Going low - keep checking
+        if( systemFreeRAM > KLowMemoryThreshold ) // Between 4MB to 2MB
             {
-            iMemoryPool.RestoreCollectors( EOOM_PriorityMiddle );
             CheckMemoryDefered( KMemoryCheckIntervalSlow );
             iNextStop = EAllStop;
+            return;
             }
-        else if( freeMem.iHal >= KMinimumRAM/4 )
+         
+        // case 3: Below normal levels - stop low priority activites
+        if( systemFreeRAM > KStopThreshold )  // Between 2MB to 1MB
             {
             if( iNextStop & ENormalStop ) 
                 {
@@ -108,15 +115,15 @@
                 iNextStop &= ~ENormalStop;
                 }
             CheckMemoryDefered( KMemoryCheckIntervalFast );
-            }
-        else
+            }        
+        else // case 4: Really low - stop in emergency (all activites), below 1MB
             {
             if( iNextStop & EEmergencyStop ) 
                 {
                 StopLoading( EOOM_PriorityHigh );
                 iNextStop &= ~EEmergencyStop;
                 }
-            CheckMemoryDefered( KMemoryCheckIntervalFast );
+            CheckMemoryDefered( KMemoryCheckIntervalSlow ); // need to restore colectors later
             }
         }
     }
@@ -134,6 +141,7 @@
 //-----------------------------------------------------------------------------
 void CStopScheduler::StopLoading( TOOMPriority aPriority )
     {
+    MEM_LOG("CStopScheduler::StopLoading - run");
     // stop operations
     for( TInt i=0; i<iMemoryPool.Stoppers().Count(); ++i )
         {
@@ -141,6 +149,7 @@
         if( stopper->Priority() == aPriority )
             stopper->Stop();
         }
+    iMemoryPool.CollectMemory(2*KGoodMemoryThreshold);  // try to collect memory
     iMemoryPool.SetStopping( EFalse );
     }
 
--- a/webengine/osswebengine/MemoryManager/Src/SymbianDLAllocatorWrapper.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/SymbianDLAllocatorWrapper.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -32,7 +32,7 @@
 RSymbianDlAllocatorWrapper::~RSymbianDlAllocatorWrapper()
 {
 #ifdef OOM_LOGGING
-    iPool->DumpHeapLogs();
+    iPool->DumpHeapLogs(0);
 #endif
 }
 
--- a/webengine/osswebengine/MemoryManager/Src/fast_malloc.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/fast_malloc.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -3677,7 +3677,7 @@
         return chunk2mem(v);
       }
     }
-    CORRUPTION_ERROR_ACTION(m);
+//    CORRUPTION_ERROR_ACTION(m);
   }
   return 0;
 }
@@ -3716,9 +3716,8 @@
       return chunk2mem(v);
     }
   }
-
-  CORRUPTION_ERROR_ACTION(m);
-  return 0;
+  //CORRUPTION_ERROR_ACTION(m);
+  //return 0;
 }
 
 /* --------------------------- realloc support --------------------------- */
--- a/webengine/osswebengine/MemoryManager/Src/heap.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/heap.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -17,6 +17,8 @@
 */
 
 #include "common.h"
+#include "StopScheduler.h"
+#include <hal.h>
 
 #ifdef TRACE_CHUNK_USAGE
 void TraceChunkUsage(TInt aChunkHandle, TUint8* aBase, TInt aChunkSize)
@@ -263,20 +265,22 @@
 		}
 	iPageSize = 0;
 	iFlags = aSingleThread ? (ESingleThreaded|EFixedSize) : EFixedSize;
+	isLowSystemMemory = 0;
 
 	Init(0, 0, 0);
 	}
 
 UEXPORT_C RSymbianDLHeap::RSymbianDLHeap(TInt aChunkHandle, TInt aOffset, TInt aMinLength, TInt aMaxLength, TInt aGrowBy,
 			TInt aAlign, TBool aSingleThread)
-		: iMinLength(aMinLength), iMaxLength(aMaxLength), iOffset(aOffset), iChunkHandle(aChunkHandle), iNestingLevel(0), iAllocCount(0),
-			iAlign(aAlign),iFailType(ENone), iTestData(NULL), iChunkSize(aMinLength)
+		: iMinLength(aMinLength), iMaxLength(aMaxLength), iOffset(aOffset), iChunkHandle(aChunkHandle), 
+		  iAlign(aAlign), iNestingLevel(0), iAllocCount(0), iFailType(ENone), iTestData(NULL), iChunkSize(aMinLength)
 	{
 	// TODO: Locked the page size to 4 KB - change this to pick up from the OS
 	GET_PAGE_SIZE(iPageSize);
 	__ASSERT_ALWAYS(aOffset >=0, User::Panic(KDLHeapPanicCategory, ETHeapNewBadOffset));
 	iGrowBy = _ALIGN_UP(aGrowBy, iPageSize);
 	iFlags = aSingleThread ? ESingleThreaded : 0;
+	isLowSystemMemory = 0;
 
 	// Initialise
 	// if the heap is created with aMinLength==aMaxLength then it cannot allocate slab or page memory
@@ -657,7 +661,7 @@
         return chunk2mem(v);
       }
     }
-    CORRUPTION_ERROR_ACTION(m);
+    //CORRUPTION_ERROR_ACTION(m);
   }
   return 0;
 }
@@ -703,8 +707,8 @@
       return chunk2mem(v);
     }
   }
-  CORRUPTION_ERROR_ACTION(m);
-  return 0;
+  //CORRUPTION_ERROR_ACTION(m);
+  //return 0;
 }
 
 inline void RSymbianDLHeap::init_top(mstate m, mchunkptr p, size_t psize)
@@ -795,7 +799,7 @@
       return newmem;
     }
   }
-  return 0;
+  //return 0;
 }
 /* ----------------------------- statistics ------------------------------ */
 mallinfo RSymbianDLHeap::internal_mallinfo(mstate m) {
@@ -808,7 +812,7 @@
       size_t mfree = m->topsize + TOP_FOOT_SIZE;
       size_t sum = mfree;
       msegmentptr s = &m->seg;
-      TInt tmp = (TUint8*)m->top - (TUint8*)s->base;
+    //  TInt tmp = (TUint8*)m->top - (TUint8*)s->base;
       while (s != 0) {
         mchunkptr q = align_as_chunk(s->base);
         chunkCnt++;
@@ -840,13 +844,11 @@
 
 void  RSymbianDLHeap::internal_malloc_stats(mstate m) {
 if (!PREACTION(m)) {
-  size_t maxfp = 0;
   size_t fp = 0;
   size_t used = 0;
   check_malloc_state(m);
   if (is_initialized(m)) {
     msegmentptr s = &m->seg;
-    maxfp = m->max_footprint;
     fp = m->footprint;
     used = fp - (m->topsize + TOP_FOOT_SIZE);
 
@@ -1738,7 +1740,7 @@
     return mem;
   }
 
-  return 0;
+  //return 0;
 }
 
 void RSymbianDLHeap::dlfree(void* mem) {
@@ -1827,9 +1829,9 @@
 						else
 						{
                             size_t nsize = chunksize(next);
-                            int next_chunk_unmapped = 0;
+                            //int next_chunk_unmapped = 0;
                             if( page_not_in_memory(next, nsize) ) {
-                                next_chunk_unmapped = 1;
+                               // next_chunk_unmapped = 1;
                                 unmapped_pages += ((tchunkptr)next)->npages;
                             }
                             
@@ -2298,9 +2300,24 @@
 // otherwise commit the pages specified
 //
 {
-ASSERT(p == floor(p, pagesize));
-ASSERT(sz == ceiling(sz, pagesize));
-ASSERT(sz > 0);
+    // Check for min threshold in system RAM to be left free
+    TInt sysFreeRAM = 0;
+    if(HAL::Get(HALData::EMemoryRAMFree, sysFreeRAM) == KErrNone)
+		{
+		if(sysFreeRAM < KStopThreshold) // 1MB
+        	return 0;
+	
+	    // check system memory level
+    	if(sysFreeRAM < KGoodMemoryThreshold)
+        	isLowSystemMemory = 1; 
+	    else
+    	    isLowSystemMemory = 0;
+		}
+
+    
+    ASSERT(p == floor(p, pagesize));
+    ASSERT(sz == ceiling(sz, pagesize));
+    ASSERT(sz > 0);
 
 	if (iChunkSize + sz > iMaxLength)
 		return 0;
--- a/webengine/osswebengine/WebCore/html/HTMLTokenizer.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/html/HTMLTokenizer.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -1425,7 +1425,7 @@
     if (m_parserStopped)
         return false;
 #if PLATFORM(SYMBIAN)    
-    OOM_PRE_CHECK((src.length() + str.length()) * 16, 0, "HTMLTokenizer::write")
+    OOM_PRE_CHECK((src.length() + str.length()) * 4, 0, "HTMLTokenizer::write")
 #endif    
     SegmentedString source(str);
     if (m_executingScript)
--- a/webengine/osswebengine/WebCore/loader/Cache.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/loader/Cache.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-static const int cDefaultCacheCapacity = 8192 * 1024;
+static const int cDefaultCacheCapacity = 4*1024*1024; // 4MB
 
 static const double cMinDelayBeforeLiveDecodedPrune = 1; // Seconds.
 static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
--- a/webengine/osswebengine/WebCore/loader/DocumentLoader.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/loader/DocumentLoader.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -357,7 +357,7 @@
     if (FrameLoader* frameLoader = DocumentLoader::frameLoader())
 #if PLATFORM(SYMBIAN)
     {
-    unsigned int needMemory = length * 16;
+    unsigned int needMemory = length * 4;
     if(needMemory >= 1024*1024) {
         OOM_PRE_CHECK(needMemory, 0, "DocumentLoader::commitLoad");
 #endif    
--- a/webengine/osswebengine/WebCore/loader/FrameLoader.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/loader/FrameLoader.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -1518,23 +1518,16 @@
     RenderObject* renderer;
     IntRect rect;
     if (!anchorNode)
+        {
         renderer = m_frame->document()->renderer(); // top of document
+        rect = m_frame->document()->getRect();
+        }
     else {
         renderer = anchorNode->renderer();
         rect = anchorNode->getRect();
     }
     if (renderer)
-        {
-         if(!anchorNode)
-            {
-            renderer->enclosingLayer()->scrollRectToVisible(rect, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignToEdgeIfNeeded);
-            }
-         else
-             {
              renderer->enclosingLayer()->scrollRectToVisible(rect, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);                         
-             }
-       
-        }
 
     return true;
 }
--- a/webengine/osswebengine/WebCore/page/FrameView.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/page/FrameView.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -298,7 +298,7 @@
 void FrameView::layout(bool allowSubtree)
 {
 #if PLATFORM(SYMBIAN)
-    OOM_PRE_CHECK(1024*1024*2, 0, "FrameView::layout")
+    OOM_PRE_CHECK(1024*1024, 0, "FrameView::layout")
 #endif
     if (d->midLayout)
         return;
--- a/webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -41,6 +41,8 @@
 _LIT8( KOnlyIfCached, "only-if-cached" );
 _LIT8( KQHalfValue, ";q=0.5" );
 _LIT8( KQWholeValue, ";q=1.0" );
+_LIT8( KAccept, "Accept" );
+_LIT ( AcceptHeader, "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,image/png,*/*;q=0.5" );
 const TUint KDefBufSize = 512;
 const TInt KLangStrLen = 10;
 const TUint KCharsetUidDef = KCharacterSetIdentifierIso88591;
@@ -543,7 +545,51 @@
         strValueBuf->Des().Copy(strValuePtr);
         RStringF strValue = m_StringPool.OpenFStringL( strValueBuf->Des() );
         CleanupClosePushL(strValue );
+        
+        HBufC8* headerBuf = NULL;
 
+        // Check for Accept Header
+        if ((strNameBuf->Des().Compare(KAccept)) == 0)
+            {
+            THTTPHdrVal headerVal;
+            // Store the Accept Header value from aHeaders in headerVal
+            aHeaders.GetField(strName, 0, headerVal);
+            headerBuf = HBufC8::NewLC( headerVal.StrF().DesC().Length() );
+            // Copy accept header value from headerVal
+            headerBuf->Des().Copy(headerVal.StrF().DesC());
+            TPtrC httpAccept(AcceptHeader);
+            TInt httpAcceptLen(httpAccept.Length());
+            if (httpAcceptLen) 
+                {
+                // Find the Hardcoded accept header value in the header value received from aRequest
+                TInt httpAcceptPos = strValuePtr.Find(httpAccept);
+                TBool deleted(EFalse);
+                if(httpAcceptPos != KErrNotFound)
+                	{ 
+					// Delete the Accept header from the header Value of aRequest to avoid duplication
+					strValueBuf->Des().Delete( httpAcceptPos, httpAcceptLen);
+					deleted =ETrue;
+                    }
+                //Incase the aRequest header value is different from the hardcoded accept header value
+                //Compare the aRequest accept header value with accept header value of headerVal
+                //
+                if((deleted && strValueBuf->Length()) || (strValueBuf->Length() && strValueBuf->Compare(headerVal.StrF().DesC()) != 0))
+                	{
+						CleanupStack::Pop(headerBuf);
+						//Reallocate the buffer size based on strValueBuf value
+						//and append content of strValueBuf to headerBuf
+						headerBuf = headerBuf->ReAllocL( headerVal.StrF().DesC().Length() + strValueBuf->Length() + 1);
+						CleanupStack::PushL(headerBuf);
+						headerBuf->Des().Append(KCommaSeperator);
+						headerBuf->Des().Append(strValueBuf->Des());
+                	
+                    }
+                // Store the full accept header value to strValue
+                strValue = m_StringPool.OpenFStringL( headerBuf->Des() );
+                }
+            }
+
+        // Remove the Accept header value from aHeaders to avoid duplication
         aHeaders.RemoveField(strName);
 
         if (strName == m_StringPool.StringF(HTTP::EIfModifiedSince, RHTTPSession::GetTable()) ||
@@ -557,9 +603,17 @@
             }
         else
             {
-            aHeaders.SetFieldL(strName, strValue);    
+            aHeaders.SetFieldL(strName, strValue);
+            }
+        if ( headerBuf )
+            {
+            CleanupStack::PopAndDestroy(headerBuf);
             }
-        CleanupStack::PopAndDestroy(4);
+
+        CleanupStack::PopAndDestroy(&strValue);
+        CleanupStack::PopAndDestroy(strValueBuf);
+        CleanupStack::PopAndDestroy(&strName);
+        CleanupStack::PopAndDestroy(strNameBuf);
         }
 }
 //  End of File
--- a/webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -42,7 +42,8 @@
 {
     const CFont& font( m_font );
     TLanguage language = User::Language();
-    if (language == ELangPrcChinese ) {
+    if (language == ELangTaiwanChinese || language == ELangHongKongChinese || language == ELangPrcChinese || 
+        language == ELangEnglish_Taiwan || language == ELangEnglish_HongKong || language == ELangEnglish_Prc) {
         m_ascent = font.AscentInPixels();
         m_descent = font.DescentInPixels();
     } else {
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -548,7 +548,8 @@
     if( frameInfo.iFlags & TFrameInfo::ETransparencyPossible ) {
         if( frameInfo.iFlags & TFrameInfo::EAlphaChannel && (frameInfo.iFlags & TFrameInfo::ECanDither)) 
             maskDisplayMode = EGray256;
-        maskDisplayMode = EGray2;
+        else
+           maskDisplayMode = EGray2;
 
         User::LeaveIfError(animMask.Create(frameInfo.iOverallSizeInPixels, maskDisplayMode));
         iDecoder->Convert( &iStatus, animBitmap, animMask, aFrameIndex );
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Thu Jul 15 19:53:20 2010 +0300
@@ -77,10 +77,12 @@
 _LIT(KMimeICO, "image/x-icon");
 _LIT(KMimeDRM, "application/vnd.oma.drm.content");
 
-//const TDisplayMode KMaxDepth = EColor64K;
-
 // FIXME: we should move this back to EColor64K after Symbian fix their Gif image decoder bug.
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+const TDisplayMode KMaxDepth = EColor64K;
+#else
 const TDisplayMode KMaxDepth = EColor16M;
+#endif
 // CLASS DECLARATION
 /**
 *  CAnimationDecoderWrapped
--- a/webengine/osswebengine/WebCore/rendering/RenderBR.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/rendering/RenderBR.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -45,7 +45,9 @@
     // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode
     // (Note the use of strict mode.  In "almost strict" mode, we don't treat the box for <br> as text.)
     InlineTextBox* box = static_cast<InlineTextBox*>(RenderText::createInlineBox(makePlaceholder, isRootLineBox, isOnlyRun));
-    box->setIsText(isOnlyRun || document()->inStrictMode());
+    if ( box ) {	
+        box->setIsText(isOnlyRun || document()->inStrictMode());
+    }    
     return box;
 }
 
--- a/webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -332,13 +332,13 @@
         
         case NPNVPluginElementNPObject: {
 		PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
-        WebCore::Element* pluginElement;
+        WebCore::Element* pluginElement = NULL;
         if (pluginWin) {
         	pluginElement = pluginWin->pluginSkin()->getElement();
         }
             
         NPObject* pluginScriptObject = 0;
-        if (pluginElement->hasTagName(appletTag) || pluginElement->hasTagName(embedTag) || pluginElement->hasTagName(objectTag))
+        if (pluginElement && (pluginElement->hasTagName(appletTag) || pluginElement->hasTagName(embedTag) || pluginElement->hasTagName(objectTag)))
 			pluginScriptObject = static_cast<WebCore::HTMLPlugInElement*>(pluginElement)->getNPObject();
             
         if (pluginScriptObject)
@@ -369,13 +369,14 @@
         case NPNVisOfflineBool:     // Tells whether offline mode is enabled;
                                     // true=offline mode enabled, false=not enabled
             
-        case NPNNetworkAccess:
+        case NPNNetworkAccess: {
             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
             TInt apId = -1;
             if (pluginWin) {
                 apId = pluginWin->pluginSkin()->handleNetworkAccess();
             }
             *((TInt*) aRetValue) = apId;
+        }
             break;
             
        case NPNVGenericParameter: {   
@@ -478,6 +479,7 @@
             break;
             }
         case NPPVPluginBitmap :
+            {
             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
             if (pluginWin) {
                 TInt* bitMapHandle = (TInt*)aSetValue;
@@ -489,6 +491,7 @@
                     { 
                     pluginWin->SetBitmapFromPlugin(KErrNone);
                     }
+               }
             }
             break; 
         case NPPVPluginDeactivate:
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -157,7 +157,7 @@
 {
     TUint   i;
     TUint   count;
-    HBufC*  entry;
+    HBufC*  entry = NULL;
     
     m_mimeTypes.ResetAndDestroy();
     m_mimeExtensionToTypeMap.Reset();
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -162,14 +162,14 @@
       m_canInteract( EFalse ),
       m_rect(TRect(0,0,0,0)),
       m_ref(1),
+      m_oldRect(TRect(0,0,0,0)),
+      m_oldViewport(TRect(0,0,0,0)),
+      m_loadmode(ELoadModeNone),
+      m_NPObject(0),
       m_handle(-1),
       m_instance(0),    
       m_pluginfuncs(0),
-      m_resized(false),
-      m_oldRect(TRect(0,0,0,0)),
-      m_oldViewport(TRect(0,0,0,0)),
-      m_loadmode(ELoadModeNone),
-      m_NPObject(0)
+      m_resized(false)
   {
   }
 
@@ -409,7 +409,12 @@
     delete m_attributeNames; m_attributeNames = 0;
     delete m_attributeValues; m_attributeValues = 0;
     delete m_url; m_url = 0;
-    delete iJavascriptTimer; iJavascriptTimer = 0;
+    if(iJavascriptTimer)
+        { 
+        iJavascriptTimer->Cancel();
+        delete iJavascriptTimer; 
+        iJavascriptTimer = 0;
+        }
     m_pluginfuncs = 0;
     m_pluginSupported = EFalse;
     m_pluginClosed = true;
@@ -475,7 +480,9 @@
 
     CFbsBitmap* bitmap = m_cannedimg.m_img;
     TSize bmpSize( bitmap->SizeInPixels() );
-    if ( !m_pluginwin && newRect.Height() >= bmpSize.iHeight && newRect.Width() >= bmpSize.iWidth )
+    CWidgetExtension* wdgtExt = control(this->frame()) ? control(this->frame())->getWidgetExt(): NULL;
+    
+    if ( !wdgtExt && !m_pluginwin && newRect.Height() >= bmpSize.iHeight && newRect.Width() >= bmpSize.iWidth )
         {
         // The inner rect is big enough, draw the placeholder image
         TPoint bitmapStartPoint( newRect.Center() );
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Thu Jul 15 19:53:20 2010 +0300
@@ -439,6 +439,8 @@
         void setPluginWinClipedRect();
         TBool IsCollectBitmapSupported();
         WebFrame* getWebFrame() const {return m_frame;}
+        void activateVisiblePlugins();
+
   private:  // private member data
         
         TRect frameVisibleRect() const;
@@ -447,7 +449,6 @@
         const TDesC& GetExecutionMode();
         void setupGenericElementArrrayL();
         void addWidgetAttributesL();
-        void activateVisiblePlugins();
         // Window-owning CoeControl which wraps the CoeControl created by the plugin
         PluginWin* m_pluginwin;
         WebFrame* m_frame; // not owned
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -498,6 +498,11 @@
 void PluginWin::HandleGainingForeground()
 {
     if (m_notifier) {
+        if(m_pluginHasBitmap)
+            { 
+            ClearPluginBitmap(); 
+            m_pluginskin->activateVisiblePlugins(); 
+            }
         TRAP_IGNORE(m_notifier->NotifyL(MPluginNotifier::EApplicationFocusChanged, (void*)1));
     }
 }
@@ -611,6 +616,7 @@
 		    TPoint newPos ((aOffset.iX  * 100)/zoomlevel, (aOffset.iY  * 100)/zoomlevel);
 	        c->offsetCursor( aOffset );
             mf->frameView()->scrollTo(oldPos + newPos);
+            view->scrollStatus(false); 
             c->cursorUpdate(EFalse);        
         }
 
--- a/webengine/osswebengine/WebKit/s60/webcoresupport/WebFrameLoaderClient.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webcoresupport/WebFrameLoaderClient.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -147,7 +147,9 @@
                 brctl(m_webFrame)->setWmlDispatcher(m_WmlContentListener);
                 }
         }
-        TRAPD(err,m_WmlContentListener->HeadersL( 0, m_response ));
+        if ( m_WmlContentListener ) {
+          TRAPD(err,m_WmlContentListener->HeadersL( 0, m_response ));
+        }
     }
     else{
         if (m_WmlContentListener) {
--- a/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -808,7 +808,7 @@
 
                 //Disable the zooming bar when it goes to background
                 m_webView->hideZoomSliderL();
-                
+                m_webView->scrollStatus(false); 
                 // Instruct JS to garbage collect
                 WebCore::gcController().garbageCollectSoon();                
                 break;
@@ -1033,7 +1033,20 @@
            {
            StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->cancelQueuedTransactions();
 		   break;
-           }		   
+           }
+
+	   // Messages sent by OOM monitor
+       case TBrCtlDefs::ECommandFreeMemory:
+           {
+           //MemoryManager::FreeRam(); // invoke memory collect operation - enable later, causes BC break
+           break;
+           }
+       case TBrCtlDefs::ECommandMemoryGood:
+           {
+           //MemoryManager::RestoreCollectors(); // restore collectors - enable later, causes BC break
+           break;
+           }
+                  
       default:
             {
             if ( m_wmlEngineInterface &&
@@ -1241,7 +1254,7 @@
     }
 
     int after = aAfter == -1 ? aAfter :0;
-    TBrCtlDefs::TBrCtlElementType focusedElementType;
+    TBrCtlDefs::TBrCtlElementType focusedElementType = TBrCtlDefs::EElementNone;
     if(m_webView)
        focusedElementType = FocusedElementType();
 
@@ -2551,6 +2564,13 @@
     }
 }
 
+CWidgetExtension* CBrCtl::getWidgetExt()
+{
+    if ( m_webView) {
+        return m_webView->widgetExtension();
+    }
+    return NULL;
+}
 
 int CBrCtl::getMainScrollbarWidth() const
 {
--- a/webengine/osswebengine/WebKit/s60/webview/BrCtl.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/BrCtl.h	Thu Jul 15 19:53:20 2010 +0300
@@ -57,6 +57,7 @@
 class CWmlDispatcher;
 class CWmlContentInterface;
 class CUserAgent;
+class CWidgetExtension;
 
 namespace WebCore {
     class FormData;
@@ -160,6 +161,7 @@
         TBrCtlWmlServiceOption* firstPrevDoElement() const { return m_firstPrevDoElement; }
         HBufC* fileNameToUrlLC(const TDesC& aFileName);
         void SetScriptLogMode(TInt aMode);
+        CWidgetExtension* getWidgetExt();
         
     public: // Methods from CBrCtlInterface
 
--- a/webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -420,8 +420,11 @@
         //maybe the content got smaller and we need to scroll back to view?
         TPoint p( nearestPointInFrame(m_contentPos) );
         if (p!=m_contentPos)
+        	{ 
             // this will also update scrollbars is necessary
             scrollTo(p);
+            m_topView->scrollStatus(false); 
+        	} 
         else if (!m_parent) {
             // top level
             m_topView->updateScrollbars(m_contentSize.iHeight, m_contentPos.iY, m_contentSize.iWidth, m_contentPos.iX);
--- a/webengine/osswebengine/WebKit/s60/webview/WebScrollbarDrawer.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebScrollbarDrawer.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -60,10 +60,10 @@
 
 
 WebScrollbarDrawer::WebScrollbarDrawer(): 
-                                        m_webView(NULL),
+                                        m_webView(NULL), m_spriteV(NULL),  m_spriteH(NULL),
                                         m_scrollBarTransparency(KMinScrollBarTransparency),
                                         m_scrollBarWidth(KMinScrollbarWidth),
-                                        m_dX(0), m_dY(0), m_spriteV(NULL), m_spriteH(NULL)
+                                        m_dY(0), m_dX(0)
 {
 }
 
--- a/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -42,7 +42,11 @@
 const int KScrollIntervalTimeout = 60000; // scroll timer interval in microseconds
 #endif
 
+#ifdef BRDO_MULTITOUCH_ENABLED_FF
+const float KDecceleration = -1300.0;
+#else 
 const float KDecceleration = -750.0;
+#endif 
 const float KSpeedHigh = 2000.0;
 
 int decelTimerCB(TAny* ptr);
--- a/webengine/osswebengine/WebKit/s60/webview/WebSprite.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebSprite.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -101,8 +101,8 @@
 // ======================================================================
 CWebSprite::CWebSprite(CCoeControl* aParent, CFbsBitmap* aBitmap, 
                        CFbsBitmap* aMask, TBool aInvertMask) : 
-                       iParent(aParent), iBitmap(aBitmap), iMask(aMask), 
-		       iInvertMask(aInvertMask), iWin(NULL)
+                       iBitmap(aBitmap), iMask(aMask), 
+		                   iInvertMask(aInvertMask), iWin(NULL), iParent(aParent)
     {    
     }
 
--- a/webengine/osswebengine/WebKit/s60/webview/WebSurface.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebSurface.h	Thu Jul 15 19:53:20 2010 +0300
@@ -21,6 +21,7 @@
 #ifndef __WEBKITSURFACE_H__
 #define __WEBKITSURFACE_H__
 
+#include <browser_platform_variant.hrh>
 #include <e32base.h>
 #include <gdi.h>
 
@@ -30,10 +31,16 @@
 class CBitmapContext;
 class WebView;
 
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+const TDisplayMode KDisplayMode = EColor64K;
+#else
+const TDisplayMode KDisplayMode = EColor16MU;
+#endif
+
 class WebSurface : public CBase
 {
 public:
-    static WebSurface* NewL( TDisplayMode mode = EColor16MU );
+    static WebSurface* NewL( TDisplayMode mode = KDisplayMode );
 	
 	~WebSurface();
 	
--- a/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -397,8 +397,10 @@
 
     MakeViewVisible(ETrue);
     CCoeControl::SetFocus(ETrue);
-    
+
+#ifndef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
     cache()->setCapacities(0, 0, defaultCacheCapacity);
+#endif    
     
     m_waiter = new(ELeave) CActiveSchedulerWait();
     
@@ -1199,9 +1201,34 @@
         consumed = downEventConsumed || handleTabbedNavigation(m_currentEventKey, m_currentEventCode);
     }
     else {  
-        consumed = (!m_isEditable &&  //avoid showing the cursor when we are in the input box 
-                    handleKeyNavigation(keyevent, eventcode, frame)) ||
-                    downEventConsumed;
+          //Check is editable node and couples of NULL checking  
+         if( m_isEditable && frame && frame->document() && frame->document()->focusedNode() ) {
+             //Is inputTag
+             TBool isInputTag = frame->document()->focusedNode()->hasTagName(inputTag); 
+             HTMLInputElement* ie = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
+             TInt length  = 0;
+             //Null checking etc.
+             if( ie && isInputTag ) {
+                 //Get length of inputelement string
+                 length = ie->value().length();
+             }
+             //Check is there data in input field
+             if( length > 0 || !ie ) {
+                 //If there is data, do the old thing 
+                 consumed = ( !m_isEditable &&  //avoid showing the cursor when we are in the input box 
+                         handleKeyNavigation(keyevent, eventcode, frame)) ||
+                         downEventConsumed;
+             } 
+             else {
+                   //else continue navigation and avoid jamming in some inputboxes
+                   consumed = handleKeyNavigation( keyevent, eventcode, frame );    
+             }
+         } 
+         else {
+               consumed = ( !m_isEditable &&  //avoid showing the cursor when we are in the input box 
+                       handleKeyNavigation(keyevent, eventcode, frame)) ||
+                       downEventConsumed;    
+         }
     }
     return consumed;
 }
--- a/webengine/osswebengine/cache/inc/HttpCacheUtil.h	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/cache/inc/HttpCacheUtil.h	Thu Jul 15 19:53:20 2010 +0300
@@ -360,6 +360,24 @@
         */
         static TInt ExtractCacheControlDirectiveValue( RStringPool aStrP, RStringF& aDirective,  TDesC8& aValue, TInt64* aDirectiveValue,
             char** aExtraValue );
+        
+        /**
+        *
+        * @since 3.1
+        * @param
+        * @return
+        */
+        static TInt ExtractCacheControlDirectivePairValue(const RHTTPHeaders& aHeaders,RStringPool aStrP,RStringF& aDirective,
+                TInt64* aDirectiveValue,TInt aIndex);
+        
+        /**
+        *
+        * @since 3.1
+        * @param
+        * @return
+        */
+        static TInt ExtractCacheControlDirectiveValueforParam(const RHTTPHeaders& aHeaders,RStringPool aStrP,TInt64* aDirectiveValue,
+                RStringF& aFieldParam,RStringF& aDirective,TInt aIndex);
     };
 
 NONSHARABLE_CLASS( TFileInfo )
--- a/webengine/osswebengine/cache/src/HttpCacheEntry.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/cache/src/HttpCacheEntry.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -166,7 +166,7 @@
     delete iFileName;
     iFileName = NULL;
 
-    iFileName = aFileName.AllocL();
+    iFileName = aFileName.AllocL(); 
     }
 
 
--- a/webengine/osswebengine/cache/src/HttpCacheUtil.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/osswebengine/cache/src/HttpCacheUtil.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -27,6 +27,7 @@
 #include "TInternetdate.h"
 #include "httpfiltercommonstringsext.h"
 #include "HttpCacheEntry.h"
+#include <browser_platform_variant.hrh>
 
 // EXTERNAL DATA STRUCTURES
 
@@ -1640,6 +1641,11 @@
     // init the field name
     fieldName = aStrP.StringF( HTTP::ECacheControl, RHTTPSession::GetTable() );
     TRAP( status, cacheCount = aHeaders.FieldPartsL( fieldName ) );
+    
+#ifdef __CACHELOG__
+            HttpCacheUtil::WriteLog(0,_L("cacheCount ="),cacheCount);
+#endif
+            
     if( status == KErrNone )
         {
         for( i = 0; i < cacheCount; i++ )
@@ -1722,12 +1728,38 @@
 
     // Get the cache-control from the headers
     fieldName = aStrP.StringF( HTTP::ECacheControl, RHTTPSession::GetTable() );
+
     aHeaders.GetField( fieldName, aIndex, hdrVal );
-
+    
+#ifdef __CACHELOG__
+    HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing fieldName"));
+    HttpCacheUtil::WriteUrlToLog( 0, fieldName.DesC().Left(fieldName.DesC().Length()) );
+#endif
+    
     if( hdrVal.Type() == THTTPHdrVal::KStrVal || hdrVal.Type() == THTTPHdrVal::KStrFVal )
         {
         RStringF cacheDir = hdrVal.StrF();
-
+        
+#ifdef __CACHELOG__
+        HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing hdrVal.StrF()"));
+        HttpCacheUtil::WriteUrlToLog( 0, hdrVal.StrF().DesC().Left(hdrVal.StrF().DesC().Length()) );
+        
+        HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing cacheDir"));
+        HttpCacheUtil::WriteUrlToLog( 0, cacheDir.DesC().Left(cacheDir.DesC().Length()) );
+#endif
+        
+#ifdef BRDO_CACHE_MAX_AGE
+        
+        //If the cache-control is key value pair
+        if(cacheDir.DesC().Length() == NULL)
+            {
+        
+            err = ExtractCacheControlDirectivePairValue(aHeaders,aStrP,aDirective,aDirectiveValue,aIndex);
+#ifdef __CACHELOG__
+            HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing aDirective"));
+            HttpCacheUtil::WriteUrlToLog(0, aDirective.DesC().Left(aDirective.DesC().Length()) );
+#endif
+#else
         TInt endPos;
         _LIT8(KFind, "=");
 
@@ -1741,16 +1773,29 @@
                 }
             TPtrC8 value = cacheDir.DesC().Right( cacheDir.DesC().Length() - endPos - 1 );
             err = ExtractCacheControlDirectiveValue( aStrP, aDirective, value, aDirectiveValue, aExtraValue );
+
+#ifdef __CACHELOG__
+            HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing aDirective"));
+            HttpCacheUtil::WriteUrlToLog(0, aDirective.DesC().Left(aDirective.DesC().Length()) );
+#endif
+            
             if( err != KErrNone )
                 {
                 aDirective.Close();
                 return err;
                 }
+#endif 
             }
+        //If the cache-control is a normal value
         else
             {
             aDirective = cacheDir.Copy();
-            // Directives which MUST have values
+            
+#ifdef __CACHELOG__
+            HttpCacheUtil::WriteLog(0,_L("In GetCacheControlDirective Printing aDirective"));
+            HttpCacheUtil::WriteUrlToLog(0, aDirective.DesC().Left(aDirective.DesC().Length()) );
+#endif
+            
             if( ( aDirective == aStrP.StringF( HTTP::EMaxAge, RHTTPSession::GetTable() ) ) ||
                 ( aDirective == aStrP.StringF( HTTP::EMinFresh, RHTTPSession::GetTable() ) ) ||
                 ( aDirective == aStrP.StringF( HTTP::ESMaxAge, RHTTPSession::GetTable() ) ) )
@@ -1758,16 +1803,142 @@
                 aDirective.Close();
                 return KErrGeneral;
                 }
+#ifdef BRDO_CACHE_MAX_AGE
+            err = KErrNone;
+            }
+        }
+    return err;
+#else
             }
         }
     return KErrNone;
+#endif
     }
 
+#ifdef BRDO_CACHE_MAX_AGE
+// -----------------------------------------------------------------------------
+// HttpCacheUtil::ExtractCacheControlDirectivePairValue
+//
+// -----------------------------------------------------------------------------
+//
+
+TInt HttpCacheUtil::ExtractCacheControlDirectivePairValue(
+    const RHTTPHeaders& aHeaders,
+    RStringPool aStrP,
+    RStringF& aDirective,
+    TInt64* aDirectiveValue,
+    TInt aIndex)
+    {
+    RStringF fieldName;
+    THTTPHdrVal hdrVal;
+
+    // Get the cache-control from the headers
+    fieldName = aStrP.StringF( HTTP::ECacheControl, RHTTPSession::GetTable() );
+    
+#ifdef __CACHELOG__
+    HttpCacheUtil::WriteLog(0,_L("In ExtractCacheControlDirectivePairValue Printing fieldName"));
+    HttpCacheUtil::WriteUrlToLog(0, fieldName.DesC().Left(fieldName.DesC().Length()) );
+#endif
+    
+    //Get the param name
+    RStringF paramName = aStrP.StringF( HTTP::EMaxAge, RHTTPSession::GetTable() );
+    
+    if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+        {
+        paramName.Close();
+        paramName = aStrP.StringF( HTTP::EMaxStale, RHTTPSession::GetTable() );
+        if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+            {
+            paramName.Close();
+            paramName = aStrP.StringF( HTTP::EMinFresh, RHTTPSession::GetTable() );
+            if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+                {
+                paramName.Close();
+                paramName = aStrP.StringF( HTTP::EMustRevalidate, RHTTPSession::GetTable() );
+                if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+                    {
+                    paramName.Close();
+                    paramName = aStrP.StringF( HTTP::ENoCache, RHTTPSession::GetTable() );
+                    if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+                        {
+                        paramName.Close();
+                        paramName = aStrP.StringF( HTTP::ENoStore, RHTTPSession::GetTable() );
+                        if(KErrNone != ExtractCacheControlDirectiveValueforParam(aHeaders,aStrP,aDirectiveValue,paramName,aDirective,aIndex))
+                            {
+                            return KErrGeneral;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+  
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// HttpCacheUtil::ExtractCacheControlDirectiveValueforParam
+//
+// -----------------------------------------------------------------------------
+//
+TInt HttpCacheUtil::ExtractCacheControlDirectiveValueforParam(
+    const RHTTPHeaders& aHeaders,
+    RStringPool aStrP,
+    TInt64* aDirectiveValue,
+    RStringF& aFieldParam,
+    RStringF& aDirective,
+    TInt aIndex)
+    {
+    
+    RStringF fieldName;
+    THTTPHdrVal hdrVal;
+    
+    // Get the cache-control from the headers
+    fieldName = aStrP.StringF( HTTP::ECacheControl, RHTTPSession::GetTable() );
+    
+    aHeaders.GetParam(fieldName,aFieldParam,hdrVal,aIndex);
+#ifdef __CACHELOG__
+    HttpCacheUtil::WriteLog(0,_L("In ExtractCacheControlDirectiveValueforParam Printing fieldName"));
+    HttpCacheUtil::WriteUrlToLog( 0, fieldName.DesC().Left(fieldName.DesC().Length()) );
+    HttpCacheUtil::WriteLog(0,_L("In ExtractCacheControlDirectiveValueforParam Printing aFieldParam"));
+    HttpCacheUtil::WriteUrlToLog( 0, aFieldParam.DesC().Left(aFieldParam.DesC().Length()) );
+#endif
+    
+    //If the field param does not exist
+    if(hdrVal.Type() == THTTPHdrVal::KNoType)
+        {
+        return KErrGeneral;
+        }
+    else if( hdrVal.Type() == THTTPHdrVal::KTIntVal )
+        {
+        if( !(( aFieldParam == aStrP.StringF( HTTP::EMaxAge, RHTTPSession::GetTable() ) ) ||
+            ( aFieldParam == aStrP.StringF( HTTP::EMinFresh, RHTTPSession::GetTable() ) ) ||
+            ( aFieldParam == aStrP.StringF( HTTP::ESMaxAge, RHTTPSession::GetTable() ) ) ) )
+            {
+                return KErrGeneral;
+            }
+        TInt value = hdrVal.Int();
+        *aDirectiveValue = (TInt64)value;
+        }
+    else
+        {
+        if( !(( aFieldParam == aStrP.StringF( HTTP::ENoCache, RHTTPSession::GetTable() ) ) ||
+              ( aFieldParam == aStrP.StringF( HTTP::EPrivate, RHTTPSession::GetTable() ) ) ||
+              ( aFieldParam == aStrP.StringF( HTTP::EMustRevalidate, RHTTPSession::GetTable() ) )) )
+            {
+                return KErrGeneral;
+            }
+        }
+        aDirective = aFieldParam.Copy();
+        return KErrNone;
+    }
+
+#else
 // -----------------------------------------------------------------------------
 // HttpCacheUtil::ExtractCacheControlDirectiveValue
 //
 // -----------------------------------------------------------------------------
 //
+
 TInt HttpCacheUtil::ExtractCacheControlDirectiveValue(
     RStringPool aStrP,
     RStringF& aDirective,
@@ -1779,6 +1950,10 @@
     TInt temp;
     char* errorIfNull;
 
+#ifdef __CACHELOG__
+    HttpCacheUtil::WriteLog(0,_L("In ExtractCacheControlDirectiveValue "));
+#endif
+    
     *aDirectiveValue = -1;
     *aExtraValue = NULL;
     char* valuestr = (char*)User::Alloc( aValue.Length() + 1 );
@@ -1829,8 +2004,7 @@
     User::Free( valuestr );
     return status;
     }
-
-
+#endif
 // -----------------------------------------------------------------------------
 // FilePathHash
 // Hash function for Symbian file paths: discards case first
--- a/webengine/webkitutils/stmgesturefw/src/stateengine.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/webkitutils/stmgesturefw/src/stateengine.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -449,6 +449,7 @@
 /*!
  * stateNames are used in the logging
  */
+#ifdef GESTURE_LOGGING
 const char* const stateNames[8] =
 {
         "Ignore",
@@ -471,6 +472,7 @@
         "EHoldTimer",
         "ESuppressTimer"
 } ;
+#endif
 
 /*! CStateEngine contains the methods used in the state machine implementation.
  *
--- a/webengine/webkitutils/stmgesturefw/src/statemachine.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/webkitutils/stmgesturefw/src/statemachine.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -32,6 +32,7 @@
 
 GLREF_D const char* stateNames[8] ;
 
+#ifdef GESTURE_LOGGING
 const char* const ttypeNames[] = {  // for debugging purposes define the names of the pointer events
             "EButton1Down         ",
             "EButton1Up           ",
@@ -49,6 +50,7 @@
             "EEnterHighPressure   ",
             "EExitHighPressure    "
             };
+#endif
 
 /// Fast integer distance
 int stmUiEventEngine::Distance(int x, int y)
@@ -745,7 +747,9 @@
             }
             else if (Rng(edge, wY, sz.iHeight - edge))
             {
+#ifdef GESTURE_LOGGING
                 int from = newPos.iY ;
+#endif
                 newPos.iY -= m_3mminpixels ;
                 if (m_loggingenabled)
                 {
--- a/webengine/widgetinstaller/Src/WidgetInstaller.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/widgetinstaller/Src/WidgetInstaller.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -472,14 +472,16 @@
                     break;
                     
                     case EWidgetPropTypeInt:
-                    TLex toInt( value->Des() );
-                    TInt k;
-                    if ( KErrNone != toInt.Val( k ) )
-                       {
-                       User::Leave( KErrCorrupt );
-                       }
-                    if ( propId ==  EBlanketPermGranted )
-                        backupBlanketPerm = k;        
+                        {
+                        TLex toInt( value->Des() );
+                        TInt k;
+                        if ( KErrNone != toInt.Val( k ) )
+                            {
+                            User::Leave( KErrCorrupt );
+                            }
+                        if ( propId ==  EBlanketPermGranted )
+                            backupBlanketPerm = k;
+                        }
                     break;                    
 					          
 					          case EWidgetPropTypeString:
--- a/webengine/widgetregistry/Server/src/WidgetEntry.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/widgetregistry/Server/src/WidgetEntry.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -125,9 +125,9 @@
 //
 CWidgetEntry::CWidgetEntry()
     : iPropertyValues( EWidgetPropertyIdCount ),
-      iBlanketPermGranted ( EFalse),
+      iMiniView ( EFalse),
       iFullView ( EFalse),
-      iMiniView ( EFalse)
+      iBlanketPermGranted ( EFalse)
     {
     }
 
@@ -436,7 +436,6 @@
                                     CWidgetRegistryXml* aXmlProcessor,
                                     RFs& aFileSession )
     {
-    xmlDocPtr doc = NULL; // not really used
     TInt i = 0;
     // For each property, write an XML entry
     for ( ; i < EWidgetPropertyIdCount; ++i )
@@ -692,7 +691,8 @@
             break;
         case KWidgetPropertyListVersion71:
             // Go from PropertlyListVersion71 to PropertyListVersion71CWRT
-            // 1) add ProcessUid for WRT (wgz) widgets
+           // 1) add ProcessUid for WRT (wgz) widgets
+            {
             (*this)[EProcessUid] = KUidWidgetUi.iUid;
 
              // 2) add MIMEType
@@ -703,6 +703,7 @@
             CleanupStack::PopAndDestroy();
 
             currentVersion = KWidgetPropertyListVersion71CWRT;
+            }
             break;
         default:
             // Trouble
--- a/webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -436,9 +436,8 @@
             // make sure that the image has been created when the first 
             // chunk came in
             NW_THROW_ON_NULL(thisObj->image, status, KBrsrUnexpectedError);
-            
-            NW_ASSERT(NW_Object_IsInstanceOf(thisObj->image,
-                                             &NW_Image_Epoc32Simple_Class));    
+            if ( NW_Object_IsInstanceOf(thisObj->image, &NW_Image_Epoc32Simple_Class))
+            {	
             simpleImage = NW_Image_Epoc32SimpleOf(thisObj->image);
              //Checking is simpleimage valid for decoding
                 
@@ -450,7 +449,7 @@
                 status = NW_Image_Epoc32Simple_PartialNextChunk(NW_Image_AbstractImageOf(simpleImage),
                                                             response->body);
                 }
-				
+            }  				
             // NW_Image_Epoc32Simple_PartialNextChunk takes body ownership
             response->body = NULL;
             
--- a/webengine/wmlengine/src/image/src/Epoc32ImageDecoder.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/wmlengine/src/image/src/Epoc32ImageDecoder.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -1092,17 +1092,16 @@
       {
        iFrameInfo = iImageConverter->FrameInfo( iCurrentFrame );
        if(iImage->bitmap == NULL ){
-         TInt error;
          NW_Bool actualSizing;
          TFrameInfo aFrameInfo = iImageConverter->FrameInfo(0);
          actualSizing = ImageSizeCheck(aFrameInfo.iOverallSizeInPixels, &currSize);
            
          CFbsBitmap* pDestBitmap = new (ELeave) CFbsBitmap();
          if(actualSizing == NW_TRUE) { 
-            error = pDestBitmap->Create( currSize, GetDisplayMode(aFrameInfo) );
+            pDestBitmap->Create( currSize, GetDisplayMode(aFrameInfo) );
          }
          else{
-             error = pDestBitmap->Create( aFrameInfo.iOverallSizeInPixels, GetDisplayMode(aFrameInfo) );
+            pDestBitmap->Create( aFrameInfo.iOverallSizeInPixels, GetDisplayMode(aFrameInfo) );
           }
          iImage->bitmap = pDestBitmap;
          if(iImage->mask == NULL && aFrameInfo.iFlags & TFrameInfo::ETransparencyPossible ){
--- a/webengine/wrtharvester/group/wrtharvester.mmp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/wrtharvester/group/wrtharvester.mmp	Thu Jul 15 19:53:20 2010 +0300
@@ -70,5 +70,6 @@
 LIBRARY		  CommonEngine.lib
 LIBRARY       ws32.lib
 LIBRARY       PlatformEnv.lib
+LIBRARY       oommonitor.lib
 
 //end of file
--- a/webengine/wrtharvester/src/wrtharvester.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/webengine/wrtharvester/src/wrtharvester.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -45,6 +45,12 @@
 #include <aknglobalconfirmationquery.h>
 #include <StringLoader.h>
 #include <data_caging_path_literals.hrh>
+#include <oommonitorsession.h>
+
+#ifndef BRDO_OOM_MONITOR2_COMPONENT_FF 
+#include <systemwarninglevels.hrh>
+#endif
+#include "browser_platform_variant.hrh"
 
 // CONSTANTS
 _LIT( KResourceFileName, "\\resource\\wrtharvester.rsc" );
@@ -54,6 +60,38 @@
 _LIT( KOpenPar, "(");
 _LIT( KClosePar, ")");
 _LIT8( KWidgetIcon, "widget_icon");
+#define KUidWidgetOOMPlugin 0x10282855
+const TInt KMemoryToLaunchWidgetUi = 17*1024*1024;
+
+
+
+/** 
+* Launch or bring foreground the asked widget.
+*
+* Launch widget.
+* @param aUid UID of the widget.
+* @param aOperation Operation to perform.
+*/
+static void LaunchWidgetL( const TUid& aUid, TUint32 aOperation );
+
+/** 
+* In case the widget cannot be launched because of OOM
+* Notify harvester and Clear event Queue
+* @return void
+*/
+static void NotifyCommandAndCleanUp();
+
+/** 
+* Launch new widget.
+*
+* Launch new widget.
+* @param aUid UID of the widget.
+* @param aOperation Operation to perform.
+*/
+static void LaunchWidgetUIL( 
+    const TUid& aUid, 
+    const TDesC8& aMessage, 
+    TUint32 aOperation );
 
 /**
 * Utility class to show the prompt for platform security access.
@@ -136,6 +174,7 @@
 // Returns the app full name
 // ----------------------------------------------------------------------------
 //
+/*
 static HBufC* GetAppNameLC( RApaLsSession& aSession, const TUid& aUid )
     {
     TApaAppInfo info;
@@ -143,52 +182,8 @@
     
     return info.iFullName.AllocLC();
     }
-    
-    
-// ----------------------------------------------------------------------------
-// Sends the command to Widget launcher
-// ----------------------------------------------------------------------------
-//
-static void HandleWidgetCommandL( 
-    RApaLsSession& aSession, 
-    const TDesC& aWidget,
-    const TUid& aUid,
-    TUint32 aOperation )
-    {
-    const TInt size( 2* aWidget.Length() + 3*sizeof( TUint32 ) );
-    
-    // Message format is <filenameLength><unicode_filename><someintegervalue>
-    CApaCommandLine* cmd( CApaCommandLine::NewLC() );
-    HBufC8* opaque( HBufC8::NewLC( size ) );
-    
-    RDesWriteStream stream;
-    TPtr8 des( opaque->Des() );
+*/
     
-    stream.Open( des );
-    CleanupClosePushL( stream );
-    
-    // Generate the command.
-    stream.WriteUint32L( aUid.iUid );
-    stream.WriteUint32L( aWidget.Length() );
-    stream.WriteL( reinterpret_cast< const TUint8* >( aWidget.Ptr() ),
-                   aWidget.Size() );
-    
-    stream.WriteInt32L( aOperation );
-    
-    CleanupStack::PopAndDestroy( &stream );
-    
-    // Generate command.
-    cmd->SetCommandL( EApaCommandBackgroundAndWithoutViews );
-    cmd->SetOpaqueDataL( *opaque );    
-
-    CleanupStack::PopAndDestroy( opaque );
-    
-    cmd->SetExecutableNameL( KLauncherApp );
-    
-    User::LeaveIfError( aSession.StartApp( *cmd ) );
-    CleanupStack::PopAndDestroy( cmd );
-    }
-
 // Map the interface UIDs to implementation factory functions
 const TImplementationProxy ImplementationTable[] = 
     {
@@ -901,9 +896,7 @@
 //
 void CWrtHarvester::LaunchWidgetOperationL( SWidgetOperation aOperation )
     {
-    HBufC* widgetName( GetAppNameLC( iApaSession, aOperation.iUid) );
-    HandleWidgetCommandL( iApaSession, *widgetName, aOperation.iUid, aOperation.iOperation );
-    CleanupStack::PopAndDestroy( widgetName );
+    LaunchWidgetL (aOperation.iUid, aOperation.iOperation );
     }
 
 // ----------------------------------------------------------------------------
@@ -1160,5 +1153,147 @@
                                 aMessage,
                                 aSoftkeys);
     }
+//======================================================================
+// Launch widget.
+//===========================================================================
+//
+void LaunchWidgetL( const TUid& aUid, TUint32 aOperation )
+    {
+    __UHEAP_MARK;
+    
+    TUid widgetAppUid( TUid::Uid( KWidgetAppUid ) );
+    
+    RWsSession wsSession;
+    ROomMonitorSession monitorSession;
+    TApaTaskList taskList( wsSession );
+    HBufC8* message( HBufC8::NewLC( KWidgetUiMaxMessageLength ) );
+    TPtr8 des( message->Des() );
+    TInt err(KErrNone);
+    RDesWriteStream stream( des );
+    
+    CleanupClosePushL( stream );
+    
+    // Make the message to be sent.
+    stream.WriteUint32L( 1 );
+    stream.WriteUint32L( aUid.iUid );
+    stream.WriteInt32L( aOperation );
+        
+    CleanupStack::PopAndDestroy( &stream );
+    
+    // Create Window server session
+    User::LeaveIfError( wsSession.Connect() );
+    User::LeaveIfError( monitorSession.Connect() );
+    CleanupClosePushL( wsSession );
 
+    // Get the task list
+    // Try to find out if stub ui is already running
+    TApaTask task = taskList.FindApp( widgetAppUid );
+
+    if ( task.Exists() )
+        {
+        // TODO make something here, or not...
+        widgetAppUid = TUid::Uid( 1 );
+        if ( aOperation == WidgetSelect )
+            {
+            task.BringToForeground();
+            }
+        task.SendMessage( widgetAppUid, des );
+        }
+    else
+        {
+        // TODO CONST
+        if ( aOperation == LaunchMiniview ||
+             aOperation == WidgetSelect ||
+             aOperation == WidgetResume ||
+             aOperation == WidgetRestart ) //WidgetUI has died -> re-launch
+            {
+            TInt bytesAvailaible(0);
+            if (aOperation != WidgetSelect )
+                {
+#ifdef BRDO_OOM_MONITOR2_COMPONENT_FF
+                err = monitorSession.RequestOptionalRam(KMemoryToLaunchWidgetUi, KMemoryToLaunchWidgetUi,KUidWidgetOOMPlugin, bytesAvailaible);
+#else
+                   TMemoryInfoV1Buf info;
+                   UserHal::MemoryInfo(info);
+                   err = info().iFreeRamInBytes > KMemoryToLaunchWidgetUi +  KRAMGOODTHRESHOLD ? KErrNone : KErrNoMemory;
+#endif
+                if( err == KErrNone)
+                    {
+                    LaunchWidgetUIL( widgetAppUid, *message, aOperation );
+                    }
+                }
+            else
+                {
+                //The modification is related to the manual starting of WRT widgets from HS. After noticing an issue when
+                //the user taps manually a WRT widget from the HS. 
+                //If RAM is not available with RequestOptionalRam() API, the manual tapping does nothing
+                //and that is incorrect behaviour. Therefore if widgetSelect -event is sent to the launcher we are using RequestFreeMemory() instead of using RequestOptionalRam() API. 
+                //This means that we apply mandatory RAM allocation when a widget is started manually from HS in order to make sure that RAM is released properly
+                err = monitorSession.RequestFreeMemory( KMemoryToLaunchWidgetUi );
+                if( err == KErrNone)
+                    {
+                    LaunchWidgetUIL( widgetAppUid, *message, aOperation );
+                    }
+                }
+            if(err != KErrNone)
+                NotifyCommandAndCleanUp();
+            }
+        else
+            {
+            NotifyCommandAndCleanUp();
+            }
+            
+        }
+        
+    CleanupStack::PopAndDestroy( 2, message );
+    monitorSession.Close();
+    __UHEAP_MARKEND;
+    }
+
+//===========================================================================
+// Launch Widget UI.
+//===========================================================================
+void LaunchWidgetUIL( 
+    const TUid& aUid, 
+    const TDesC8& aMessage, 
+    TUint32 aOperation )
+    {
+    HBufC* document( NULL );
+    CApaCommandLine* line( CApaCommandLine::NewLC() );
+    TApaAppInfo info;
+    RApaLsSession session;
+    
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL( session );
+    
+    User::LeaveIfError( session.GetAppInfo( info, aUid ) );
+        
+    document = HBufC::NewMaxLC( TReal( TReal( aMessage.Length() )  / 2.0 ) + 0.5 );
+
+    Mem::Copy( 
+        reinterpret_cast< TUint8* >( const_cast< TUint16* >( document->Ptr() ) ),
+        aMessage.Ptr(),
+        KWidgetUiMaxMessageLength );
+        
+    line->SetDocumentNameL( *document );
+    line->SetExecutableNameL( info.iFullName );
+        
+    // TODO make const definitions.
+    if ( aOperation == 1 || aOperation == 3 )
+        {
+        line->SetCommandL( EApaCommandBackground );
+        }
+        
+    session.StartApp( *line );
+
+    CleanupStack::PopAndDestroy( 3, line );
+    }
+
+void NotifyCommandAndCleanUp()
+    {
+    const TUid KMyPropertyCat = { 0x10282E5A };
+    enum TMyPropertyKeys { EWidgetUIState = 109 };
+    TInt state( 2 );
+    RProperty::Set( KMyPropertyCat, EWidgetUIState , state );    
+    }
  //  End of File
--- a/widgets/widgetapp/src/WidgetUiAppUi.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiAppUi.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -304,6 +304,16 @@
 
     if ( aEvent.Type() == KAknUidValueEndKeyCloseEvent )
         {
+        	
+#ifdef BRDO_MULTITOUCH_ENABLED_FF
+        if( IsDisplayingDialog() ) 
+        	   {
+             //Get the top dialog
+             CCoeControl* control = TopFocusedControl();
+             delete control;
+             control = NULL;
+             }
+#endif
         // Close the current active widget
         iWindowManager->CloseWindowsAsync(EFalse);
         return;
@@ -378,7 +388,7 @@
             {            
 #ifdef OOM_WIDGET_CLOSEALL            
             CloseAllWidgetsAndExit();
-#else if    // OOM_WIDGET_CLOSEALL        
+#else //if    OOM_WIDGET_CLOSEALL        
             iWindowManager->HandleOOMEventL(iIsForeground);
             CloseAndExitIfNoneLeft();
 #endif            
@@ -558,7 +568,7 @@
     TUint32& aOperation )
     {
     __UHEAP_MARK;
-    TUint32 version( -1 );
+    TUint32 version( 0 );
     TPtrC ptr( NULL, 0 );
     
     RDesReadStream stream( aLine );
--- a/widgets/widgetapp/src/WidgetUiWindow.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindow.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -98,8 +98,8 @@
     : iWindowManager( aWindowManager ), iCpsPublisher( aCpsPublisher ), iNetworkAccessGrant(EInvalid),
       iPreferredOrientation(TBrCtlDefs::EOrientationUndefined),
       iIsCurrent(EFalse), iShowSoftkeys(EFalse), iWidgetLoaded(EFalse),
-      iSchemeProcessing (EFalse),iClickCount(0), iWidgetLoadStarted(EFalse),
-      iNetworkState(ENetworkNotAllowed), iUserPermission(ETrue)
+      iSchemeProcessing (EFalse), iNetworkState(ENetworkNotAllowed), iUserPermission(ETrue), 
+      iClickCount(0), iWidgetLoadStarted(EFalse)
     {
     }
 
@@ -561,7 +561,7 @@
             UpdateCba();
             Engine()->MakeVisible( iWidgetLoaded );
             // redraw incase the orientation changed while in the background
-            RelayoutL();
+            RelayoutL(KEikDynamicLayoutVariantSwitch);
             }
         else
             {
--- a/widgets/widgetapp/src/WidgetUiWindowContainer.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindowContainer.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -154,8 +154,6 @@
 //
 void CWidgetUiWindowContainer::SizeChanged()
     {
-    TInt offset( 0 );
-
     if( Engine() && (Engine()->Rect() != Rect()) )
         {
         TRect rect( Rect() );
@@ -291,16 +289,12 @@
 
     if (Engine())
         {
-        TBool showStausPane(EFalse);
         TBrCtlDefs::TBrCtlElementType eType = Engine()->FocusedElementType();
         switch(eType)
             {
             case TBrCtlDefs::EElementInputBox:
             case TBrCtlDefs::EElementActivatedInputBox:
             case TBrCtlDefs::EElementTextAreaBox:
-                // status pane is needed for editing
-                showStausPane = ETrue;
-                // fall through
             case TBrCtlDefs::EElementObjectBox:
             case TBrCtlDefs::EElementActivatedObjectBox:
                 {
--- a/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -228,8 +228,18 @@
     iCenrepNotifyHandler->DoCancel();
     delete iCenrepNotifyHandler;
 #endif
-      iActiveFsWindow = NULL;
-	  
+   
+    iActiveFsWindow = NULL;
+    
+#ifdef BRDO_OCC_ENABLED_FF 
+    if ( iRetryConnectivity)
+        {
+        iRetryConnectivity->Cancel();
+        delete iRetryConnectivity;
+        iRetryConnectivity = NULL;
+        }
+#endif
+	 
 	  iWindowList.ResetAndDestroy();
   
 #ifdef BRDO_WRT_HS_FF   
@@ -256,14 +266,6 @@
     delete iCpsPublisher;
 #endif
     delete iDb;
-#ifdef BRDO_OCC_ENABLED_FF 
-    if ( iRetryConnectivity)
-        {
-        iRetryConnectivity->Cancel();
-        delete iRetryConnectivity;
-        iRetryConnectivity = NULL;
-        }
-#endif
     }
 
 // -----------------------------------------------------------------------------
@@ -764,9 +766,8 @@
                 }             
             delete aWidgetWindow;
             }
-        return EFalse; 
         }
-    
+    return EFalse;
     }
 
 // =============================================================================
@@ -1616,9 +1617,9 @@
 
 CRequestRAM::CRequestRAM(CWidgetUiWindowManager* aWidgetUiWindowManager, const TUid& aUid, TUint32 aOperation):
     CActive( EPriorityStandard ),
-    iOperation(aOperation),
+    iWidgetUiWindowManager(aWidgetUiWindowManager),
     iUid(aUid),
-    iWidgetUiWindowManager(aWidgetUiWindowManager)
+    iOperation(aOperation)
     {
 	}
 	
@@ -1780,7 +1781,7 @@
     StartObservingL();
     }
          
-CCenrepNotifyHandler::CCenrepNotifyHandler(MCenrepWatcher& aObserver) : iObserver(aObserver), CActive (EPriorityLow)
+CCenrepNotifyHandler::CCenrepNotifyHandler(MCenrepWatcher& aObserver) : CActive (EPriorityLow),iObserver(aObserver) 
    {
          
    }
--- a/widgets/widgetapp/src/cpspublisher.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetapp/src/cpspublisher.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -29,7 +29,6 @@
 
 
 // TODO use global definitions!
-_LIT( KWidgetBitmap, "widget_bitmap" );
 _LIT8( KWidgetId, "widget_id");
 _LIT8( KBitmapHandle, "bitmap_handle");
 _LIT8( KDelete, "Delete" );
--- a/widgets/widgetinstaller/src/WidgetUIOperationsWatcher.cpp	Mon Jun 21 16:54:17 2010 +0300
+++ b/widgets/widgetinstaller/src/WidgetUIOperationsWatcher.cpp	Thu Jul 15 19:53:20 2010 +0300
@@ -305,7 +305,7 @@
         if ( !iSilent ) { iUIHandler->DisplayCancelL(); }
 
         TRequestStatus* status = &aRequestStatus;
-        User::RequestComplete( status, KErrNone );
+        User::RequestComplete( status, KErrCancel );
         }
     }