Revision: 201018 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 17:13:44 +0300
branchRCL_3
changeset 70 8bfb9186a8b8
parent 67 4917f9bf7995
child 71 4bd5176e1bc8
Revision: 201018 Kit: 201019
browserutilities/connectionmanager/Src/ConnManActiveConnector.cpp
browserutilities/connectionmanager/Src/InternetConnectionManager.cpp
browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadUtils.cpp
browserutilities/feedsengine/FeedsServer/Client/src/Feed.cpp
browserutilities/feedsengine/FeedsServer/FeedHandler/src/FeedParser.cpp
browserutilities/feedsengine/FeedsServer/Server/src/FeedsServer.cpp
browserutilities/webutils/conf/webutils.confml
web_pub/browser_control_api/inc/BrCtlDefs.h
webengine/osswebengine/JavaScriptCore/kjs/collector.cpp
webengine/osswebengine/MemoryManager/Src/heap.cpp
webengine/osswebengine/WebCore/bindings/js/kjs_binding.cpp
webengine/osswebengine/WebCore/bindings/js/kjs_window.cpp
webengine/osswebengine/WebCore/bindings/js/kjs_window.h
webengine/osswebengine/WebCore/platform/StringImpl.cpp
webengine/osswebengine/WebCore/platform/Timer.cpp
webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSourceSymbian.cpp
webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.cpp
webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.h
webengine/osswebengine/WebCore/platform/network/symbian/HttpConnection.cpp
webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.cpp
webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.h
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.cpp
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.h
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h
webengine/osswebengine/WebCore/rendering/RenderPartObject.cpp
webengine/osswebengine/WebKit/s60/misc/WebTabbedNavigation.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/WebFepTextEditor.cpp
webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp
webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp
webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp
webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp
webengine/osswebengine/WebKit/s60/webview/WebView.cpp
webengine/osswebengine/WebKit/s60/webview/WebView.h
webengine/osswebengine/WebKit/s60/webview/WidgetExtension.cpp
webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp
webengine/widgetregistry/tsrc/public/basic/group/WidgetRegistrySTIF.mmp
webengine/widgetregistry/tsrc/public/basic/inc/WidgetRegistrySTIF.h
webengine/widgetregistry/tsrc/public/basic/src/WidgetRegistrySTIF.cpp
widgets/widgetapp/src/WidgetUiNetworkListener.cpp
widgets/widgetapp/src/WidgetUiWindow.cpp
widgets/widgetapp/src/WidgetUiWindowManager.cpp
--- a/browserutilities/connectionmanager/Src/ConnManActiveConnector.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/connectionmanager/Src/ConnManActiveConnector.cpp	Tue May 11 17:13:44 2010 +0300
@@ -195,7 +195,6 @@
 	{
 	CLOG_WRITE( "CConnManActiveConnector: DoCancel called");
     
-	iConnection.Close();
 	User::RequestComplete( iExternalRequestStatus, KErrCancel );//completing user req
     
 	CLOG_WRITE( "CConnManActiveConnector: DoCancel returned");
--- a/browserutilities/connectionmanager/Src/InternetConnectionManager.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/connectionmanager/Src/InternetConnectionManager.cpp	Tue May 11 17:13:44 2010 +0300
@@ -457,18 +457,17 @@
 			}
 		else
 			{               
+            if(iConnection.SubSessionHandle() <= 0)
+                {
+				//  RConnection handle is invalid, we haven't opened the RConnection yet.
 		        connErr = iConnection.Open( iServ, KAfInet );
+		       	}
 		        CLOG_WRITE_1( "RConnection: %d", connErr );
 		        if( connErr == KErrNone )
 		            {
 		            // Always pass the IAP Id to RConnection even in silent mode
 		            connErr = iSyncConnector->Connect( overrides );
 		            }
-		        if( connErr != KErrNone )
-		            {
-		            CLOG_WRITE( "Closing all" );
-		            iConnection.Close();
-		            }
 			}
 		}
 	if ( iWaitDialog )
@@ -518,11 +517,6 @@
 		delete iCommsDb;
 		}
 
-    if( iConnected )
-        {
-        iConnection.Close();
-        }
-
     if( !iSilentMode )
         // Temp fix for CDMA
         {
@@ -537,8 +531,8 @@
 	delete iNoteDialog;
 	delete iSyncConnector;
 	iRFs.Close();
-
-    iServ.Close();
+	iConnection.Close();
+	iServ.Close();
     
 	CLOG_CLOSE;
 	}
@@ -652,11 +646,13 @@
     CLOG_ENTERFN( "StopConnectionL()" );
 
     StopConnectionObserving();
+    
     if( iConnected )
         {
-        CLOG_WRITE( "StopConnectionL() Stop the Connection" );
+        CLOG_WRITE( "StopConnectionL() Stop the Connection" );        
         iConnection.Close();
-        }
+        TInt err = iConnection.Open( iServ, KAfInet );        
+        }    
     
 //    iServ.Close();
     iConnected = EFalse;
@@ -1379,7 +1375,6 @@
      {
      	// this is a connection closed event
         CLOG_WRITE( "ConnectionStageAchievedL() Stoping the connection instead of closing" );
-        iConnection.Close();
     	iConnected = EFalse;
 
     	if( !iSilentMode )
@@ -2150,18 +2145,17 @@
 
 	if ( !connErr )
 		{
+		if(iConnection.SubSessionHandle() <= 0)
+			{
+			//  RConnection handle is invalid, we haven't opened the RConnection yet.
         connErr = iConnection.Open( iServ, KAfInet );
+        	}
         CLOG_WRITE_1( "RConnection: %d", connErr );
         if( connErr == KErrNone )
             {
            //connect with snap id
             connErr = iSyncConnector->ConnectSnap( overrides );
             }
-        if( connErr != KErrNone )
-            {
-            CLOG_WRITE( "Closing all" );
-            iConnection.Close();
-            }
 		}
 	
 	CleanupStack::PopAndDestroy();//overrides
--- a/browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp	Tue May 11 17:13:44 2010 +0300
@@ -6844,7 +6844,6 @@
         if( downloadPathPlugin )
             {
              GetUpdatedPathFromPluginL(downloadPathPlugin,rootPath,fileNamePtr);
-             CleanupStack::PopAndDestroy( downloadPathPlugin );
             }
          else 
            {
@@ -6874,6 +6873,13 @@
 #ifdef RD_MULTIPLE_DRIVE
     CleanupStack::PopAndDestroy( drivesDynList ); 
 #endif
+
+#ifdef DOWNLOADMGR_PATH_PLUGIN_ENABLED_FF
+    if(downloadPathPlugin)
+    {
+     CleanupStack::PopAndDestroy( downloadPathPlugin );
+    }
+#endif
     CleanupStack::PopAndDestroy( &fs );
     }    
 
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadUtils.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadUtils.cpp	Tue May 11 17:13:44 2010 +0300
@@ -46,6 +46,7 @@
 _LIT8(Krng, "application/vnd.nokia.ringing-tone");
 _LIT8(Krn, "application/vnd.rn-realmedia");
 _LIT8(Kpn, "application/x-pn-realmedia");
+_LIT8(KWmdrmLicenseResponseContentType,"application/vnd.ms-wmdrm.lic-resp" );
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -236,7 +237,7 @@
         CleanupStack::PopAndDestroy( docHandler ); // docHandler
 
         if ( !(aContentType.Compare(KOma2RoContentType)) || !(aContentType.Compare(KOma2ProtectedRoType))
-            || !(aContentType.Compare(KOma2TriggerContentType)) )
+            || !(aContentType.Compare(KOma2TriggerContentType)) || !(aContentType.Compare(KWmdrmLicenseResponseContentType)) )
             {
             canOpen = EFalse;
             }
@@ -273,6 +274,11 @@
     	return EFalse; 
         }
 #endif         
+    else if ( !(aContentType.Compare(KOma2RoContentType)) || !(aContentType.Compare(KOma2ProtectedRoType))
+        || !(aContentType.Compare(KOma2TriggerContentType)) || !(aContentType.Compare(KWmdrmLicenseResponseContentType)) )
+        {
+        return EFalse;
+        }
     else
         {
         TBool canOpen( EFalse );
--- a/browserutilities/feedsengine/FeedsServer/Client/src/Feed.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/Client/src/Feed.cpp	Tue May 11 17:13:44 2010 +0300
@@ -207,6 +207,8 @@
     {
     aItemIds.Reset();
     aItemStatus.Reset();
+    CleanupClosePushL(aItemIds);
+    CleanupClosePushL(aItemStatus);
 
     // Add the item attributes.
     for (TInt i = 0; i < iItems.Count(); i++)
@@ -214,6 +216,8 @@
         User::LeaveIfError(aItemIds.Append(iItems[i]->Id()));
         User::LeaveIfError(aItemStatus.Append(iItems[i]->ItemStatus()));
         }
+    
+    CleanupStack::Pop(2); // aItemIds, aItemStatus
     }
 
 // -----------------------------------------------------------------------------
--- a/browserutilities/feedsengine/FeedsServer/FeedHandler/src/FeedParser.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/FeedHandler/src/FeedParser.cpp	Tue May 11 17:13:44 2010 +0300
@@ -295,6 +295,7 @@
         const TDesC8& aNamespace, const TDesC8& aElementName, TInt aValueId, 
         ElementHandlerFunctionL aHandler)
     {
+    CleanupClosePushL(aMappings);  
     ElementHandlerMapEntry  entry;
 
     // Init the entry.
@@ -305,6 +306,7 @@
     
     // Append the entry.
     User::LeaveIfError(aMappings.Append(entry));
+    CleanupStack::Pop();
     }
 
 
--- a/browserutilities/feedsengine/FeedsServer/Server/src/FeedsServer.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/browserutilities/feedsengine/FeedsServer/Server/src/FeedsServer.cpp	Tue May 11 17:13:44 2010 +0300
@@ -31,7 +31,10 @@
 
 //  CONSTANTS
 _LIT(KFeedsServerPanic, "FeedsServer");
-
+// opml files are generally smaller in size.But if a malformed opml 
+// greater than 400kB would cause the system to be irresponsive.
+// So limit the max size to 400 kB
+const TInt KMaxOPMLFileSize = 409600;
 //_LIT(KFileSchema, "file://c:");
 _LIT(KDefaultFeed, "default_feeds.xml");
 
@@ -385,7 +388,10 @@
 
     // Read file
     User::LeaveIfError(aFile.Size(size));
-
+    if ( size > KMaxOPMLFileSize )
+        {
+        User::Leave(KErrCorrupt);	
+        }
     buffer = HBufC8::NewLC(size);
     bufferPtr.Set(buffer->Des());
 
@@ -558,6 +564,7 @@
 void CFeedsServer::ScheduleUpdateManagerL()
     {
     RArray<TInt>     folderListIds;
+	CleanupClosePushL(folderListIds);
     TBool    autoUpdate = EFalse;
     TInt     autoUpdateFreq = 0;
     TUint32  autoUpdateAP = 0;
@@ -576,6 +583,8 @@
                 }
             }
         }
+    
+    CleanupStack::PopAndDestroy(); //folderListIds
     }
 
 // -----------------------------------------------------------------------------
Binary file browserutilities/webutils/conf/webutils.confml has changed
--- a/web_pub/browser_control_api/inc/BrCtlDefs.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/web_pub/browser_control_api/inc/BrCtlDefs.h	Tue May 11 17:13:44 2010 +0300
@@ -211,7 +211,14 @@
              ECommandSetRetryConnectivityFlag,
              ECommandUnSetRetryConnectivityFlag,
              ECommandClearQuedTransactions,
-             ECommandConnToDownloadManager
+             ECommandConnToDownloadManager,
+             
+            /**
+            * Pause/Resume Script Timers
+            */
+             ECommandPauseScriptTimers,
+             ECommandResumeScriptTimers,
+			 ECommandCancelQueuedTransactions
             };
         /**
         * The load event that occurred.
--- a/webengine/osswebengine/JavaScriptCore/kjs/collector.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/JavaScriptCore/kjs/collector.cpp	Tue May 11 17:13:44 2010 +0300
@@ -79,7 +79,7 @@
 const size_t MIN_ARRAY_SIZE = 14;
 const size_t GROWTH_FACTOR = 2;
 const size_t LOW_WATER_FACTOR = 4;
-const size_t ALLOCATIONS_PER_COLLECTION = 1000;
+const size_t ALLOCATIONS_PER_COLLECTION = 4000;
 
 enum OperationInProgress { NoOperation, Allocation, Collection };
 
--- a/webengine/osswebengine/MemoryManager/Src/heap.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/heap.cpp	Tue May 11 17:13:44 2010 +0300
@@ -2344,9 +2344,16 @@
 			{
 			// need to allocate-copy-free
 			void* newp = map(0, sz);
-			memcpy(newp, p, oldsz);
-			unmap(p,oldsz);
-			return newp;
+            if(newp)
+                {
+                memcpy(newp, p, oldsz);
+                unmap(p,oldsz);
+                return newp;
+                }
+            else
+                {
+                return 0;
+                }
 			}
 		}
 	return p;
--- a/webengine/osswebengine/WebCore/bindings/js/kjs_binding.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/bindings/js/kjs_binding.cpp	Tue May 11 17:13:44 2010 +0300
@@ -135,7 +135,7 @@
     , m_timerCallback(false)
 {
     // Time in milliseconds before the script timeout handler kicks in.
-    setTimeoutTime(100000);
+    setTimeoutTime(10000); // 10 sec
 }
 
 DOMObject* ScriptInterpreter::getDOMObject(void* objectHandle) 
--- a/webengine/osswebengine/WebCore/bindings/js/kjs_window.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/bindings/js/kjs_window.cpp	Tue May 11 17:13:44 2010 +0300
@@ -72,6 +72,12 @@
 #include <wtf/MathExtras.h>
 #include "symbian/kjs_console.h"
 
+// for JTimerBase
+#include "SystemTime.h"
+#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
+
+
 #if ENABLE(XSLT)
 #include "JSXSLTProcessor.h"
 #endif
@@ -85,7 +91,8 @@
 
 static int timerNestingLevel = 0;
 const int cMaxTimerNestingLevel = 5;
-const double cMinimumTimerInterval = 0.010;
+const double cMinimumTimerInterval = 0.020; // lower values can block CPU if periodic timers are used
+
 
 struct WindowPrivate {
     WindowPrivate()
@@ -108,7 +115,537 @@
     TimeoutsMap m_timeouts;
 };
 
-class DOMWindowTimer : public TimerBase {
+// ==========================================================================================
+// Base class for JavaScript timers - start
+// ==========================================================================================
+using namespace std;
+class JTimerBase : Noncopyable {
+public:
+    JTimerBase();
+    virtual ~JTimerBase();
+
+    void start(double nextFireInterval, double repeatInterval);
+    void startRepeating(double repeatInterval) { start(repeatInterval, repeatInterval); }
+    void startOneShot(double interval) { start(interval, 0); }
+    void stop();
+    bool isActive() const;
+    double nextFireInterval() const;
+    double repeatInterval() const { return m_repeatInterval; }
+    void augmentRepeatInterval(double delta) { setNextFireTime(m_nextFireTime + delta); m_repeatInterval += delta; }
+    
+    
+    static void setDeferringTimers(bool);
+    static void shutdownSharedTimer();    
+    double m_nextFireTime; // 0 if inactive
+    double m_repeatInterval; // 0 if not repeating
+    int m_heapIndex; // -1 if not in heap
+private:
+    virtual void fired() = 0; // to be implemented in derived class
+    void checkConsistency() const;
+    void checkHeapIndex() const;
+    void setNextFireTime(double);
+    bool inHeap() const { return m_heapIndex != -1; }
+    void heapDecreaseKey();
+    void heapDelete();
+    void heapDeleteMin();
+    void heapIncreaseKey();
+    void heapInsert();
+    void heapPop();
+    void heapPopMin();
+
+    //static void fireTimersInNestedEventLoop();
+    static void deleteTimerHeap();
+    static void collectFiringTimers(double fireTime, Vector<JTimerBase*>&);
+    static void fireTimers(double fireTime, const Vector<JTimerBase*>&);
+    
+    //shared timer functions
+    static void sharedTimerFired();
+    static TInt TimerFn( TAny* /*aPtr*/ );
+    static void setSharedTimerFireTime(double fireTime);
+    static bool isDeferringTimers();    
+    static void updateSharedTimer();
+    static void stopSharedTimer();
+    static void initSharedTimer();
+    
+    friend class TimerHeapElement;
+    friend bool operator<(const TimerHeapElement&, const TimerHeapElement&);
+};
+
+static bool deferringTimers;
+static Vector<JTimerBase*>* timerHeap;
+static HashSet<const JTimerBase*>* timersReadyToFire;
+
+struct JTimerCleaner {
+    ~JTimerCleaner() {
+        if( timerHeap ) {
+            delete timerHeap;
+            timerHeap = 0;
+            JTimerBase::shutdownSharedTimer();
+        }
+    }
+};
+struct JTimerCleaner jCleanTimer;
+
+// ----------------
+
+// Class to represent elements in the heap when calling the standard library heap algorithms.
+// Maintains the m_heapIndex value in the timers themselves, which allows us to do efficient
+// modification of the heap.
+class TimerHeapElement {
+public:
+    explicit TimerHeapElement(int i) : m_index(i), m_timer((*timerHeap)[m_index]) { checkConsistency(); }
+
+    TimerHeapElement(const TimerHeapElement&);
+    TimerHeapElement& operator=(const TimerHeapElement&);
+
+    JTimerBase* timer() const { return m_timer; }
+
+    void checkConsistency() const {
+        ASSERT(m_index >= 0);
+        ASSERT(m_index < (timerHeap ? static_cast<int>(timerHeap->size()) : 0));
+    }
+
+private:
+    TimerHeapElement();
+
+    int m_index;
+    JTimerBase* m_timer;
+};
+
+inline TimerHeapElement::TimerHeapElement(const TimerHeapElement& o)
+    : m_index(-1), m_timer(o.timer())
+{
+}
+
+inline TimerHeapElement& TimerHeapElement::operator=(const TimerHeapElement& o)
+{
+    JTimerBase* t = o.timer();
+    m_timer = t;
+    if (m_index != -1) {
+        checkConsistency();
+        (*timerHeap)[m_index] = t;
+        t->m_heapIndex = m_index;
+    }
+    return *this;
+}
+
+inline bool operator<(const TimerHeapElement& a, const TimerHeapElement& b)
+{
+    // Note, this is "backwards" because the heap puts the largest element first
+    // and we want the lowest time to be the first one in the heap.
+    return b.timer()->m_nextFireTime < a.timer()->m_nextFireTime;
+}
+
+// ----------------
+
+// Class to represent iterators in the heap when calling the standard library heap algorithms.
+// Returns TimerHeapElement for elements in the heap rather than the JTimerBase pointers themselves.
+class TimerHeapIterator : public iterator<random_access_iterator_tag, TimerHeapElement, int> {
+public:
+    TimerHeapIterator() : m_index(-1) { }
+    TimerHeapIterator(int i) : m_index(i) { checkConsistency(); }
+
+    TimerHeapIterator& operator++() { checkConsistency(); ++m_index; checkConsistency(); return *this; }
+    TimerHeapIterator operator++(int) { checkConsistency(); checkConsistency(1); return m_index++; }
+
+    TimerHeapIterator& operator--() { checkConsistency(); --m_index; checkConsistency(); return *this; }
+    TimerHeapIterator operator--(int) { checkConsistency(); checkConsistency(-1); return m_index--; }
+
+    TimerHeapIterator& operator+=(int i) { checkConsistency(); m_index += i; checkConsistency(); return *this; }
+    TimerHeapIterator& operator-=(int i) { checkConsistency(); m_index -= i; checkConsistency(); return *this; }
+
+    TimerHeapElement operator*() const { return TimerHeapElement(m_index); }
+    TimerHeapElement operator[](int i) const { return TimerHeapElement(m_index + i); }
+
+    int index() const { return m_index; }
+
+    void checkConsistency(int offset = 0) const {
+        ASSERT(m_index + offset >= 0);
+        ASSERT(m_index + offset <= (timerHeap ? static_cast<int>(timerHeap->size()) : 0));
+    }
+
+private:
+    int m_index;
+};
+
+inline bool operator==(TimerHeapIterator a, TimerHeapIterator b) { return a.index() == b.index(); }
+inline bool operator!=(TimerHeapIterator a, TimerHeapIterator b) { return a.index() != b.index(); }
+inline bool operator<(TimerHeapIterator a, TimerHeapIterator b) { return a.index() < b.index(); }
+
+inline TimerHeapIterator operator+(TimerHeapIterator a, int b) { return a.index() + b; }
+inline TimerHeapIterator operator+(int a, TimerHeapIterator b) { return a + b.index(); }
+
+inline TimerHeapIterator operator-(TimerHeapIterator a, int b) { return a.index() - b; }
+inline int operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.index() - b.index(); }
+
+// ----------------
+
+static TInt64 remainingMicro = 0;
+static bool shutdownInProgress = false;
+static CPeriodic* sharedTimer;
+
+void setDeferringJSTimers(bool defer)
+    {
+    JTimerBase::setDeferringTimers(defer);
+    }
+
+void JTimerBase::shutdownSharedTimer()
+    {
+    shutdownInProgress = true;
+    stopSharedTimer();
+    JTimerBase::deleteTimerHeap();
+    }
+
+void JTimerBase::initSharedTimer()
+    {
+    shutdownInProgress = false;
+    }
+
+
+TInt JTimerBase::TimerFn( TAny* /*aPtr*/ )
+    {
+    if (shutdownInProgress)
+        {
+        return KErrNone;
+        }
+    if( remainingMicro == 0 )
+        {
+            sharedTimerFired();
+        }
+    else
+        {
+        setSharedTimerFireTime( -1 );
+        }
+    return KErrNone;
+    }
+
+
+void JTimerBase::setSharedTimerFireTime(double fireTime)
+    {
+    if (shutdownInProgress)
+        {
+        return;
+        }
+
+    if (sharedTimer)
+        {
+        sharedTimer->Cancel();
+        delete sharedTimer;
+        sharedTimer = NULL;
+        }
+    if (fireTime != -1)
+        remainingMicro = 0;
+
+    sharedTimer = CPeriodic::New( CActive::EPriorityIdle );
+    if( sharedTimer )
+        {
+        TInt64 interval( remainingMicro );
+        if( remainingMicro == 0 )
+            {
+            // fireTime comes in second resolution
+            TTime fireDate( TTime(fireTime * 1000000 ).Int64() );
+
+            TTime time;
+            time.HomeTime();
+            interval = fireDate.Int64() - time.Int64();
+            }
+        interval = interval < 0 ? 0 : interval;
+        //
+        TInt t;
+        if (interval<(TInt)(KMaxTInt32))
+            {
+            t = interval;
+            remainingMicro = 0;
+            }
+        else
+            {
+            t = KMaxTInt32;
+            remainingMicro = interval - KMaxTInt32;
+            }
+        sharedTimer->Start( t, 0, JTimerBase::TimerFn);
+        }
+    }
+
+
+void JTimerBase::stopSharedTimer()
+    {
+    if (sharedTimer)
+        {
+        sharedTimer->Cancel();
+        delete sharedTimer;
+        sharedTimer = NULL;
+        }
+    remainingMicro = 0;
+    /*
+     * The static boolean variable shutdownInProgress, must be reset in scenario's where a browser control instance is deleted and a new
+     * instance is created without actually closing the application.
+     */
+    shutdownInProgress = false ;
+    }
+
+void JTimerBase::updateSharedTimer()
+{
+    if (timersReadyToFire || deferringTimers || !timerHeap || timerHeap->isEmpty())
+        stopSharedTimer();
+    else
+        setSharedTimerFireTime(timerHeap->first()->m_nextFireTime);
+}
+
+bool JTimerBase::isDeferringTimers()
+{
+    return deferringTimers;
+}
+
+void JTimerBase::setDeferringTimers(bool shouldDefer)
+{
+    if (shouldDefer == deferringTimers)
+        return;
+    deferringTimers = shouldDefer;
+    updateSharedTimer();
+}
+
+// ----------------
+
+JTimerBase::JTimerBase() : m_nextFireTime(0), m_repeatInterval(0), m_heapIndex(-1)
+{
+}
+
+JTimerBase::~JTimerBase()
+{
+    stop();
+
+    ASSERT(!inHeap());
+}
+
+void JTimerBase::start(double nextFireInterval, double repeatInterval)
+{
+    m_repeatInterval = repeatInterval;
+    setNextFireTime(currentTime() + nextFireInterval);
+}
+
+void JTimerBase::stop()
+{
+    m_repeatInterval = 0;
+    setNextFireTime(0);
+
+    ASSERT(m_nextFireTime == 0);
+    ASSERT(m_repeatInterval == 0);
+    ASSERT(!inHeap());
+}
+
+bool JTimerBase::isActive() const
+{
+    return m_nextFireTime || (timersReadyToFire && timersReadyToFire->contains(this));
+}
+
+double JTimerBase::nextFireInterval() const
+{
+    ASSERT(isActive());
+    double current = currentTime();
+    if (m_nextFireTime < current)
+        return 0;
+    return m_nextFireTime - current;
+}
+
+inline void JTimerBase::checkHeapIndex() const
+{
+    ASSERT(timerHeap);
+    ASSERT(!timerHeap->isEmpty());
+    ASSERT(m_heapIndex >= 0);
+    ASSERT(m_heapIndex < static_cast<int>(timerHeap->size()));
+    ASSERT((*timerHeap)[m_heapIndex] == this);
+}
+
+inline void JTimerBase::checkConsistency() const
+{
+    // Timers should be in the heap if and only if they have a non-zero next fire time.
+    ASSERT(inHeap() == (m_nextFireTime != 0));
+    if (inHeap())
+        checkHeapIndex();
+}
+
+void JTimerBase::heapDecreaseKey()
+{
+    ASSERT(m_nextFireTime != 0);
+    checkHeapIndex();
+    #if PLATFORM(SYMBIAN)
+    // check for valid heap index
+    if(m_heapIndex < static_cast<int>(timerHeap->size()))
+    #endif
+        {
+        push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1));
+        }
+    checkHeapIndex();
+}
+
+inline void JTimerBase::heapDelete()
+{
+    ASSERT(m_nextFireTime == 0);
+    heapPop();
+    timerHeap->removeLast();
+    m_heapIndex = -1;
+}
+
+inline void JTimerBase::heapDeleteMin()
+{
+    ASSERT(m_nextFireTime == 0);
+    heapPopMin();
+    timerHeap->removeLast();
+    m_heapIndex = -1;
+}
+
+inline void JTimerBase::heapIncreaseKey()
+{
+    ASSERT(m_nextFireTime != 0);
+    heapPop();
+    heapDecreaseKey();
+}
+
+inline void JTimerBase::heapInsert()
+{
+    ASSERT(!inHeap());
+    if (!timerHeap)
+        timerHeap = new Vector<JTimerBase*>;
+    timerHeap->append(this);
+    m_heapIndex = timerHeap->size() - 1;
+    heapDecreaseKey();
+}
+
+inline void JTimerBase::heapPop()
+{
+    // Temporarily force this timer to have the minimum key so we can pop it.
+    double fireTime = m_nextFireTime;
+    m_nextFireTime = -numeric_limits<double>::infinity();
+    heapDecreaseKey();
+    heapPopMin();
+    m_nextFireTime = fireTime;
+}
+
+void JTimerBase::heapPopMin()
+{
+    ASSERT(this == timerHeap->first());
+    checkHeapIndex();
+    pop_heap(TimerHeapIterator(0), TimerHeapIterator(timerHeap->size()));
+    checkHeapIndex();
+    ASSERT(this == timerHeap->last());
+}
+
+void JTimerBase::setNextFireTime(double newTime)
+{
+    // Keep heap valid while changing the next-fire time.
+
+    if (timersReadyToFire)
+        timersReadyToFire->remove(this);
+
+    double oldTime = m_nextFireTime;
+    if (oldTime != newTime) {
+        m_nextFireTime = newTime;
+
+        bool wasFirstTimerInHeap = m_heapIndex == 0;
+
+        if (oldTime == 0)
+            heapInsert();
+        else if (newTime == 0)
+            heapDelete();
+        else if (newTime < oldTime)
+            heapDecreaseKey();
+        else
+            heapIncreaseKey();
+
+        bool isFirstTimerInHeap = m_heapIndex == 0;
+
+        if (wasFirstTimerInHeap || isFirstTimerInHeap)
+            updateSharedTimer();
+    }
+
+    checkConsistency();
+}
+
+void JTimerBase::collectFiringTimers(double fireTime, Vector<JTimerBase*>& firingTimers)
+{
+    while (!timerHeap->isEmpty() && timerHeap->first()->m_nextFireTime <= fireTime) {
+        JTimerBase* timer = timerHeap->first();
+        firingTimers.append(timer);
+        timersReadyToFire->add(timer);
+        timer->m_nextFireTime = 0;
+        timer->heapDeleteMin();
+    }
+}
+
+void JTimerBase::fireTimers(double fireTime, const Vector<JTimerBase*>& firingTimers)
+{
+    int size = firingTimers.size();
+    for (int i = 0; i != size; ++i) {
+        JTimerBase* timer = firingTimers[i];
+
+        // If not in the set, this timer has been deleted or re-scheduled in another timer's fired function.
+        // So either we don't want to fire it at all or we will fire it next time the shared timer goes off.
+        // It might even have been deleted; that's OK because we won't do anything else with the pointer.
+        if (!timersReadyToFire->contains(timer))
+            continue;
+
+        // Setting the next fire time has a side effect of removing the timer from the firing timers set.
+        double interval = timer->repeatInterval();
+        timer->setNextFireTime(interval ? fireTime + interval : 0);
+
+        // Once the timer has been fired, it may be deleted, so do nothing else with it after this point.
+        timer->fired();
+
+        // Catch the case where the timer asked timers to fire in a nested event loop.
+        if (!timersReadyToFire)
+            break;
+    }
+}
+
+void JTimerBase::sharedTimerFired()
+{
+    // Do a re-entrancy check.
+    if (timersReadyToFire)
+        return;
+
+    double fireTime = currentTime();
+    Vector<JTimerBase*> firingTimers;
+    HashSet<const JTimerBase*> firingTimersSet;
+
+    timersReadyToFire = &firingTimersSet;
+
+    collectFiringTimers(fireTime, firingTimers);
+    fireTimers(fireTime, firingTimers);
+
+    timersReadyToFire = 0;
+
+    updateSharedTimer();
+}
+/*
+void JTimerBase::fireTimersInNestedEventLoop()
+{
+    timersReadyToFire = 0;
+    updateSharedTimer();
+}
+*/
+
+void JTimerBase::deleteTimerHeap()
+{
+    if (timerHeap)
+    {
+        while (!timerHeap->isEmpty())
+        {
+            JTimerBase* timer = timerHeap->first();
+            timer->m_nextFireTime = 0;
+            timer->heapDeleteMin();        
+        }
+        delete timerHeap ;
+        timerHeap = NULL ;
+    }
+}
+
+
+// ==========================================================================================
+// Base class for JavaScript timers - end
+// ==========================================================================================
+
+
+class DOMWindowTimer : public JTimerBase {
 public:
     DOMWindowTimer(int timeoutId, int nestingLevel, Window* o, ScheduledAction* a)
         : m_timeoutId(timeoutId), m_nestingLevel(nestingLevel), m_object(o), m_action(a) { }
@@ -1544,7 +2081,7 @@
 #if PLATFORM(SYMBIAN)
     if (d->m_evt && d->m_evt->type() == "mouseover")  {
         if (singleShot) {
-            double interval = max(0.001, t * 0.001);
+            double interval = max(0.010, t * 0.001);
             if (interval < cMinimumTimerInterval && (timerNestingLevel + 1) >= cMaxTimerNestingLevel) {
                 interval = cMinimumTimerInterval;
             }
@@ -1563,13 +2100,15 @@
     // Use a minimum interval of 10 ms to match other browsers, but only once we've
     // nested enough to notice that we're repeating.
     // Faster timers might be "better", but they're incompatible.
-    double interval = max(0.001, t * 0.001);
+    double interval = max(0.010, t * 0.001); // min interval for mobile device
     if (interval < cMinimumTimerInterval && nestLevel >= cMaxTimerNestingLevel)
         interval = cMinimumTimerInterval;
     if (singleShot)
         timer->startOneShot(interval);
-    else
+    else {
+        interval = max(0.030, t * 0.001); // keep periodic timers less frequent
         timer->startRepeating(interval);
+	}
     return timeoutId;
 }
 
@@ -1642,7 +2181,14 @@
         int timeoutId = timer->timeoutId();
 
         timer->action()->execute(this);
-        if (d->m_timeouts.contains(timeoutId) && timer->repeatInterval() && timer->repeatInterval() < cMinimumTimerInterval) {
+	
+    	// The DOMWindowTimer object may have been deleted or replaced during execution, 
+    	// so we re-fetch it. 
+    	timer = d->m_timeouts.get(timeoutId); 
+    	if (!timer) 
+    	   	return; 
+	 
+        if (timer->repeatInterval() && timer->repeatInterval() < cMinimumTimerInterval) {        
             timer->setNestingLevel(timer->nestingLevel() + 1);
             if (timer->nestingLevel() >= cMaxTimerNestingLevel)
                 timer->augmentRepeatInterval(cMinimumTimerInterval - timer->repeatInterval());
--- a/webengine/osswebengine/WebCore/bindings/js/kjs_window.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/bindings/js/kjs_window.h	Tue May 11 17:13:44 2010 +0300
@@ -225,6 +225,7 @@
     WebCore::Frame* m_frame;
   };
 
+  void setDeferringJSTimers(bool defer); // allow JS timers to defer when shared timers do
 } // namespace
 
 namespace WebCore {
--- a/webengine/osswebengine/WebCore/platform/StringImpl.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/StringImpl.cpp	Tue May 11 17:13:44 2010 +0300
@@ -103,6 +103,10 @@
     }
     
     m_data = newUCharVector(m_length);
+    if ( !m_data ) { 
+        m_length = 0; 
+        return; 
+    }
     int i = m_length;
     UChar* ptr = m_data;
     while (i--) {
@@ -123,7 +127,11 @@
     }
     
     m_data = newUCharVector(len);
-    memcpy(m_data, str, len * sizeof(UChar));
+    if ( !m_data ) { 
+        m_length = 0;     
+        return; 
+    }
+    memcpy(m_data, str, len * sizeof(UChar));    
 }
 
 StringImpl::~StringImpl()
--- a/webengine/osswebengine/WebCore/platform/Timer.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/Timer.cpp	Tue May 11 17:13:44 2010 +0300
@@ -32,6 +32,7 @@
 #include <limits>
 #include <wtf/HashSet.h>
 #include <wtf/Vector.h>
+#include <kjs_window.h>
 
 using namespace std;
 
@@ -413,6 +414,7 @@
         return;
     deferringTimers = shouldDefer;
     updateSharedTimer();
+    KJS::setDeferringJSTimers(shouldDefer); // defer JS timers also
 }
 
 }
--- a/webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSourceSymbian.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSourceSymbian.cpp	Tue May 11 17:13:44 2010 +0300
@@ -112,9 +112,8 @@
         // sync decoding if no observer is passed
         m_decoder = CAnimationDecoder::NewL( NULL );
     if( m_decoder ) {
-        TPtrC8 ptr( (const TUint8*)data->data(), data->size() );
         TPtrC16 ptr16(m_mimeType.des());        
-        m_decoder->OpenL( ptr, &ptr16, ETrue );
+        m_decoder->OpenL( data, &ptr16, ETrue );
     }
 }
 
--- a/webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.cpp	Tue May 11 17:13:44 2010 +0300
@@ -64,9 +64,9 @@
 // Creates a new object.
 // @return The constructed session.
 //
-CookieHandler* CookieHandler::init()
+CookieHandler* CookieHandler::init(RStringPool aStringPool)
 {
-    CookieHandler* self = new CookieHandler;
+    CookieHandler* self = new CookieHandler(aStringPool);
     if (self) {
         TRAPD(err, self->constructL());
         if (err) {
@@ -94,7 +94,6 @@
     User::LeaveIfError( uriParser.Parse( aUrl ));
     // possible leave
     cookieManager.GetCookiesL(uriParser.UriDes(), m_getCookies, cookie2Reqd);
-    
     TText* cookieString = NULL;
     
     HBufC8* cookieString8 = NULL;
@@ -175,7 +174,7 @@
     popAndDestroyCount +=6;
     // create a cookie
     // Why are we using the stringpool only constructor of cookie?
-    CCookie* cookie = CCookie::NewL( (*m_stringPool) );
+    CCookie* cookie = CCookie::NewL( (m_stringPool) );
     
     CleanupStack::PushL( cookie );
     popAndDestroyCount ++;
@@ -192,7 +191,6 @@
     if(cookieRecord.m_secure.Length()) {
         User::LeaveIfError( cookie->SetAttribute( CCookie::EVersion, versionAttrib ) );
     }
-    
     cookieManager.StoreCookie(*cookie, uriParser);
     CleanupStack::PopAndDestroy(popAndDestroyCount); // RCookieManager.Close(), InitAttributesForLongCookieLC(6),cookie,unicodeToAsciiLC,asciiToUnicodeLC(2)
 }
@@ -201,33 +199,34 @@
 {
     TRAP_IGNORE(addCookieL(aCookieData, aUrl, aPolicyBaseURL));
 }
+void CookieHandler::destroy()
+{
+  // frees all memory allocated ,
+  // including the objects whose
+  // pointers are contained by the array
+  m_getCookies.ResetAndDestroy();
 
+  if(m_cookieManager) {
+  m_cookieManager->Close();
+  delete m_cookieManager;
+  m_cookieManager = NULL;
+  }
+
+}
 //
 // Destructor.
 //
 CookieHandler::~CookieHandler()
-{
-    // frees all memory allocated ,
-    // including the objects whose
-    // pointers are contained by the array
-    m_getCookies.ResetAndDestroy();
-    
+    {
+    destroy();
     m_getCookies.Close();
-    if(m_cookieManager) {
-        m_cookieManager->Close();
-        delete m_cookieManager;
     }
-    
-    if(m_stringPool) {
-        m_stringPool->Close();
-        delete m_stringPool;
-    }
-}
 
 //
 // Constructor.
 //
-CookieHandler::CookieHandler()
+CookieHandler::CookieHandler(RStringPool aStringPool)
+  : m_stringPool(aStringPool)
 {}
 
 //
@@ -236,9 +235,7 @@
 //
 void CookieHandler::constructL( )
 {
-    m_stringPool = new (ELeave)RStringPool;
-    m_stringPool->OpenL();
-    m_cookieManager = new (ELeave) RCookieManager( *m_stringPool );
+    m_cookieManager = new (ELeave) RCookieManager( m_stringPool );
     User::LeaveIfError( m_cookieManager->Connect() );
 }
 
@@ -292,30 +289,30 @@
 {
     
     // Setting name attribute
-    aName = m_stringPool->OpenFStringL(unicodeToAsciiLC(aCookieRecord.m_name)->Des());
+    aName = m_stringPool.OpenFStringL(unicodeToAsciiLC(aCookieRecord.m_name)->Des());
     CleanupStack::PopAndDestroy(); //unicodeToAsciiLC
     CleanupClosePushL<RStringF>( aName);
     
     // Setting name attribute
-    aNameValue = m_stringPool->OpenFStringL(unicodeToAsciiLC(aCookieRecord.m_nameValue)->Des());
+    aNameValue = m_stringPool.OpenFStringL(unicodeToAsciiLC(aCookieRecord.m_nameValue)->Des());
     CleanupStack::PopAndDestroy(); //unicodeToAsciiLC
     CleanupClosePushL<RStringF>( aNameValue);
     
-    aExpires = m_stringPool->OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_expires)->Des());
+    aExpires = m_stringPool.OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_expires)->Des());
     CleanupStack::PopAndDestroy(); //unicodeToAsciiLC
     CleanupClosePushL<RStringF>( aExpires);
     // Setting Path attribute
-    aPath = m_stringPool->OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_pathName)->Des());
+    aPath = m_stringPool.OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_pathName)->Des());
     CleanupStack::PopAndDestroy(); //unicodeToAsciiLC
     CleanupClosePushL<RStringF>( aPath );
     
     // Setting Domain attribute
-    aDomain = m_stringPool->OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_domainName)->Des() );
+    aDomain = m_stringPool.OpenFStringL( unicodeToAsciiLC(aCookieRecord.m_domainName)->Des() );
     CleanupStack::PopAndDestroy(); //unicodeToAsciiLC
     CleanupClosePushL<RStringF>( aDomain );
     
     // Setting Domain attribute
-    aVersion = m_stringPool->OpenFStringL( _L8("1"));
+    aVersion = m_stringPool.OpenFStringL( _L8("1"));
     CleanupClosePushL<RStringF>( aVersion );
 }
 
--- a/webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/CookieHandler.h	Tue May 11 17:13:44 2010 +0300
@@ -21,6 +21,7 @@
 
 // System includes
 #include <e32base.h>
+#include <stringpool.h> 
 
 // CONSTANTS
 
@@ -33,7 +34,7 @@
 // FUNCTION PROTOTYPES
 
 // FORWARD DECLARATIONS
-class RStringPool;
+//class RStringPool;
 class CCookie;
 class RStringF;
 class RCookieManager;
@@ -67,7 +68,7 @@
         * Creates a new object.
         * @return The constructed session.
         */
-        static CookieHandler* init();
+        static CookieHandler* init(RStringPool aStringPool);
 
         /**
         * adds cookie ,
@@ -87,12 +88,13 @@
         * Destructor.
         */
         virtual ~CookieHandler();
+        void destroy();
 
     private :    // constructors
         /**
         * Constructor.
         */
-        CookieHandler( );
+        CookieHandler( RStringPool aStringPool);
 
         /**
         * ConstructL.
@@ -161,8 +163,9 @@
         */
         void parseCookieFieldsL( const TPtrC& aCookieString,
                                  CookieRecord& aCookieRecord) const;
+                                 
     private :    // data members
-        RStringPool* m_stringPool ;// <<has
+        RStringPool m_stringPool ;// <<has
         RPointerArray<CCookie> m_getCookies;// <<has
         RCookieManager* m_cookieManager; // NOTE: should not use pointers to r-class, but RCookieManager
                     // class doesn't provide a default constructor, too bad :(
--- a/webengine/osswebengine/WebCore/platform/network/symbian/HttpConnection.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/HttpConnection.cpp	Tue May 11 17:13:44 2010 +0300
@@ -204,6 +204,9 @@
 void HttpConnection::submitL()
 {
     __ASSERT_DEBUG( !m_transaction, THttpConnUtils::PanicLoader( KErrArgument ) );
+    TBool retryFlag = StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->getRetryConnectivityFlag();
+    if( retryFlag )
+        return;
 
     HttpSessionManager* httpSessionMgr = StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager();
     User::LeaveIfNull(httpSessionMgr);
@@ -726,7 +729,9 @@
         default:
             {
             // error handling
-            if(aEvent.iStatus == KErrNotReady || aEvent.iStatus == KErrDisconnected   )
+            //KErrDisconnected should be coming only for OCC
+            //MHFRunL gets call before connection manager
+            if(aEvent.iStatus == KErrDisconnected)
                 StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->setRetryConnectivityFlag();                 
             else
                 handleError(aEvent.iStatus);               
@@ -787,11 +792,10 @@
 
 void HttpConnection::complete(int error)
 {
-    TBool retryFlag = StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->getRetryConnectivityFlag();
+    HttpSessionManager* httpSessionManager = StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager();
+    TBool retryFlag = httpSessionManager->getRetryConnectivityFlag();
     if( retryFlag )
         {
-        m_transaction->Cancel();
-        //m_cancelled = false; //for flash
         return;
         }
     
@@ -850,6 +854,7 @@
         m_transaction->Close();
         delete m_transaction;
         m_transaction = NULL;
+        httpSessionManager->removeRequest(this);
     }
     if (error) {
         CResourceHandleManager::self()->receivedFinished(m_handle, error, this);
@@ -1202,57 +1207,60 @@
 
     if(uriParser.Parse( m_transaction->Request().URI().UriDes() ) == KErrNone)
         {
-        if (uriParser.IsPresent(EUriHost) && uriParser.IsPresent(EUriScheme)) // looking only for absolue Url path and schemes other than http(s)
+        if (uriParser.IsPresent(EUriScheme)) // looking only for absolue Url path and schemes other than http(s)
             {
             const TDesC8& scheme = uriParser.Extract(EUriScheme);
-            if (scheme.FindF(_L8("http")) == KErrNotFound) // everything but http(s)
+            if(uriParser.IsPresent(EUriHost) || scheme.FindF(_L8("tel")) == KErrNone)
                 {
-                TPtrC8 ptr(uriParser.UriDes());
-                // these arrays are pushed into CleanupStack in case leave
-                // if no leave, they will be freed below
-                RArray<TUint>* typeArray = new (ELeave) RArray<TUint>(1);
-                CleanupStack::PushL(typeArray);
-
-                CDesCArrayFlat* desArray = new (ELeave) CDesCArrayFlat(1);
-                CleanupStack::PushL(desArray);
+                if (scheme.FindF(_L8("http")) == KErrNotFound) // everything but http(s)
+                    {
+                    TPtrC8 ptr(uriParser.UriDes());
+                    // these arrays are pushed into CleanupStack in case leave
+                    // if no leave, they will be freed below
+                    RArray<TUint>* typeArray = new (ELeave) RArray<TUint>(1);
+                    CleanupStack::PushL(typeArray);
 
-                User::LeaveIfError(typeArray->Append(EParamRequestUrl));
+                    CDesCArrayFlat* desArray = new (ELeave) CDesCArrayFlat(1);
+                    CleanupStack::PushL(desArray);
+
+                    User::LeaveIfError(typeArray->Append(EParamRequestUrl));
 
-                HBufC16* urlbuf = HBufC16::NewLC( ptr.Length()  + 1); // +1 for zero terminate
-                urlbuf->Des().Copy( ptr );
-                TPtr16 bufDes16 = urlbuf->Des();
-                bufDes16.ZeroTerminate();
+                    HBufC16* urlbuf = HBufC16::NewLC( ptr.Length()  + 1); // +1 for zero terminate
+                    urlbuf->Des().Copy( ptr );
+                    TPtr16 bufDes16 = urlbuf->Des();
+                    bufDes16.ZeroTerminate();
 
-                desArray->AppendL(bufDes16);
-                CleanupStack::Pop();
+                    desArray->AppendL(bufDes16);
+                    CleanupStack::Pop();
 
-                MBrCtlSpecialLoadObserver* loadObserver = control(m_frame)->brCtlSpecialLoadObserver();
+                    MBrCtlSpecialLoadObserver* loadObserver = control(m_frame)->brCtlSpecialLoadObserver();
 
-                if (loadObserver)
-                    {
-                    TRAP_IGNORE(loadObserver->HandleRequestL(typeArray, desArray));
-                    }
+                    if (loadObserver)
+                        {
+                        TRAP_IGNORE(loadObserver->HandleRequestL(typeArray, desArray));
+                        }
 
-                // No leave, so pop here and clean up
-                CleanupStack::Pop(desArray);
-                CleanupStack::Pop(typeArray);
+                    // No leave, so pop here and clean up
+                    CleanupStack::Pop(desArray);
+                    CleanupStack::Pop(typeArray);
 
-                // cleanup arrays
-                if (typeArray)
-                    {
-                    // Closes the array and frees all memory allocated to the array
-                    typeArray->Close();
-                    delete typeArray;
-                    }
+                    // cleanup arrays
+                    if (typeArray)
+                        {
+                        // Closes the array and frees all memory allocated to the array
+                        typeArray->Close();
+                        delete typeArray;
+                        }
 
-                if (desArray)
-                    {
-                    // Deletes all descriptors from the array and frees the memory allocated to the array buffer
-                    desArray->Reset();
-                    delete desArray;
+                    if (desArray)
+                        {
+                        // Deletes all descriptors from the array and frees the memory allocated to the array buffer
+                        desArray->Reset();
+                        delete desArray;
+                        }
+
+                    return KErrCancel;
                     }
-
-                return KErrCancel;
                 }
             }
         }
@@ -1269,6 +1277,7 @@
     m_transaction->PropertySet().RemoveProperty(session.StringPool().StringF(HttpFilterCommonStringsExt::ESelfPtr,
         HttpFilterCommonStringsExt::GetTable()));
     m_transaction = NULL;
+    m_isDone = true;
     return trans;
 }
 
--- a/webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.cpp	Tue May 11 17:13:44 2010 +0300
@@ -60,7 +60,6 @@
     m_SelfDownloadContentHandler = NULL;
     m_SelfDownloadContentTypes = KNullStr().Alloc();
     retryConnectivityFlag = EFalse;
-    m_inSecConnection = EFalse;
 }
 
 HttpSessionManager::~HttpSessionManager()
@@ -70,6 +69,7 @@
     delete m_ReqHdrManager;
     m_ReqHdrManager = NULL;
     delete m_cookieHandler;
+    m_cookieHandler = NULL;
     delete m_httpDownload;
     m_httpDownload = NULL;
     delete m_SelfDownloadContentHandler;
@@ -142,7 +142,7 @@
             m_ReqHdrManager = HttpRequestHeaderManager::NewL(m_httpSession);
         }
         if (!m_cookieHandler) {
-            m_cookieHandler = CookieHandler::init();
+            m_cookieHandler = CookieHandler::init(m_httpSession.StringPool());
         }
     }
     updateFilters(true);
@@ -175,6 +175,9 @@
         // disconnect the Dl Mgr
         if (m_httpDownload){
             m_httpDownload->disconnect();
+        if(m_cookieHandler)
+            m_cookieHandler->destroy();
+   
 		}
         m_httpSession.Close();
         m_sessionRunning = false;
@@ -263,20 +266,25 @@
 {
     Vector<HttpConnection *> requests;
     
+    TBool newConn = ETrue;
+    m_httpSession.ConnectionInfo().SetPropertyL(m_httpSession.StringPool().StringF(HttpFilterCommonStringsExt::EHttpNewConnFlag, HttpFilterCommonStringsExt::GetTable()), THTTPHdrVal((TBool)newConn));
+ 
     for(HashMap<HttpConnection *, ResourceHandle *>::iterator tmpit = m_pendingHttpRequests.begin();
         tmpit != m_pendingHttpRequests.end(); ++tmpit)
         {
-        	ResourceHandle *tmp = tmpit->second;
-        	ResourceHandleClient* client = tmp->client();
-            if(!client->isLoadingPlugins())
                 requests.append(tmpit->first);  
         }
     //Submit them again
     for (int i=0; i<requests.size(); ++i)
         {
+        if(requests[i]->HttpTransaction()) {
              requests[i]->HttpTransaction()->SubmitL();
         }
-
+        else {
+             removeRequest(requests[i]);
+        }
+                 
+        }
 }
 
 HttpConnection* HttpSessionManager::firstHttpConnection()
@@ -483,4 +491,20 @@
     }
 }
 
+void HttpSessionManager::cancelQueuedTransactions()
+{
+    Vector<HttpConnection *> requests;
+    for(HashMap<HttpConnection *, ResourceHandle *>::iterator tmpit = m_pendingHttpRequests.begin();
+        tmpit != m_pendingHttpRequests.end(); ++tmpit)
+        {
+                requests.append(tmpit->first);  
+        }
+    
+    for (int i = 0; i < requests.size(); ++i) {
+        if(requests[i]->HttpTransaction()) {
+            requests[i]->HttpTransaction()->Cancel();
+        }
+    }
+}
+
 // end of file
--- a/webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/HttpSessionManager.h	Tue May 11 17:13:44 2010 +0300
@@ -102,6 +102,7 @@
     TUint pendingTransactionsCount(){ return m_pendingHttpRequests.size(); }
     TBool isInSecureConnection() {return m_inSecConnection;}
     void setInSecureConnection(TBool inSecCon) {m_inSecConnection = inSecCon;}    
+    void cancelQueuedTransactions();
 
 private:
     void updateFilters(bool initializing = false);
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.cpp	Tue May 11 17:13:44 2010 +0300
@@ -100,7 +100,7 @@
 // -----------------------------------------------------------------------------
 // OpenL
 // -----------------------------------------------------------------------------
-void CAnimationDecoder::OpenL( const TDesC8& aData, TDesC* aMIMEType, TBool aIsComplete )
+void CAnimationDecoder::OpenL( WebCore::SharedBuffer* aData, TDesC* aMIMEType, TBool aIsComplete )
 {
     if (!iWrapped) {
         return;
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoder.h	Tue May 11 17:13:44 2010 +0300
@@ -39,6 +39,10 @@
 // INCLUDES
 #include "AnimationDecoderWrapped.h"
 
+namespace WebCore {
+	class SharedBuffer;
+}
+
 // CLASS DECLARATION
 /**
 *  CAnimationDecoder
@@ -74,7 +78,7 @@
         /*
         * From MIHLFileImage, see base class header.
         */
-        void OpenL( const TDesC8& aData, TDesC* aMIMEType, TBool aIsComplete );
+        void OpenL( WebCore::SharedBuffer* aData, TDesC* aMIMEType, TBool aIsComplete );
 
         /*
         * From MIHLFileImage, see base class header.
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.cpp	Tue May 11 17:13:44 2010 +0300
@@ -51,11 +51,10 @@
 #include "SyncDecodeThread.h"
 #include <Oma2Agent.h>
 #include <Browser_Platform_Variant.hrh>
+#include "SharedBuffer.h"
+
 using namespace ContentAccess;
 
-namespace TBidirectionalState {
-    class TRunInfo;
-};
 
 #include <eikenv.h>
 
@@ -242,24 +241,25 @@
 // -----------------------------------------------------------------------------
 // OpenL
 // -----------------------------------------------------------------------------
-void CAnimationDecoderWrapped::OpenL( const TDesC8& aData, TDesC* aMIMEType, TBool aIsComplete )
+void CAnimationDecoderWrapped::OpenL( SharedBuffer* aData, TDesC* aMIMEType, TBool aIsComplete )
 {
     iCanBeDeleted = EFalse;
     if(!iObserver) {
-        OpenAndDecodeSyncL(aData);
+        TPtrC8 ptr( (const TUint8*)aData->data(), aData->size() );
+        OpenAndDecodeSyncL(ptr);
         iCanBeDeleted = ETrue;
         if (iIsInvalid)
             delete this;
         return;
     }
-        
+    m_data = aData;
+    m_dataptr.Set((const TUint8*)aData->data(), aData->size());   
     
     delete iDestination;
     iDestination = NULL;
     iDestination = CMaskedBitmap::NewL();
 
     HBufC8* mime = 0;
-    TPtrC8 buffer(aData.Ptr(),aData.Length());
     if (aMIMEType) {
         // it is safer to ignore the server supplied mime type and just recognize
         // the image type from the data headers. this does not work for all formats though
@@ -270,31 +270,23 @@
         }
         if( *aMIMEType==KMimeDRM )
         {
-        iDrmContent = DecodeDRMImageContentL(aData);
+        iDrmContent = DecodeDRMImageContentL(m_dataptr);
         
         TInt drmContentLength = iDrmContent->Des().Length();
-        buffer.Set( (const TUint8*)iDrmContent->Des().Ptr(), drmContentLength);
+        m_dataptr.Set( (const TUint8*)iDrmContent->Des().Ptr(), drmContentLength);
         }
     }
-         
-    if( !iDecoder )
-        iDecoder = CBufferedImageDecoder::NewL(CEikonEnv::Static()->FsSession());
-
-    if (mime){
-        if (iDecoder) {
-            iDecoder->OpenL(buffer,*mime,CImageDecoder::EOptionNone);
-            CleanupStack::PopAndDestroy(); // mime
-        }
-    }
-    else {
-        if (iDecoder) {
-            iDecoder->OpenL(buffer,CImageDecoder::EOptionNone);
-        }
-    }
+    delete iDecoder;
+    iDecoder = NULL;
+    
+    if(mime) 
+       iDecoder = CImageDecoder::DataNewL(CEikonEnv::Static()->FsSession(), m_dataptr, *mime);
+    else 
+       iDecoder = CImageDecoder::DataNewL(CEikonEnv::Static()->FsSession(), m_dataptr);
 
     iRawDataComplete = aIsComplete;
 
-    if(iDecoder && iDecoder->ValidDecoder()  && iDecoder->IsImageHeaderProcessingComplete()) {
+    if(iDecoder && iDecoder->IsImageHeaderProcessingComplete()) {
         StartDecodingL();
     }
     else {
@@ -310,7 +302,7 @@
         // first see if have a netscape 2.0 extension header 
         const TUint8 extString[] = { 'N', 'E', 'T', 'S', 'C', 'A', 'P','E','2','.','0','\3','\1' };
         const TInt sizeofextString = sizeof(extString);
-        TPtrC8 rawDataPtr((TUint8*)aData.Ptr(), aData.Length());
+        TPtrC8 rawDataPtr((TUint8*)m_dataptr.Ptr(), m_dataptr.Length());
         TInt offset = rawDataPtr.Find(extString, sizeofextString);
         if(offset != KErrNotFound) {
             // found a header, get the loop count -
@@ -331,44 +323,16 @@
         }
         iCurLoopCount = iLoopCount;
     }
+    if(mime)
+        {
+        CleanupStack::PopAndDestroy(mime);
+        }
     iCanBeDeleted = ETrue;
     if (iIsInvalid)
         delete this;
 }
 
 // -----------------------------------------------------------------------------
-// CAnimationDecoderWrapped::AddDataL
-// New chunk of raw data
-//
-// -----------------------------------------------------------------------------
-//
-void CAnimationDecoderWrapped::AddDataL(
-    const TDesC8& aNextChunk,
-    TBool aIsComplete )
-{
-    iRawDataComplete = aIsComplete;
-
-    if( iDecoder ) {
-        iDecoder->AppendDataL(aNextChunk);
-        if( iDecoder->ValidDecoder() ) {
-            //  if the image conversion is busy , then just appending the
-            // data should be sufficient
-            if(iStatus == KRequestPending) {
-                // more image data
-                iDecoder->ContinueConvert( &iStatus );
-                SetActive();
-            }
-        }
-        else {
-            iDecoder->ContinueOpenL() ;
-            if(iDecoder->ValidDecoder()  && iDecoder->IsImageHeaderProcessingComplete()){
-                StartDecodingL();
-            }
-        }
-    }
-}
-
-// -----------------------------------------------------------------------------
 // CImageLoader::StartDecodingL
 //
 // -----------------------------------------------------------------------------
@@ -384,7 +348,6 @@
         // we only support gray2 and gray256 tiling
         TDisplayMode maskmode = ( (iFrameInfo.iFlags & TFrameInfo::EAlphaChannel) && (iFrameInfo.iFlags & TFrameInfo::ECanDither)) ? EGray256 : EGray2;
         TInt error = iDestination->Create( iFrameInfo.iOverallSizeInPixels, DisplayMode(), maskmode );
-
         if (!error)
             LoadFrame(0);
         else
@@ -578,8 +541,7 @@
     CFbsBitmap& animMask = iAnimationBitmap->MaskModifyable();
 
     TFrameInfo frameInfo( iDecoder->FrameInfo( aFrameIndex ) );
-    User::LeaveIfError( animBitmap.Create(
-    frameInfo.iOverallSizeInPixels, EColor16M ) );
+    User::LeaveIfError(animBitmap.Create(frameInfo.iOverallSizeInPixels, DisplayMode()));
 
     TDisplayMode maskDisplayMode( ENone );
 
@@ -588,7 +550,7 @@
             maskDisplayMode = EGray256;
         maskDisplayMode = EGray2;
 
-        User::LeaveIfError( animMask.Create( frameInfo.iOverallSizeInPixels, maskDisplayMode ) );
+        User::LeaveIfError(animMask.Create(frameInfo.iOverallSizeInPixels, maskDisplayMode));
         iDecoder->Convert( &iStatus, animBitmap, animMask, aFrameIndex );
     }
     else
@@ -639,6 +601,7 @@
         iImageState = EInactive;
         iObserver->imageReady(sizeinBytes);
         delete iDecoder, iDecoder = NULL;
+        m_data = NULL;
     }
 }
 
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Tue May 11 17:13:44 2010 +0300
@@ -48,8 +48,11 @@
 
 // INCLUDES
 
+#include <../bidi.h>
+#include "config.h"
 #include <e32base.h>
 #include <imageconversion.h> // TFrameInfo
+#include <RefPtr.h>
 
 // FORWARD DECLARATIONS
 class CMaskedBitmap;
@@ -57,8 +60,8 @@
 class CSynDecodeThread;
 namespace WebCore {
     class ImageObserver;
-}
-// CONSTANTS
+    class SharedBuffer;
+};
 
 _LIT(KMimeJPEG, "image/jpeg");
 _LIT(KMimeJPG, "image/jpg");
@@ -106,24 +109,19 @@
         /*
         * From MIHLFileImage, see base class header.
         */
-        void OpenL( const TDesC8& aData, TDesC* aMIMEType, TBool aIsComplete );
+        void OpenL( WebCore::SharedBuffer* aData, TDesC* aMIMEType, TBool aIsComplete );
         void OpenAndDecodeSyncL( const TDesC8& aData );
 
         /*
         * From MIHLFileImage, see base class header.
         */
-        void AddDataL( const TDesC8& aData, TBool aIsComplete );
-
-        /*
-        * From MIHLFileImage, see base class header.
-        */
         TSize Size() const { return iFrameInfo.iOverallSizeInPixels; }
 
         /*
         * From MIHLFileImage, see base class header.
         */
-        TDisplayMode DisplayMode() const { return KMaxDepth; }
-
+		TDisplayMode DisplayMode() const { 	return KMaxDepth;}
+		
         /*
         * From MIHLFileImage, see base class header.
         */
@@ -225,13 +223,14 @@
             };
 
   private: // Data
-
+        RefPtr<WebCore::SharedBuffer>  m_data;
+        TPtrC8  m_dataptr;
         // Image status & state
         TRequestStatus* iImageStatus;
         TImageState iImageState;
 
         // Own: Image decoder
-        CBufferedImageDecoder* iDecoder; // owned
+        CImageDecoder* iDecoder; // owned
 
         TFrameInfo iFrameInfo;
         TBool iAnimation;
--- a/webengine/osswebengine/WebCore/rendering/RenderPartObject.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebCore/rendering/RenderPartObject.cpp	Tue May 11 17:13:44 2010 +0300
@@ -210,7 +210,7 @@
           mapClassIdToServiceType(o->m_classId, serviceType);
 #if PLATFORM(SYMBIAN) 
       //If there is no Type and Classid then return.
-      else if (serviceType.isEmpty() && o->m_classId.isEmpty())
+      else if (serviceType.isEmpty() && o->m_classId.isEmpty() && !embed)
           return;
 #endif
       
--- a/webengine/osswebengine/WebKit/s60/misc/WebTabbedNavigation.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/misc/WebTabbedNavigation.cpp	Tue May 11 17:13:44 2010 +0300
@@ -243,7 +243,7 @@
         m_selectedElementRect = selectedRect;
         m_focusPosition = selectedPoint;
         m_node = selectedNode;
-        m_webView->page()->focusController()->setFocusedNode(selectedNode, selectedNode->document()->frame());
+        selectedNode->document()->setFocusedNode(selectedNode);
         m_webView->page()->focusController()->setFocusedFrame(selectedNode->document()->frame());
         
         // And scroll to the selected element
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Tue May 11 17:13:44 2010 +0300
@@ -164,7 +164,8 @@
       m_pluginfuncs(0),
       m_resized(false),
       m_oldRect(TRect(0,0,0,0)),
-      m_oldViewport(TRect(0,0,0,0))
+      m_oldViewport(TRect(0,0,0,0)),
+      m_loadmode(ELoadModeNone)
   {
   }
 
@@ -835,7 +836,8 @@
 int PluginSkin::getRequestL(const TDesC8& url, bool notify, void* notifydata,const TDesC* aWindowType)
 {
     TPluginLoadMode loadmode = GetLoadMode(aWindowType);
-
+    setLoadMode(loadmode);
+    
     if (url.Ptr() == NULL ) {                        
         return KErrArgument;
     }
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Tue May 11 17:13:44 2010 +0300
@@ -417,7 +417,8 @@
         void reCreatePlugin();
         TInt activeStreams() { return m_streams.size(); }
         void PlayPauseNotify(bool pause);
-
+        TPluginLoadMode getLoadMode(){return m_loadmode;}
+        void setLoadMode(TPluginLoadMode mode){m_loadmode = mode;}
   public:  // from MMemoryCollector
         TUint Collect(unsigned int aRequired);
         void Restore()                          {}
@@ -478,8 +479,8 @@
         RArray<NPN_GenericElement>*  iGenericElementArray;
         TRect   m_oldRect;
         TRect    m_oldViewport;
+        TPluginLoadMode m_loadmode;
         
-
 public:
         TInt m_handle;
         NPP m_instance;    
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Tue May 11 17:13:44 2010 +0300
@@ -376,6 +376,14 @@
     {
         CCoeControl::MakeVisible(visible);
     }
+    TPluginLoadMode loadmode = m_pluginskin->getLoadMode();
+    if(loadmode == ELoadModeNew ){
+        m_pluginskin->setLoadMode(ELoadModeNone);
+        if(visible)
+            HandleGainingForeground();
+        else
+            HandleLosingForeground();
+    }
     NotifyPluginVisible(visible);
     if (!m_windowedPlugin && m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->event) {
         NPEvent event;
--- a/webengine/osswebengine/WebKit/s60/webcoresupport/WebFrameLoaderClient.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webcoresupport/WebFrameLoaderClient.cpp	Tue May 11 17:13:44 2010 +0300
@@ -161,6 +161,7 @@
             core(m_webFrame)->loader()->isLoadingMainFrame() &&
             FrameLoadTypeStandard == core(m_webFrame)->loader()->loadType()){
             m_webFrame->frameView()->topView()->resetZoomLevel();
+            m_webFrame->frameView()->topView()->resetJsTimers();
         }
 
         if (!core(m_webFrame)->ownerElement()) {
--- a/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Tue May 11 17:13:44 2010 +0300
@@ -420,6 +420,7 @@
    , m_wmlEngineInterface(NULL)
    , m_brCtlDownloadObserver(aBrCtlDownloadObserver)
    , m_windoCloseTimer(NULL)
+   , m_didFirstLayout(false)
 {
     m_documentHeight = 0;
     m_displayHeight = 0;
@@ -594,12 +595,15 @@
                 m_webView->formFillPopup()->handleCommandL(TBrCtlDefs::ECommandCancel);            
             break;
         case TBrCtlDefs::EEventNewContentDisplayed:
-            if(m_brCtlLayoutObserver && m_webView)
+            if(m_brCtlLayoutObserver && m_webView && !m_didFirstLayout)  {
                 m_brCtlLayoutObserver->NotifyLayoutChange( (webView()->mainFrame()->bridge()->m_rtl ? EOriginTopRight : EOriginTopLeft));
+                m_didFirstLayout = true;
+            }
             break;
         case TBrCtlDefs::EEventContentFinished:
         case TBrCtlDefs::EEventUploadFinished:
             m_pageLoadFinished = true;
+            m_didFirstLayout= false;
             if (m_suspendTimers) {
                 m_suspendTimers = false;
                 setDeferringTimers(true);
@@ -664,6 +668,7 @@
                     if (coreFrame)
                         coreFrame->eventHandler()->deactivatedEvent();
                 }
+                m_webView->setEditable(EFalse);
                 break;
             }
         case TBrCtlDefs::ECommandCancelFetch:
@@ -777,7 +782,7 @@
                     setDeferringTimers(false);
                 m_suspendTimers = false;
 #endif
-
+                m_webView->resumeJsTimers();
                 break;
             }
         case TBrCtlDefs::ECommandAppBackground:
@@ -801,6 +806,7 @@
 
                 //Disable the zooming bar when it goes to background
                 m_webView->hideZoomSliderL();
+                m_webView->pauseJsTimers();
                 break;
             }
         case TBrCtlDefs::ECommandClearAutoFormFillData:
@@ -956,6 +962,7 @@
 
        case TBrCtlDefs::ECommandEnterFullscreenBrowsing:
             {
+             m_webView->resumeJsTimers();
              m_webView->EnterFullscreenBrowsingL();
              break;
             }
@@ -1005,7 +1012,24 @@
                }
            break;
            }
-       
+       case TBrCtlDefs::ECommandLoseFocus:
+       case TBrCtlDefs::ECommandPauseScriptTimers:
+           {
+           m_webView->pauseJsTimers();
+           break;
+           }
+           
+       case TBrCtlDefs::ECommandGainFocus:
+       case TBrCtlDefs::ECommandResumeScriptTimers:
+           {
+           m_webView->resumeJsTimers();
+           break;
+           }
+       case TBrCtlDefs::ECommandCancelQueuedTransactions:
+           {
+           StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->cancelQueuedTransactions();
+		   break;
+           }		   
       default:
             {
             if ( m_wmlEngineInterface &&
@@ -1717,6 +1741,9 @@
         User::Leave(KErrArgument);
     // convert to 8
 
+    // reset timers ptr, if paused from last page
+    m_webView->resetJsTimers();
+        
     _LIT(KJs, "javascript:");
     if (url.Length() > KJs().Length()) {
         if (url.Left(KJs().Length()).FindF(KJs) == 0) {
@@ -2531,3 +2558,4 @@
 
 
 
+
--- a/webengine/osswebengine/WebKit/s60/webview/BrCtl.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/BrCtl.h	Tue May 11 17:13:44 2010 +0300
@@ -727,7 +727,8 @@
         TBrCtlWmlServiceOption*                 m_firstPrevDoElement;
         MBrCtlDownloadObserver*                 m_brCtlDownloadObserver;
         CPeriodic* m_windoCloseTimer;       //new timer for managing browser window close
-
+        bool m_didFirstLayout;
+        
 };
 
 #endif      // BRCTL_H
--- a/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Tue May 11 17:13:44 2010 +0300
@@ -351,7 +351,7 @@
 // -----------------------------------------------------------------------------
 void CWebFepTextEditor::CancelFepInlineEdit()
 {
-    if (IsTextAreaFocused()) {
+    if (IsTextAreaFocused()||IsInputElementFocused()) {
         if (m_inlineEditText && DocumentLengthForFep() < DocumentMaximumLengthForFep()) {
             HBufC* tempBuf = HBufC::NewLC(DocumentLengthForFep());
             TPtr ptr(tempBuf->Des());
--- a/webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp	Tue May 11 17:13:44 2010 +0300
@@ -508,10 +508,27 @@
 
 void WebFrame::makeVisiblePlugins(TBool visible)
 {    
-    PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler();
-    WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
-    for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it ) {
-        static_cast<PluginSkin*> (*it)->makeVisible(visible);
+    MWebCoreObjectWidget* view = NULL;  
+    Frame* coreFrame = core(this); 
+    PluginSkin* plg = 0; 
+    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 
+    
+        PassRefPtr<HTMLCollection> objects = frame->document()->objects();      
+        for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { 
+            view = widget(n);  
+            if (view) { 
+                plg = static_cast<PluginSkin*>(view); 
+                plg->makeVisible(visible);
+            } 
+        } 
+        PassRefPtr<HTMLCollection> embeds = frame->document()->embeds();        
+        for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { 
+            view = widget(n); 
+            if (view) { 
+                plg = static_cast<PluginSkin*>(view); 
+                plg->makeVisible(visible);
+            } 
+        }
     }
 }
 
@@ -577,12 +594,29 @@
 
 void WebFrame::reCreatePlugins()
 {
-    PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler();
-    WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
-    for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it ) {
-        PluginSkin* plg = static_cast<PluginSkin*> (*it); //->PlayPauseNotify(pause);
-        if(plg->activeStreams() > 0)
-           plg->reCreatePlugin();
+    MWebCoreObjectWidget* view = NULL;  
+    Frame* coreFrame = core(this); 
+    PluginSkin* plg = 0; 
+    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 
+   
+        PassRefPtr<HTMLCollection> objects = frame->document()->objects();      
+        for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { 
+            view = widget(n);  
+            if (view) { 
+                plg = static_cast<PluginSkin*>(view); 
+                if (plg->activeStreams() > 0)
+                    plg->reCreatePlugin(); 
+            } 
+        } 
+        PassRefPtr<HTMLCollection> embeds = frame->document()->embeds();        
+        for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { 
+            view = widget(n); 
+            if (view) { 
+                plg = static_cast<PluginSkin*>(view); 
+                if (plg->activeStreams() > 0)
+                    plg->reCreatePlugin(); 
+            } 
+        }
     }
 }
 
--- a/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp	Tue May 11 17:13:44 2010 +0300
@@ -126,8 +126,8 @@
 //
 void WebPageScrollHandler::constructL()
     {
-        m_scrollTimer = CPeriodic::NewL(CActive::EPriorityUserInput - 1);
-        m_pageOverviewScrollPeriodic = CPeriodic::NewL(CActive::EPriorityUserInput - 1);
+        m_scrollTimer = CPeriodic::NewL(CActive::EPriorityUserInput);
+        m_pageOverviewScrollPeriodic = CPeriodic::NewL(CActive::EPriorityUserInput);
         m_lastPosition = TPoint(0, 0);
         m_scrollbarDrawer = WebScrollbarDrawer::NewL();
         if(AknLayoutUtils::PenEnabled()) {
--- a/webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp	Tue May 11 17:13:44 2010 +0300
@@ -164,12 +164,16 @@
         {
             m_ignoreTap = false;
             handleTouchUp(aGesture);
-            m_webview->setScrolling(false);
+			m_webview->resumeJsTimers(); // resume js timers
             break;
         }
 
         case stmGesture::EGestureUidPan:
         {
+            // pause js timers (if not already done)
+            if(!m_webview->jsTimersPaused()) 
+                m_webview->pauseJsTimers();
+
             if(!m_webview->isScrolling())
                 m_webview->setScrolling(true);
             handleMove(aGesture);
@@ -193,6 +197,9 @@
         if(!m_webview->inPageViewMode())
             {
             handlePinchZoomL(aGesture);
+            if(aGesture.GestureState() != EGestureEnter) {
+                m_webview->resumeJsTimers(); // resume js timers
+                }
             }
             break;
         }
@@ -328,6 +335,10 @@
         }
     }
     
+    // pause JS timers for better ui response    
+    if (aPointerEvent.iType == TPointerEvent::EButton1Down) {
+        m_webview->pauseJsTimers();    
+    }
 #ifdef BRDO_USE_GESTURE_HELPER
       m_gestureInterface->HandlePointerEventL(aPointerEvent);
 #endif
--- a/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Tue May 11 17:13:44 2010 +0300
@@ -109,6 +109,7 @@
     m_decelelatorSwitch = false;
     if (m_decelTimer->IsActive()) {
         m_webView.setScrolling(false);
+		m_webView.resumeJsTimers();		
         m_decelTimer->Cancel();
     }
 }
@@ -137,11 +138,13 @@
     m_numscrollsteps = 0;
     if (m_decelTimer->IsActive()) {
         m_webView.setScrolling(false);
+    	m_webView.resumeJsTimers();
         m_decelTimer->Cancel();
     }
     
     WebFrameView* scrollingView = m_webView.pageScrollHandler()->currentScrollingFrameView();
     if (scrollingView) {
+        m_webView.pauseJsTimers(); // pause the JS timers
         m_webView.setScrolling(true);
         m_startPos = scrollingView->contentPos();
         m_lastPos = m_startPos;
@@ -193,6 +196,8 @@
         if (m_scrollbarDrawer) {
             m_scrollbarDrawer->fadeScrollbar();
         }
+		
+        m_webView.resumeJsTimers(); // resume the js timers
         m_webView.setScrolling(false);
         m_decelTimer->Cancel();
         handler->clearScrollingElement();
--- a/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Tue May 11 17:13:44 2010 +0300
@@ -100,6 +100,7 @@
 #include "EventNames.h"
 #include "Editor.h"
 #include "ThumbnailGenerator.h"
+#include <kjs_window.h>
 
 using namespace WebCore;
 using namespace EventNames;
@@ -217,6 +218,7 @@
 , m_checkerBoardGc(NULL)
 , m_checkerBoardDestroyTimer(NULL)
 , m_isPinchZoomOut(false)
+, m_jsTimeouts(0)
 {
 }
 
@@ -274,6 +276,9 @@
     destroyCheckerBoard();
     delete m_checkerBoardDestroyTimer;
     
+    if (StaticObjectsContainer::instance()->webSurface()->topView() == this) 
+        StaticObjectsContainer::instance()->webSurface()->setView( NULL ); 
+    
 }
 
 // -----------------------------------------------------------------------------
@@ -355,14 +360,15 @@
         m_pageScalerEnabled = false;
     }
     else  {
-        if(m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalPage)
+        if((m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalHistory)
+        	&& !(m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalPage))
+            {
+            m_thumbnailGenerator = CThumbnailGenerator::NewL(*this);          
+            }
+        else 
             {
             initializePageScalerL();
             m_pageScalerEnabled = true;
-            }
-        else if(m_brctl->capabilities() & TBrCtlDefs::ECapabilityGraphicalHistory)
-            {
-            m_thumbnailGenerator = CThumbnailGenerator::NewL(*this);
             }        
     }
     if (m_brctl->capabilities() & TBrCtlDefs::ECapabilityAutoFormFill) {
@@ -564,11 +570,12 @@
 
     if ( visible ) {
       clearOffScreenBitmap();
-      m_tabbedNavigation->initializeForPage();
+      if ( m_brctl && m_brctl->settings() && SettingsContainer::NavigationTypeTabbed == m_brctl->settings()->getNavigationType() ) {
+          m_tabbedNavigation->initializeForPage();
+      }
       syncRepaint( mainFrame()->frameView()->visibleRect() );
       TRAP_IGNORE( m_webfeptexteditor->EnableCcpuL() ); 
     }
-
 }
 
 
@@ -1916,6 +1923,9 @@
 
 void WebView::scrollBuffer(TPoint to, TPoint from, TBool usecopyscroll)
 {
+    if(!IsVisible())
+        return;
+    
     TRect rect(m_offscreenrect);
 
     TSize bufSize( rect.Size() );
@@ -2521,6 +2531,7 @@
     updateScrollbars(mainFrame()->frameView()->contentSize().iHeight, mainFrame()->frameView()->contentPos().iY,
         mainFrame()->frameView()->contentSize().iWidth, mainFrame()->frameView()->contentPos().iX);
 
+    m_allowRepaints = true;
     syncRepaint(view->visibleRect());
 
     int zoomLevel = m_brctl->historyHandler()->historyController()->currentEntryZoomLevel();
@@ -3250,4 +3261,27 @@
         }
     }
 
+void WebView::pauseJsTimers()
+{
+    if(m_jsTimeouts==0) {        
+        WebCore::Frame *frame = core(mainFrame());
+        KJS::Window* window = KJS::Window::retrieveWindow(frame);
+        if(window) {
+            m_jsTimeouts = window->pauseTimeouts();
+        }
+    }
+}
+
+void WebView::resumeJsTimers()
+{
+    if(m_jsTimeouts) {
+        WebCore::Frame *frame = core(mainFrame());
+        KJS::Window* window = KJS::Window::retrieveWindow(frame);
+        if(window) {
+            window->resumeTimeouts(m_jsTimeouts);
+            delete m_jsTimeouts;
+            m_jsTimeouts = 0;
+        }
+    }
+}
 // END OF FILE
--- a/webengine/osswebengine/WebKit/s60/webview/WebView.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebView.h	Tue May 11 17:13:44 2010 +0300
@@ -39,6 +39,11 @@
     class Frame;
 }
 
+namespace KJS
+{
+    class PausedTimeouts;
+}
+
 class CPluginHandler;
 class WebPreferences;
 class WebBackForwardList;
@@ -533,6 +538,12 @@
         void clearEventFired() { m_firedEvent = 0; }
         
         void wait(double t); 
+
+        // JavaScript timers - pause and resume
+        void pauseJsTimers();
+        void resumeJsTimers();
+        bool jsTimersPaused() { return (m_jsTimeouts) ? true : false; }
+        void resetJsTimers() { m_jsTimeouts = 0; }
     private:
         WebCore::Page*          m_page;
         WebFrameView*           m_frameView;
@@ -634,6 +645,9 @@
         CPeriodic               *m_checkerBoardDestroyTimer;
         
         TBool                    m_isPinchZoomOut;
+		
+   	    // JavaScript (DOMWindowTimer) timers
+        KJS::PausedTimeouts*     m_jsTimeouts;
     };
 
 #endif
--- a/webengine/osswebengine/WebKit/s60/webview/WidgetExtension.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WidgetExtension.cpp	Tue May 11 17:13:44 2010 +0300
@@ -209,8 +209,8 @@
 //From WidgetEngineCallbacks
 void CWidgetExtension::drawWidgetTransition()
 {
-    WebSurface* surface = WebCore::StaticObjectsContainer::instance()->webSurface();
-    if (surface) {
+    WebSurface* surface = WebCore::StaticObjectsContainer::instance()->webSurface();   
+    if (surface && surface->topView()) { 
         surface->topView()->DrawDeferred();
     }
 }
--- a/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp	Tue May 11 17:13:44 2010 +0300
@@ -216,11 +216,7 @@
     m_bitmapUpdateTimer->Cancel();
     m_webView->restoreZoomLevel(m_webView->scalingFactor());
     //update the plugin rect after pinch zoom exit
-    PluginSkin* pluginskin = m_webView->mainFrame()->focusedPlugin();
-    if(pluginskin)
-     {
-        pluginskin->setPluginWinClipedRect(); 
-     }
+    m_webView->mainFrame()->notifyPluginsOfPositionChange();
     m_webView->startCheckerBoardDestroyTimer();
 }
 
--- a/webengine/widgetregistry/tsrc/public/basic/group/WidgetRegistrySTIF.mmp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/widgetregistry/tsrc/public/basic/group/WidgetRegistrySTIF.mmp	Tue May 11 17:13:44 2010 +0300
@@ -1,39 +1,52 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+* ==============================================================================
+*  Name        : WidgetRegistrySTIF.mmp
+*  Part of     : WidgetRegistrySTIF
+*
+*  Description : STIF for WidgetRegistry
+*  Version:   1.0
 *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
+*  Copyright (C) 2007 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing,  adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
 *
-* Description:  STIF for WidgetRegistry
-*
+* ============================================================================
 */
 
-
 TARGET          WidgetRegistrySTIF.dll
 TARGETTYPE      dll
 UID             0x1000008D 0x101FB3E7
 
+ 
 #if defined(EKA2)
 CAPABILITY      ALL -TCB
 //VENDORID        VID_DEFAULT
-VENDORID        0
+//VENDORID        0
 #endif
 
 DEFFILE         WidgetRegistrySTIF.def
 
+
 SOURCEPATH      ../src
 SOURCE          WidgetRegistrySTIF.cpp
 
 USERINCLUDE     ../inc
 
-MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include
+SYSTEMINCLUDE   /epoc32/include/internal
+SYSTEMINCLUDE   /epoc32/include/domain/osextensions
+SYSTEMINCLUDE   /epoc32/include/domain/middleware
+
+#include <domain\osextensions\data_caging_paths.hrh>
+#include <domain\osextensions\platform_paths.hrh>
+
+EPOCALLOWDLLDATA 
 
 LIBRARY         euser.lib efsrv.lib favouritesengine.lib estor.lib
 LIBRARY         stiftestinterface.lib
--- a/webengine/widgetregistry/tsrc/public/basic/inc/WidgetRegistrySTIF.h	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/widgetregistry/tsrc/public/basic/inc/WidgetRegistrySTIF.h	Tue May 11 17:13:44 2010 +0300
@@ -1,27 +1,30 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+* ==============================================================================
+*  Name        : WidgetRegistrySTIF.h
+*  Part of     : WidgetRegistry
+*
+*  Description : Widget Registry test module.
+*  Version:   1.0
 *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
+*  Copyright (C) 2007 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing,  adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
 *
-* Description:  Widget Registry test module.
-*
+* ============================================================================
 */
 
 
-
 #ifndef WIDGETREGISTRYSTIF_H
 #define WIDGETREGISTRYSTIF_H
 
 // INCLUDES
-#include <widgetregistryclient.h>
+#include <WidgetRegistryClient.h>
 #include <StifTestModule.h>
 #include <StifLogger.h>
 #include <f32file.h>
@@ -255,6 +258,14 @@
         TInt ClientSessionGetLprojNameL( TTestResult& aResult );
         TInt ClientSessionSecurityPolicyId( TTestResult& aResult );
         
+        TInt ClientSessionIsWidgetInFullViewTest( TTestResult& aResult );
+        TInt ClientSessionIsWidgetInMiniViewTest( TTestResult& aResult );
+        TInt ClientSessionIsBlanketPermGrantedTest( TTestResult& aResult );
+        TInt ClientSessionSetMiniViewTestL( TTestResult& aResult );
+        TInt ClientSessionSetFullViewTestL( TTestResult& aResult );
+        TInt ClientSessionSetBlanketPermissionTestL( TTestResult& aResult );
+        TInt ClientSessionWidgetSapiAccessStateTest( TTestResult& aResult );
+        
     private: // Data
 		
 		TUid iValidUid;
--- a/webengine/widgetregistry/tsrc/public/basic/src/WidgetRegistrySTIF.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/webengine/widgetregistry/tsrc/public/basic/src/WidgetRegistrySTIF.cpp	Tue May 11 17:13:44 2010 +0300
@@ -1,21 +1,24 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+* ==============================================================================
+*  Name        : WidgetRegistrySTIF.cpp
+*  Part of     : STIF for WidgetRegistry
+*
+*  Description : CWidgetRegistrySTIF class member functions
+*  Version:   1.0
 *
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
+*  Copyright (C) 2007 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing,  adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
 *
-* Description:  CWidgetRegistrySTIF class member functions
-*
+* ============================================================================
 */
 
-
 // INCLUDE FILES
 #include <Stiftestinterface.h>
 #include "WidgetRegistrySTIF.h"
@@ -152,7 +155,9 @@
     RWidgetRegistryClientSession* registryClient;
     registryClient = new (ELeave) RWidgetRegistryClientSession;
     CleanupStack::PushL( registryClient );
-        TInt error = registryClient->Disconnect();
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        error = registryClient->Disconnect();
         if ( KErrNone == error )
             {
             aResult.SetResult( KErrNone, KPassed );
@@ -188,7 +193,12 @@
     RWidgetRegistryClientSession* registryClient2;
     registryClient2 = new (ELeave) RWidgetRegistryClientSession;
     CleanupStack::PushL( registryClient2 );
+    
+  
+            
+    
     TInt error = registryClient2->Connect();
+   
     if ( KErrNone == error )
         {
         aResult.SetResult( KErrNone, KPassed );
@@ -349,7 +359,19 @@
     TInt error = registryClient->Connect();
     if ( KErrNone == error )
         {
-        TBool b = registryClient->WidgetExistsL( KValidBundle );
+        //TBool b = registryClient->WidgetExistsL( KValidBundle );
+        RWidgetInfoArray widgetInfoArray;
+        error = registryClient->InstalledWidgetsL( widgetInfoArray );
+        CWidgetInfo *myInfo = widgetInfoArray[0];
+        //myInfo->iBundleName;
+        
+           TUid     ValidUid = myInfo->iUid;
+           HBufC*  iWidgetBundleId = HBufC::NewL(KWidgetRegistryVal);
+           TPtr widgetBundleId = iWidgetBundleId->Des();
+            
+        //HBufC BundleID( HBufC16::NewL(1024));
+        registryClient->GetWidgetBundleId( ValidUid , widgetBundleId );
+        TBool b = registryClient->WidgetExistsL( widgetBundleId );
         if ( b != EFalse )
             {
             aResult.SetResult( KErrNone, KPassed );
@@ -496,7 +518,20 @@
     TInt error = registryClient->Connect();
     if ( KErrNone == error )
         {
-        TInt uid = registryClient->GetWidgetUidL( KValidBundle );
+        RWidgetInfoArray widgetInfoArray;
+        error = registryClient->InstalledWidgetsL( widgetInfoArray );
+        CWidgetInfo *myInfo = widgetInfoArray[0];
+        //myInfo->iBundleName;
+    
+       TUid     ValidUid = myInfo->iUid;
+       HBufC*  iWidgetBundleId = HBufC::NewL(KWidgetRegistryVal);
+       TPtr widgetBundleId = iWidgetBundleId->Des();
+        
+      //HBufC BundleID( HBufC16::NewL(1024));
+       
+       registryClient->GetWidgetBundleId( ValidUid , widgetBundleId );
+        TInt uid = registryClient->GetWidgetUidL( widgetBundleId );
+        
         if ( iValidUid == TUid::Uid( uid ) )
             {
             aResult.SetResult( KErrNone, KPassed );
@@ -796,6 +831,232 @@
  }
 
 
+//Added as part of homescreen implementation testcases
+    
+//Method to verify IsWidgetInFullView API
+ TInt CWidgetRegistrySTIF::ClientSessionIsWidgetInFullViewTest( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+    
+    const TInt maxExponent = 32;
+    TAny* Cells[maxExponent];
+    TInt j=0;
+
+    for (TInt i = 0; i < maxExponent; i++)
+        Cells[i] = 0;
+        
+    
+    for (TInt i = KMaxTInt/2-1; i > 0; )
+    {
+        Cells[j] = User::Alloc(i);
+        if( !( Cells[j] ) )
+        {
+            i/=2;
+        }
+        else
+        {
+            j++;
+        }
+    }
+          TBool iswidgetinfullview = registryClient->IsWidgetInFullView( KNullUid );
+          
+          for (TInt i = 0; i < maxExponent; i++) // release all consumed heap memory
+                      if (Cells[i])
+                       User::Free(Cells[i]);
+          
+          
+          if(EFalse == iswidgetinfullview)
+          {
+             aResult.SetResult( KErrNone, KPassed );    
+          }
+        registryClient->Disconnect();
+        } 
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+
+//Method to verify IsWidgetInMiniView API
+ TInt CWidgetRegistrySTIF::ClientSessionIsWidgetInMiniViewTest( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+    
+    const TInt maxExponent = 32;
+       TAny* Cells[maxExponent];
+       TInt j=0;
+
+       for (TInt i = 0; i < maxExponent; i++)
+           Cells[i] = 0;
+           
+       
+       for (TInt i = KMaxTInt/2-1; i > 0; )
+       {
+           Cells[j] = User::Alloc(i);
+           if( !( Cells[j] ) )
+           {
+               i/=2;
+           }
+           else
+           {
+               j++;
+           }
+       }
+          TBool iswidgetinminiview = registryClient->IsWidgetInMiniView( KNullUid );
+          
+          for (TInt i = 0; i < maxExponent; i++) // release all consumed heap memory
+                               if (Cells[i])
+                                User::Free(Cells[i]);
+          if(EFalse == iswidgetinminiview)
+          {
+              aResult.SetResult( KErrNone, KPassed );    
+          }
+        registryClient->Disconnect();
+        } 
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+    
+//Method to verify IsBlanketPermGranted API
+ TInt CWidgetRegistrySTIF::ClientSessionIsBlanketPermGrantedTest( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+            TBool iswidgetgranted = registryClient->IsBlanketPermGranted( KNullUid );
+            if(EFalse == iswidgetgranted)
+            {
+                aResult.SetResult( KErrNone, KPassed );    
+            }
+        registryClient->Disconnect();
+        } 
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+    
+    
+//Method to verify SetminiViewL API
+ TInt CWidgetRegistrySTIF::ClientSessionSetMiniViewTestL( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+           registryClient->SetMiniViewL( KNullUid, 0 );
+           aResult.SetResult( KErrNone, KPassed );
+           registryClient->Disconnect();
+        }
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+
+
+//Method to verify SetFullViewL API
+ TInt CWidgetRegistrySTIF::ClientSessionSetFullViewTestL( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+           registryClient->SetFullViewL( KNullUid, 0 );
+           aResult.SetResult( KErrNone, KPassed );
+           registryClient->Disconnect();
+        }
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+
+//Method to verify SetBlanketPermissionL API
+ TInt CWidgetRegistrySTIF::ClientSessionSetBlanketPermissionTestL( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+    const TInt maxExponent = 32;
+      TAny* Cells[maxExponent];
+      TInt j=0;
+
+      for (TInt i = 0; i < maxExponent; i++)
+          Cells[i] = 0;
+          
+      
+      for (TInt i = KMaxTInt/2-1; i > 0; )
+      {
+          Cells[j] = User::Alloc(i);
+          if( !( Cells[j] ) )
+          {
+              i/=2;
+          }
+          else
+          {
+              j++;
+          }
+      }     
+           registryClient->SetBlanketPermissionL( KNullUid, 0 );
+           
+           for (TInt i = 0; i < maxExponent; i++) // release all consumed heap memory
+                               if (Cells[i])
+                                User::Free(Cells[i]);
+           
+           
+           aResult.SetResult( KErrNone, KPassed );
+           registryClient->Disconnect();
+        }
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+ 
+
+//Method to verify WidgetSapiAccessState API
+ TInt CWidgetRegistrySTIF::ClientSessionWidgetSapiAccessStateTest( TTestResult& aResult )
+ {
+    aResult.SetResult( KErrGeneral, KFailed );
+    RWidgetRegistryClientSession* registryClient;
+    registryClient = new (ELeave) RWidgetRegistryClientSession;
+    CleanupStack::PushL( registryClient );
+    TInt error = registryClient->Connect();
+    if ( KErrNone == error )
+        {
+           TInt aAccessState = registryClient->WidgetSapiAccessState( KNullUid );
+           if(aAccessState == -1)
+            {
+                aResult.SetResult( KErrNone, KPassed );   
+            }
+           else
+            {
+                aResult.SetResult( KErrNone, KFailed );      
+            }
+        registryClient->Disconnect();
+        }
+    CleanupStack::PopAndDestroy( registryClient );
+    return KErrNone;
+ }
+ 
+ 
 const TCaseInfo CWidgetRegistrySTIF::Case ( const TInt aCaseNumber ) const
     {
     static TCaseInfoInternal const KCases[] =
@@ -871,6 +1132,20 @@
                CWidgetRegistrySTIF::ClientSessionGetLprojNameL ),
         ENTRY( "ClientSession SecurityPolicyId",
                CWidgetRegistrySTIF::ClientSessionSecurityPolicyId ),
+        ENTRY( "ClientSession IsWidgetInFullViewTest",
+               CWidgetRegistrySTIF::ClientSessionIsWidgetInFullViewTest ),
+        ENTRY( "ClientSession IsWidgetInMiniViewTest",
+               CWidgetRegistrySTIF::ClientSessionIsWidgetInMiniViewTest ),
+        ENTRY( "ClientSession IsBlanketPermGrantedTest",
+               CWidgetRegistrySTIF::ClientSessionIsBlanketPermGrantedTest ),
+        ENTRY( "ClientSession SetminiViewTestL",
+               CWidgetRegistrySTIF::ClientSessionSetMiniViewTestL ),
+        ENTRY( "ClientSession SetFullViewTestL",
+               CWidgetRegistrySTIF::ClientSessionSetFullViewTestL ),
+        ENTRY( "ClientSession SetBlanketPermissionTestL",
+               CWidgetRegistrySTIF::ClientSessionSetBlanketPermissionTestL ),
+        ENTRY( "ClientSession WidgetSapiAccessStateTest",
+               CWidgetRegistrySTIF::ClientSessionWidgetSapiAccessStateTest ),
         
         };
     /*
--- a/widgets/widgetapp/src/WidgetUiNetworkListener.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiNetworkListener.cpp	Tue May 11 17:13:44 2010 +0300
@@ -91,12 +91,24 @@
         }
     else if ( iNote().iState == EInterfaceDown )
         {
+#ifndef BRDO_OCC_ENABLED_FF
+        RTimer timer; 
+        TRequestStatus timerStatus; // Request status associated with timer
+        timer.CreateLocal();   	
+#endif
         // check if there are no other active connections
         if ( !CheckActiveNetworkConnection() )
             {
             // notify widgets of a network connection going down
             iWindowManager.NotifyConnecionChange( EFalse );
+#ifndef BRDO_OCC_ENABLED_FF
+            timer.After(timerStatus,30000000);
+            User::WaitForRequest(timerStatus);
+#endif
             }
+#ifndef BRDO_OCC_ENABLED_FF        
+            timer.Close();
+#endif
         }
          
     iConn.AllInterfaceNotification( iNote, iStatus );
--- a/widgets/widgetapp/src/WidgetUiWindow.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindow.cpp	Tue May 11 17:13:44 2010 +0300
@@ -925,7 +925,10 @@
             User::Leave( connFailure );
             }
         *aNewConn = ETrue;
-
+        
+#ifdef BRDO_OCC_ENABLED_FF        
+        TRAP_IGNORE(ConnNeededStatusL(KErrNone)); 
+#endif        
         }
     }
 
@@ -1323,6 +1326,8 @@
     TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
     SetRetryFlag(ETrue);    
     
+    TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
+    
     if( iRetryConnectivity && iRetryConnectivity->IsActive())
        {
        iRetryConnectivity->Cancel();
@@ -1349,7 +1354,7 @@
 void CWidgetUiWindow::StopConnectionObserving()
     {
     
-    if ( iConnStageNotifier && iConnStageNotifier->IsActive() )
+    if ( iConnStageNotifier )
         {
         iConnStageNotifier->Cancel();
         }
--- a/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Tue Apr 27 17:46:17 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Tue May 11 17:13:44 2010 +0300
@@ -688,7 +688,10 @@
             TRAP_IGNORE( aWidgetWindow->Engine()->HandleCommandL( 
                     (TInt)TBrCtlDefs::ECommandIdBase +
                     (TInt)TBrCtlDefs::ECommandDisconnect ) );
-            iConnection->CancelConnection(); 
+            iConnection->CancelConnection();
+#ifdef BRDO_OCC_ENABLED_FF            
+            aWidgetWindow->StopConnectionObserving();
+#endif
             iConnection->StopConnectionL();
             delete aWidgetWindow;
             return ETrue;
@@ -711,6 +714,9 @@
                 aWidgetWindow->Engine()->HandleCommandL( 
                 (TInt)TBrCtlDefs::ECommandIdBase +
                                 (TInt)TBrCtlDefs::ECommandDisconnect );
+#ifdef BRDO_OCC_ENABLED_FF                                    
+                aWidgetWindow->StopConnectionObserving();
+#endif
                 iConnection->StopConnectionL();
                 }             
             delete aWidgetWindow;
@@ -1090,6 +1096,7 @@
             (TInt)TBrCtlDefs::ECommandIdBase);
 #ifdef BRDO_WRT_HS_FF 
         wdgt_window->Engine()->MakeVisible( EFalse );
+        wdgt_window->SetIsCurrentWindow( EFalse );
         wdgt_window->Engine()->SetRect( iCpsPublisher->BitmapSize());
         //When HS comes to foreground show the latest updatd content on HS.
         //Relayout can sometimes happen only when widget in FullView.
@@ -1405,6 +1412,9 @@
                        (TInt)TBrCtlDefs::ECommandIdBase +
                        (TInt)TBrCtlDefs::ECommandDisconnect ) );
                        iConnection->CancelConnection();
+#ifdef BRDO_OCC_ENABLED_FF                       
+                       window->StopConnectionObserving();
+#endif                       
                        iConnection->StopConnectionL();
            delete window;  
            }  
@@ -1559,6 +1569,9 @@
                                 (TInt)TBrCtlDefs::ECommandIdBase +
                                 (TInt)TBrCtlDefs::ECommandDisconnect );
                     iConnection->CancelConnection();
+#ifdef BRDO_OCC_ENABLED_FF                    
+					window->StopConnectionObserving();
+#endif
                     iConnection->StopConnectionL();
                     }
 		  	        }