Bug 125939

Summary: [iOS] Frequent ASSERT(hasOneRef()) in SharedBuffer::releasePurgeableBuffer
Product: WebKit Reporter: Tim Horton <thorton>
Component: Page LoadingAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, japhet, psolanki, sam, simon.fraser, yongjun_zhang
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch simon.fraser: review+

Description Tim Horton 2013-12-18 12:34:30 PST
http://trac.webkit.org/changeset/146082 fixed this by not making a purgeable buffer if a SharedBuffer has multiple refs, but the check was put in ResourceBuffer::createPurgeableBuffer instead of down in SharedBuffer::createPurgeableBuffer. This is fine for ToT WebKit, because ResourceBuffer::createPurgeableBuffer is the only caller of SharedBuffer::createPurgeableBuffer, but causes trouble for not-quite-yet-upstreamed iOS SharedBuffer code, which has another caller of SharedBuffer::createPurgeableBuffer.

Pushing the early-return down into SharedBuffer::createPurgeableBuffer makes more sense and will fix the aforementioned assertion failures on iOS, and hopefully resolve some hard-to-track-down crashes.
Comment 1 Tim Horton 2013-12-18 12:37:55 PST
Created attachment 219558 [details]
patch
Comment 2 Pratik Solanki 2013-12-18 12:50:15 PST
Comment on attachment 219558 [details]
patch

Patch looks fine to me. Though you'll need an official reviewer to give you r+.
Comment 3 Tim Horton 2013-12-18 13:01:41 PST
http://trac.webkit.org/changeset/160792