Title: [144055] trunk
Revision
144055
Author
[email protected]
Date
2013-02-26 07:43:07 -0800 (Tue, 26 Feb 2013)

Log Message

REGRESSION (r143619): Crashes in three layout tests
https://bugs.webkit.org/show_bug.cgi?id=110588

Patch by Martin Robinson <[email protected]> on 2013-02-26
Reviewed by Gustavo Noronha Silva.

Source/WebKit/gtk:

Guard against null main resource identifiers. The main resource
identifier can be null at various times during the load. A null
identifier is never equal to the ones we are looking to remove.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidFinishLoading): Use the new webkitWebViewRemoveSubresource helper.
(WebKit::FrameLoaderClient::dispatchDidFailLoading): ditto.
* webkit/webkitwebview.cpp:
(webkitWebViewRemoveSubresource): Added this helper which removes a subresource, but
never touches the main resource. This is adapted from the old method, for which the
main resource branch was dead code.
* webkit/webkitwebviewprivate.h: Update the method list.

LayoutTests:

* platform/gtk/TestExpectations: Unskip some tests which are no longer
crashing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144054 => 144055)


--- trunk/LayoutTests/ChangeLog	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/LayoutTests/ChangeLog	2013-02-26 15:43:07 UTC (rev 144055)
@@ -1,3 +1,13 @@
+2013-02-26  Martin Robinson  <[email protected]>
+
+        REGRESSION (r143619): Crashes in three layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=110588
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * platform/gtk/TestExpectations: Unskip some tests which are no longer
+        crashing.
+
 2013-02-26  Andrey Kosyakov  <[email protected]>
 
         Unreviewed, rolling out r144041, r144044, and r144048.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (144054 => 144055)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-26 15:43:07 UTC (rev 144055)
@@ -491,10 +491,6 @@
 
 webkit.org/b/110222 fast/events/platform-wheelevent-with-delta-zero-crash.html [ Crash ]
 
-webkit.org/b/110588 http/tests/misc/iframe-reparenting-id-collision.html [ Crash Pass ]
-webkit.org/b/110588 http/tests/misc/window-open-then-write.html [ Crash ]
-webkit.org/b/110588 http/tests/xmlhttprequest/request-from-popup.html [ Crash ]
-
 webkit.org/b/110695 http/tests/security/cross-origin-local-storage-allowed.html [ Crash Pass ]
 webkit.org/b/110695 http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html [ Crash Pass ]
 

Modified: trunk/Source/WebKit/gtk/ChangeLog (144054 => 144055)


--- trunk/Source/WebKit/gtk/ChangeLog	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/Source/WebKit/gtk/ChangeLog	2013-02-26 15:43:07 UTC (rev 144055)
@@ -1,3 +1,23 @@
+2013-02-26  Martin Robinson  <[email protected]>
+
+        REGRESSION (r143619): Crashes in three layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=110588
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Guard against null main resource identifiers. The main resource
+        identifier can be null at various times during the load. A null
+        identifier is never equal to the ones we are looking to remove.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidFinishLoading): Use the new webkitWebViewRemoveSubresource helper.
+        (WebKit::FrameLoaderClient::dispatchDidFailLoading): ditto.
+        * webkit/webkitwebview.cpp:
+        (webkitWebViewRemoveSubresource): Added this helper which removes a subresource, but
+        never touches the main resource. This is adapted from the old method, for which the
+        main resource branch was dead code.
+        * webkit/webkitwebviewprivate.h: Update the method list.
+
 2013-02-25  Andreas Kling  <[email protected]>
 
         Reduce amount of code that includes StylePropertySet.h

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (144054 => 144055)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2013-02-26 15:43:07 UTC (rev 144055)
@@ -1021,8 +1021,7 @@
     g_signal_emit_by_name(m_frame, "resource-load-finished", webResource);
     g_signal_emit_by_name(webView, "resource-load-finished", m_frame, webResource);
 
-    if (!g_str_equal(identifierString.get(), webView->priv->mainResourceIdentifier.data()))
-        webkit_web_view_remove_resource(webView, identifierString.get());
+    webkitWebViewRemoveSubresource(webView, identifierString.get());
 }
 
 void FrameLoaderClient::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const ResourceError& error)
@@ -1046,8 +1045,7 @@
     g_signal_emit_by_name(m_frame, "resource-load-failed", webResource, webError.get());
     g_signal_emit_by_name(webView, "resource-load-failed", m_frame, webResource, webError.get());
 
-    if (!g_str_equal(identifierString.get(), webView->priv->mainResourceIdentifier.data()))
-        webkit_web_view_remove_resource(webView, identifierString.get());
+    webkitWebViewRemoveSubresource(webView, identifierString.get());
 }
 
 bool FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)

Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (144054 => 144055)


--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2013-02-26 15:43:07 UTC (rev 144055)
@@ -5066,14 +5066,15 @@
     g_hash_table_insert(priv->subResources.get(), g_strdup(identifier), webResource);
 }
 
-void webkit_web_view_remove_resource(WebKitWebView* webView, const char* identifier)
+void webkitWebViewRemoveSubresource(WebKitWebView* webView, const char* identifier)
 {
-    WebKitWebViewPrivate* priv = webView->priv;
-    if (g_str_equal(identifier, priv->mainResourceIdentifier.data())) {
-        priv->mainResourceIdentifier = "";
-        priv->mainResource = 0;
-    } else
-      g_hash_table_remove(priv->subResources.get(), identifier);
+    ASSERT(identifier);
+
+    // Don't remove the main resource.
+    const CString& mainResource = webView->priv->mainResourceIdentifier;
+    if (!mainResource.isNull() && g_str_equal(identifier, mainResource.data()))
+        return;
+    g_hash_table_remove(webView->priv->subResources.get(), identifier);
 }
 
 WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* identifier)

Modified: trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h (144054 => 144055)


--- trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h	2013-02-26 15:32:30 UTC (rev 144054)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h	2013-02-26 15:43:07 UTC (rev 144055)
@@ -129,7 +129,7 @@
 
 void webkit_web_view_add_resource(WebKitWebView*, const char*, WebKitWebResource*);
 void webkit_web_view_add_main_resource(WebKitWebView*, const char*, WebKitWebResource*);
-void webkit_web_view_remove_resource(WebKitWebView*, const char*);
+void webkitWebViewRemoveSubresource(WebKitWebView*, const char*);
 WebKitWebResource* webkit_web_view_get_resource(WebKitWebView*, char*);
 WebKitWebResource* webkit_web_view_get_main_resource(WebKitWebView*);
 void webkit_web_view_clear_resources(WebKitWebView*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to