Add a release assertion that Functions can only be constructed from non-null Completi...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 19:54:00 +0000 (19:54 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 19:54:00 +0000 (19:54 +0000)
commit02867f7af9244e40798baa28cb3d6c35cc3ae738
treea25f4072bdb64fbec1b6181450af39fabd2885b1
parent11e58d7cea5124600bd4a4c755cd157dbdd49785
Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
https://bugs.webkit.org/show_bug.cgi?id=197641

Reviewed by Chris Dumez.

This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
not when it's called with no interesting stack trace.  I manually verified this assertion is hit in such a case.
We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.

* wtf/CompletionHandler.h:
(WTF::Detail::CallableWrapper<CompletionHandler<Out):
* wtf/Function.h:
(WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
(WTF::Detail::CallableWrapper::CallableWrapper):
(WTF::Function<Out):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/CompletionHandler.h
Source/WTF/wtf/Function.h