Reviewed by Brady.
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jan 2008 09:11:35 +0000 (09:11 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jan 2008 09:11:35 +0000 (09:11 +0000)
        - fixed <rdar://problem/5644300> Back/Forward Cache should not include pages with databases

        Track whether a document has ever opened a database; if so, exclude it from b/f caching (for now)

        * dom/Document.cpp:
        (WebCore::Document::Document):
        * dom/Document.h:
        (WebCore::Document::setHasOpenDatabases):
        (WebCore::Document::hasOpenDatabases):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::canCachePage):
        * storage/Database.cpp:
        (WebCore::Database::openDatabase):

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

WebCore/ChangeLog
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/loader/FrameLoader.cpp
WebCore/storage/Database.cpp

index d6901dc79c18f61067f1fd0df5dab6fab577c50d..04d2288e53e012526d648f5ebb831c8e3c09f24c 100644 (file)
@@ -1,3 +1,21 @@
+2008-01-07  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Brady.
+
+        - fixed <rdar://problem/5644300> Back/Forward Cache should not include pages with databases
+        
+        Track whether a document has ever opened a database; if so, exclude it from b/f caching (for now)
+        
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        * dom/Document.h:
+        (WebCore::Document::setHasOpenDatabases):
+        (WebCore::Document::hasOpenDatabases):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::canCachePage):
+        * storage/Database.cpp:
+        (WebCore::Database::openDatabase):
+
 2008-01-07  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Oliver Hunt.
index 2f07533e8b27a64ee69befca7d2cff85c9ba527d..3a47edc613b8a74bce303fcf6556a151b57c7ef9 100644 (file)
@@ -285,6 +285,9 @@ Document::Document(DOMImplementation* impl, Frame* frame, bool isXHTML)
     , m_useSecureKeyboardEntryWhenActive(false)
     , m_isXHTML(isXHTML)
     , m_numNodeLists(0)
+#if ENABLE(DATABASE)
+    , m_hasOpenDatabases(false)
+#endif
 #if USE(LOW_BANDWIDTH_DISPLAY)
     , m_inLowBandwidthDisplay(false)
 #endif
index 78f0c049c97b142d04e2874338cf642eeabafc3c..d1c599d14b3e4ecf4c128b4763c60aaef4b6ca3f 100644 (file)
@@ -858,6 +858,8 @@ public:
 
 #if ENABLE(DATABASE)
     DatabaseThread* databaseThread();
+    void setHasOpenDatabases() { m_hasOpenDatabases = true; }
+    bool hasOpenDatabases() { return m_hasOpenDatabases; }
 #endif
 protected:
     void clearXMLVersion() { m_xmlVersion = String(); }
@@ -924,6 +926,7 @@ private:
 
 #if ENABLE(DATABASE)
     RefPtr<DatabaseThread> m_databaseThread;
+    bool m_hasOpenDatabases;
 #endif
 #if USE(LOW_BANDWIDTH_DISPLAY)
     bool m_inLowBandwidthDisplay;
index 07210996b1481c46893b4c4241a3adc73d956beb..a24e4c371db890c8beff48546d99fa4e18880cef 100644 (file)
@@ -1766,6 +1766,9 @@ bool FrameLoader::canCachePage()
         && m_frame->document()
         && !m_frame->document()->applets()->length()
         && !m_frame->document()->hasWindowEventListener(unloadEvent)
+#if ENABLE(DATABASE)
+        && !m_frame->document()->hasOpenDatabases()
+#endif
         && m_frame->page()
         && m_frame->page()->backForwardList()->enabled()
         && m_frame->page()->backForwardList()->capacity() > 0
index 98fb65fd834e8a1dde88c8f956dd1a21128d2868..828d867457357788f351a4982aff66975b51db22 100644 (file)
@@ -111,6 +111,8 @@ PassRefPtr<Database> Database::openDatabase(Document* document, const String& na
     
     DatabaseTracker::tracker().setDatabaseDetails(document->securityOrigin()->securityOriginData(), name, displayName, estimatedSize);
 
+    document->setHasOpenDatabases();
+
     if (Page* page = document->frame()->page())
         page->inspectorController()->didOpenDatabase(database.get(), document->domain(), name, expectedVersion);