WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2008 17:28:24 +0000 (17:28 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2008 17:28:24 +0000 (17:28 +0000)
2008-05-06  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin Adler

        Preparation for upcoming work making LocalStorage persistent.

        When the application terminates, all pending local storage writes need to be
        sync'ed out to disk.
        This works n combination with platform specific code in WebKit that calls it.

        * WebCore.base.exp:

        * page/PageGroup.cpp:
        (WebCore::PageGroup::closeLocalStorage): Close all open LocalStorage objects
        * page/PageGroup.h:

        * storage/LocalStorage.cpp:
        (WebCore::LocalStorage::close): Placeholder for what will sync and terminate the
          local storage thread in the future.
        * storage/LocalStorage.h:

WebKit/mac:

2008-05-06  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin Adler

        Preparation for upcoming work making LocalStorage persistent.

        When the application terminates, all LocalStorage areas must be sync'ed out to disk first.

        * WebView/WebView.mm:
        (+[WebView _applicationWillTerminate]):  Close all LocalStorage areas before quitting.

WebKit/win:

2008-05-06  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin Adler

        Preparation for upcoming work making LocalStorage persistent.

        When the application terminates, all LocalStorage areas must be sync'ed out to disk first.

        * WebKitDLL.cpp:
        (shutDownWebKit): Close all LocalStorage areas before quitting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32906 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/page/PageGroup.cpp
WebCore/page/PageGroup.h
WebCore/storage/LocalStorage.cpp
WebCore/storage/LocalStorage.h
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebView.mm
WebKit/win/ChangeLog
WebKit/win/WebKitDLL.cpp

index c3ea24a..9655e14 100644 (file)
@@ -1,5 +1,26 @@
 2008-05-06  Brady Eidson  <beidson@apple.com>
 
+        Reviewed by Darin Adler
+
+        Preparation for upcoming work making LocalStorage persistent.
+
+        When the application terminates, all pending local storage writes need to be
+        sync'ed out to disk.
+        This works n combination with platform specific code in WebKit that calls it.
+
+        * WebCore.base.exp:
+
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::closeLocalStorage): Close all open LocalStorage objects
+        * page/PageGroup.h:
+
+        * storage/LocalStorage.cpp:
+        (WebCore::LocalStorage::close): Placeholder for what will sync and terminate the
+          local storage thread in the future.
+        * storage/LocalStorage.h:
+
+2008-05-06  Brady Eidson  <beidson@apple.com>
+
         Rubberstamped by David Kilzer
 
         * WebCore.base.exp:  Sort this mess!
index 0aaef4d..09631b3 100644 (file)
@@ -620,6 +620,7 @@ __ZN7WebCore9HTMLNames8inputTagE
 __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache27releaseAutoreleasedPagesNowEv
 __ZN7WebCore9PageGroup14addVisitedLinkEPKtm
+__ZN7WebCore9PageGroup17closeLocalStorageEv
 __ZN7WebCore9PageGroup21removeAllVisitedLinksEv
 __ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
 __ZN7WebCore9Selection22expandUsingGranularityENS_15TextGranularityE
index b3e1b06..4580454 100644 (file)
@@ -84,6 +84,19 @@ PageGroup* PageGroup::pageGroup(const String& groupName)
     return result.first->second;
 }
 
+void PageGroup::closeLocalStorage()
+{
+    if (!pageGroups)
+        return;
+
+    PageGroupMap::iterator end = pageGroups->end();
+
+    for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
+        if (LocalStorage* localStorage = it->second->localStorage())
+            localStorage->close();
+    }
+}
+
 void PageGroup::addPage(Page* page)
 {
     ASSERT(page);
index c92fdc0..b25892d 100644 (file)
@@ -42,6 +42,7 @@ namespace WebCore {
         PageGroup(Page*);
 
         static PageGroup* pageGroup(const String& groupName);
+        static void closeLocalStorage();
         
         const HashSet<Page*>& pages() const { return m_pages; }
 
index 3619d58..022a39b 100644 (file)
@@ -60,4 +60,9 @@ PassRefPtr<StorageArea> LocalStorage::storageArea(Frame* sourceFrame, SecurityOr
     return storageArea.release();
 }
 
+void LocalStorage::close()
+{
+    // FIXME: Make sure all pending writes complete and terminate the background thread
+}
+
 } // namespace WebCore
index 9c574dd..fbac9c4 100644 (file)
@@ -43,6 +43,8 @@ namespace WebCore {
 
         PassRefPtr<StorageArea> storageArea(Frame* sourceFrame, SecurityOrigin*);
 
+        void close();
+
     private:
         LocalStorage(PageGroup*, const String& path);
 
index 89caf71..5c59523 100644 (file)
@@ -1,3 +1,14 @@
+2008-05-06  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler
+
+        Preparation for upcoming work making LocalStorage persistent.
+
+        When the application terminates, all LocalStorage areas must be sync'ed out to disk first.
+
+        * WebView/WebView.mm:
+        (+[WebView _applicationWillTerminate]):  Close all LocalStorage areas before quitting.
+
 2008-05-05  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Darin Adler.
index 8f6770e..b916d42 100644 (file)
 #import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/Page.h>
 #import <WebCore/PageCache.h>
+#import <WebCore/PageGroup.h>
 #import <WebCore/PlatformMouseEvent.h>
 #import <WebCore/ProgressTracker.h>
 #import <WebCore/SelectionController.h>
@@ -1707,6 +1708,8 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
     applicationIsTerminating = YES;
     if (!pluginDatabaseClientCount)
         [WebPluginDatabase closeSharedDatabase];
+
+    PageGroup::closeLocalStorage();
 }
 
 + (BOOL)canShowMIMEType:(NSString *)MIMEType
index d093c49..e952181 100644 (file)
@@ -1,3 +1,14 @@
+2008-05-06  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler
+
+        Preparation for upcoming work making LocalStorage persistent.
+
+        When the application terminates, all LocalStorage areas must be sync'ed out to disk first.
+
+        * WebKitDLL.cpp:
+        (shutDownWebKit): Close all LocalStorage areas before quitting.
+
 2008-05-05  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by John.
index 3efc94f..d5ae538 100644 (file)
@@ -37,6 +37,7 @@
 #include <WebCore/COMPtr.h>
 #include <WebCore/IconDatabase.h>
 #include <WebCore/Page.h>
+#include <WebCore/PageGroup.h>
 #include <WebCore/SharedBuffer.h>
 #include <WebCore/Widget.h>
 #include <wtf/Vector.h>
@@ -57,6 +58,7 @@ static CLSID gRegCLSIDs[] = {
 void shutDownWebKit()
 {
     WebCore::iconDatabase()->close();
+    WebCore::PageGroup::closeLocalStorage();
 }
 
 STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID /*lpReserved*/)