Changeset 143619 in webkit
- Timestamp:
- Feb 21, 2013 9:50:37 AM (11 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r143591 r143619 1 2013-02-21 George McCollister <george.mccollister@gmail.com> 2 3 [GTK] Remove subresource leaks from WebKit1 and WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=108960 5 6 Reviewed by Martin Robinson. 7 8 * WebCoreSupport/FrameLoaderClientGtk.cpp: 9 (WebKit::FrameLoaderClient::dispatchDidFinishLoading): Remove resource 10 if it isn't the main resource to prevent leak. 11 (WebKit::FrameLoaderClient::dispatchDidFailLoading): Ditto 12 * webkit/webkitwebview.cpp: 13 (cleanupTemporarilyCachedSubresources): Added to cleanup subresources. 14 (webkit_web_view_get_subresources): Use getSubresources from the 15 documentLoader to provide subresources since resources will be removed 16 from webview after loading. 17 1 18 2013-02-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r140557 r143619 1021 1021 g_signal_emit_by_name(m_frame, "resource-load-finished", webResource); 1022 1022 g_signal_emit_by_name(webView, "resource-load-finished", m_frame, webResource); 1023 1024 if (!g_str_equal(identifierString.get(), webView->priv->mainResourceIdentifier.data())) 1025 webkit_web_view_remove_resource(webView, identifierString.get()); 1023 1026 } 1024 1027 … … 1043 1046 g_signal_emit_by_name(m_frame, "resource-load-failed", webResource, webError.get()); 1044 1047 g_signal_emit_by_name(webView, "resource-load-failed", m_frame, webResource, webError.get()); 1048 1049 if (!g_str_equal(identifierString.get(), webView->priv->mainResourceIdentifier.data())) 1050 webkit_web_view_remove_resource(webView, identifierString.get()); 1045 1051 } 1046 1052 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r142576 r143619 33 33 34 34 #include "AXObjectCache.h" 35 #include "ArchiveResource.h" 35 36 #include "BackForwardListImpl.h" 36 37 #include "CairoUtilities.h" … … 106 107 #include "webkitwebpolicydecision.h" 107 108 #include "webkitwebresource.h" 109 #include "webkitwebresourceprivate.h" 108 110 #include "webkitwebsettingsprivate.h" 109 111 #include "webkitwebplugindatabaseprivate.h" … … 5107 5109 } 5108 5110 5111 static gboolean cleanupTemporarilyCachedSubresources(gpointer data) 5112 { 5113 GList* subResources = static_cast<GList*>(data); 5114 g_list_foreach(subResources, reinterpret_cast<GFunc>(g_object_unref), NULL); 5115 g_list_free(subResources); 5116 return FALSE; 5117 } 5118 5109 5119 GList* webkit_web_view_get_subresources(WebKitWebView* webView) 5110 5120 { 5111 WebKitWebViewPrivate* priv = webView->priv; 5112 GList* subResources = g_hash_table_get_values(priv->subResources.get()); 5113 return g_list_remove(subResources, priv->mainResource.get()); 5121 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL); 5122 GList* subResources = 0; 5123 Vector<PassRefPtr<ArchiveResource> > coreSubResources; 5124 5125 core(webView)->mainFrame()->loader()->documentLoader()->getSubresources(coreSubResources); 5126 5127 for (unsigned i = 0; i < coreSubResources.size(); i++) { 5128 WebKitWebResource* webResource = WEBKIT_WEB_RESOURCE(g_object_new(WEBKIT_TYPE_WEB_RESOURCE, NULL)); 5129 webkit_web_resource_init_with_core_resource(webResource, coreSubResources[i]); 5130 subResources = g_list_append(subResources, webResource); 5131 } 5132 5133 if (subResources) 5134 g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); 5135 5136 return subResources; 5114 5137 } 5115 5138
Note: See TracChangeset
for help on using the changeset viewer.