Skip to content
  • ap@apple.com's avatar
    Add a way to fulfill promises from DOM code · ae921fd2
    ap@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=123466
    
    Reviewed by Sam Weinig.
    
    Source/JavaScriptCore:
    
    * JavaScriptCore.xcodeproj/project.pbxproj: Make JSPromise.h and JSPromiseResolver.h
    private headers for WebCore to use.
    
    * runtime/JSPromise.h:
    * runtime/JSPromiseResolver.h:
    Export functions that JSDOMPromise will use.
    
    Source/WebCore:
    
    This is not perfect, as it strongly ties DOM code to JavaScript. In the future, we
    can make it better e.g. by subclassing, so that only a base interface would be exposed.
    
    * GNUmakefile.list.am:
    * WebCore.vcxproj/WebCore.vcxproj:
    * WebCore.vcxproj/WebCore.vcxproj.filters:
    * bindings/js/JSBindingsAllInOne.cpp:
    * WebCore.xcodeproj/project.pbxproj:
    Added JSDOMPromise.
    
    * bindings/js/JSDOMPromise.cpp: Added.
    
    * bindings/js/JSDOMPromise.h: Added.
    (WebCore::PromiseWrapper::create):
    (WebCore::PromiseWrapper::fulfill): A random set of specializations that I needed
    in WebCrypto code so far.
    (WebCore::PromiseWrapper::reject): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ae921fd2