Title: [164817] trunk/Source/WebKit/mac
Revision
164817
Author
[email protected]
Date
2014-02-27 11:11:52 -0800 (Thu, 27 Feb 2014)

Log Message

Assertion failure at CachedResource.h:196: ASSERT(!m_purgeableData)
https://bugs.webkit.org/show_bug.cgi?id=129349
<rdar://problem/14871837>

Reviewed by Joseph Pecoraro.

The code for clearing out memory mapped notification callbacks is only needed when loading
PDFs. And in such cases, we always have dataSourceDelegate object. So make this code
conditional on its presence so that we don't trigger the assert for non-PDF main resources.

* WebView/WebDataSource.mm:
(-[WebDataSource dealloc]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (164816 => 164817)


--- trunk/Source/WebKit/mac/ChangeLog	2014-02-27 19:00:33 UTC (rev 164816)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-02-27 19:11:52 UTC (rev 164817)
@@ -1,3 +1,18 @@
+2014-02-27  Pratik Solanki  <[email protected]>
+
+        Assertion failure at CachedResource.h:196: ASSERT(!m_purgeableData)
+        https://bugs.webkit.org/show_bug.cgi?id=129349
+        <rdar://problem/14871837>
+
+        Reviewed by Joseph Pecoraro.
+
+        The code for clearing out memory mapped notification callbacks is only needed when loading
+        PDFs. And in such cases, we always have dataSourceDelegate object. So make this code
+        conditional on its presence so that we don't trigger the assert for non-PDF main resources.
+
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource dealloc]):
+
 2014-02-26  Andy Estes  <[email protected]>
 
         [iOS] Support network state notification using CPNetworkObserver

Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (164816 => 164817)


--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2014-02-27 19:00:33 UTC (rev 164816)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2014-02-27 19:11:52 UTC (rev 164817)
@@ -481,7 +481,11 @@
         --WebDataSourceCount;
 
 #if ENABLE(DISK_IMAGE_CACHE) && PLATFORM(IOS)
-    if (_private) {
+    // The code to remove memory mapped notification is only needed when we are viewing a PDF file.
+    // In such a case, WebPDFViewPlaceholder sets itself as the dataSourceDelegate. Guard the access
+    // to mainResourceData with this nil check so that we avoid assertions due to the resource being
+    // made purgeable.
+    if (_private && [self dataSourceDelegate]) {
         RefPtr<ResourceBuffer> mainResourceBuffer = toPrivate(_private)->loader->mainResourceData();
         if (mainResourceBuffer) {
             RefPtr<SharedBuffer> mainResourceData = mainResourceBuffer->sharedBuffer();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to