Bug 136962

Summary: [iOS] ASSERTION FAILED: WTF::isMainThread() in WebCore::memoryCache() when using WebKit1
Product: WebKit Reporter: Pratik Solanki <psolanki>
Component: PlatformAssignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, psolanki, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Pratik Solanki 2014-09-19 14:54:01 PDT
Loading Safari causes the above assertion to trigger. This is because the disk image caching callback is happening on the main (UI) thread instead of the web thread when using WebKit1.
Comment 1 Pratik Solanki 2014-09-19 14:54:16 PDT
<rdar://problem/18342344>
Comment 2 Pratik Solanki 2014-09-19 15:04:50 PDT
Created attachment 238390 [details]
Patch
Comment 3 Geoffrey Garen 2014-09-19 16:30:56 PDT
Comment on attachment 238390 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2014-09-19 17:05:20 PDT
Comment on attachment 238390 [details]
Patch

Clearing flags on attachment: 238390

Committed r173782: <http://trac.webkit.org/changeset/173782>
Comment 5 WebKit Commit Bot 2014-09-19 17:05:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2014-09-21 11:05:30 PDT
Comment on attachment 238390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=238390&action=review

> Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm:111
> +    CFCachedURLResponseCallBackBlock blockToRun = ^ (const CFCachedURLResponseRef response)

This const is incorrect and unneeded. Also would be nice to have consistent syntax with the definition of "block" above.
Comment 7 Pratik Solanki 2014-09-22 15:14:06 PDT
Comment on attachment 238390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=238390&action=review

>> Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm:111
>> +    CFCachedURLResponseCallBackBlock blockToRun = ^ (const CFCachedURLResponseRef response)
> 
> This const is incorrect and unneeded. Also would be nice to have consistent syntax with the definition of "block" above.

You're right. I am not sure how I ended up with a const there. Will fix.
Comment 8 Pratik Solanki 2014-09-22 17:47:56 PDT
(In reply to comment #7)
> (From update of attachment 238390 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=238390&action=review
> 
> >> Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm:111
> >> +    CFCachedURLResponseCallBackBlock blockToRun = ^ (const CFCachedURLResponseRef response)
> > 
> > This const is incorrect and unneeded. Also would be nice to have consistent syntax with the definition of "block" above.
> 
> You're right. I am not sure how I ended up with a const there. Will fix.

Fixed in r173858 - <http://trac.webkit.org/changeset/173858>.