[Qt][WK2] http/tests/security/xss-DENIED-xsl-document-securityOrigin.xml crashes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 20:26:10 +0000 (20:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 20:26:10 +0000 (20:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80209

Patch by Michael BrĂ¼ning <michael.bruning@nokia.com> on 2012-05-15
Reviewed by Kenneth Rohde Christiansen.

This patch adds a method isOpen to WebIconDatabase to
be able to check whether the database has already been opened.
This helps preventing problems when reusing a WebContext
to create another view, as e.g. WebKitTestRunner does it in the
Qt port.

* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::setDatabasePath):
(WebKit::WebIconDatabase::isOpen): Added.
(WebKit):
* UIProcess/WebIconDatabase.h:
(WebIconDatabase):
* UIProcess/qt/QtWebIconDatabaseClient.cpp:
(WebKit::QtWebIconDatabaseClient::QtWebIconDatabaseClient):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebIconDatabase.cpp
Source/WebKit2/UIProcess/WebIconDatabase.h
Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp

index 7d6166c..4d03069 100644 (file)
@@ -1,3 +1,25 @@
+2012-05-15  Michael BrĂ¼ning  <michael.bruning@nokia.com>
+
+        [Qt][WK2] http/tests/security/xss-DENIED-xsl-document-securityOrigin.xml crashes
+        https://bugs.webkit.org/show_bug.cgi?id=80209
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        This patch adds a method isOpen to WebIconDatabase to
+        be able to check whether the database has already been opened.
+        This helps preventing problems when reusing a WebContext
+        to create another view, as e.g. WebKitTestRunner does it in the
+        Qt port.
+
+        * UIProcess/WebIconDatabase.cpp:
+        (WebKit::WebIconDatabase::setDatabasePath):
+        (WebKit::WebIconDatabase::isOpen): Added.
+        (WebKit):
+        * UIProcess/WebIconDatabase.h:
+        (WebIconDatabase):
+        * UIProcess/qt/QtWebIconDatabaseClient.cpp:
+        (WebKit::QtWebIconDatabaseClient::QtWebIconDatabaseClient):
+
 2012-05-15  Anders Carlsson  <andersca@apple.com>
 
         Use unaccelerated scrolling deltas when rubber-banding
index 8016cfb..10804f7 100644 (file)
@@ -62,7 +62,7 @@ void WebIconDatabase::invalidate()
 
 void WebIconDatabase::setDatabasePath(const String& path)
 {
-    if (m_iconDatabaseImpl && m_iconDatabaseImpl->isOpen()) {
+    if (isOpen()) {
         LOG_ERROR("Icon database already has a path and is already open. We don't currently support changing its path and reopening.");
         return;
     }
@@ -190,6 +190,11 @@ Image* WebIconDatabase::imageForPageURL(const String& pageURL, const WebCore::In
     return m_iconDatabaseImpl->synchronousIconForPageURL(pageURL, iconSize);
 }
 
+bool WebIconDatabase::isOpen()
+{
+    return m_iconDatabaseImpl && m_iconDatabaseImpl->isOpen();
+}
+
 void WebIconDatabase::removeAllIcons()
 {
     m_iconDatabaseImpl->removeAllIcons();   
index b74c210..7ae3fdc 100644 (file)
@@ -78,7 +78,8 @@ public:
     void getLoadDecisionForIconURL(const String&, uint64_t callbackID);
 
     WebCore::Image* imageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32));
-    
+    bool isOpen();
+
     void removeAllIcons();
     void checkIntegrityBeforeOpening();
     void close();
index d94b634..c769c8b 100644 (file)
@@ -45,7 +45,8 @@ QtWebIconDatabaseClient::QtWebIconDatabaseClient(QtWebContext *qtWebContext)
     m_contextId = qtWebContext->contextID();
     // The setter calls the getter here as it triggers the startup of the icon database.
     WebContext* context = qtWebContext->context();
-    context->setIconDatabasePath(context->iconDatabasePath());
+    if (!context->iconDatabase()->isOpen())
+        context->setIconDatabasePath(context->iconDatabasePath());
     m_iconDatabase = context->iconDatabase();
 
     WKIconDatabaseClient iconDatabaseClient;