Changeset 223562 in webkit
- Timestamp:
- Oct 17, 2017 11:39:48 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 14 added
- 17 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r223558 r223562 1 2017-10-17 Youenn Fablet <youenn@apple.com> 2 3 Add preliminary support for fetch event 4 https://bugs.webkit.org/show_bug.cgi?id=178171 5 6 Reviewed by Chris Dumez. 7 8 Skipping new tests for WK1 and GTK that do not have SW. 9 10 * http/wpt/service-workers/extendableEvent.https-expected.txt: Added. 11 * http/wpt/service-workers/extendableEvent.https.html: Added. 12 * http/wpt/service-workers/fetchEvent.https-expected.txt: Added. 13 * http/wpt/service-workers/fetchEvent.https.html: Added. 14 * platform/gtk/TestExpectations: 15 * platform/ios-wk1/TestExpectations: 16 * platform/mac-wk1/TestExpectations: 17 1 18 2017-10-17 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/LayoutTests/platform/ios-wk1/TestExpectations
r222926 r223562 10 10 # No service worker implementation for WK1 11 11 imported/w3c/web-platform-tests/service-workers [ Skip ] 12 http/wpt/service-workers [ Skip ] 12 13 http/wpt/cache-storage [ Skip ] 13 14 http/tests/cache-storage [ Skip ] -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r223440 r223562 105 105 # No service worker implementation for WK1 106 106 imported/w3c/web-platform-tests/service-workers [ Skip ] 107 http/wpt/service-workers [ Skip ] 107 108 http/wpt/cache-storage [ Skip ] 108 109 http/tests/cache-storage [ Skip ] -
trunk/Source/JavaScriptCore/ChangeLog
r223523 r223562 1 2017-10-17 Youenn Fablet <youenn@apple.com> 2 3 Add preliminary support for fetch event 4 https://bugs.webkit.org/show_bug.cgi?id=178171 5 6 Reviewed by Chris Dumez. 7 8 Adding events 9 10 * runtime/JSPromise.h: 11 1 12 2017-10-10 Yusuke Suzuki <utatane.tea@gmail.com> 2 13 -
trunk/Source/JavaScriptCore/runtime/JSPromise.h
r216501 r223562 45 45 }; 46 46 47 Status status(VM&) const;47 JS_EXPORT_PRIVATE Status status(VM&) const; 48 48 JS_EXPORT_PRIVATE JSValue result(VM&) const; 49 49 JS_EXPORT_PRIVATE bool isHandled(VM&) const; -
trunk/Source/WebCore/CMakeLists.txt
r223412 r223562 787 787 workers/WorkerType.idl 788 788 789 workers/service/ExtendableEvent.idl 790 workers/service/ExtendableEventInit.idl 791 workers/service/FetchEvent.idl 789 792 workers/service/ServiceWorker.idl 790 793 workers/service/ServiceWorkerContainer.idl … … 1288 1291 bindings/js/JSDOMGuardedObject.cpp 1289 1292 bindings/js/JSDOMMapLike.cpp 1293 bindings/js/JSDOMPromise.cpp 1290 1294 bindings/js/JSDOMPromiseDeferred.cpp 1291 1295 bindings/js/JSDOMWindowBase.cpp … … 3076 3080 workers/WorkerThread.cpp 3077 3081 3082 workers/service/ExtendableEvent.cpp 3083 workers/service/FetchEvent.cpp 3078 3084 workers/service/ServiceWorker.cpp 3079 3085 workers/service/ServiceWorkerContainer.cpp -
trunk/Source/WebCore/ChangeLog
r223560 r223562 1 2017-10-17 Youenn Fablet <youenn@apple.com> 2 3 Add preliminary support for fetch event 4 https://bugs.webkit.org/show_bug.cgi?id=178171 5 6 Reviewed by Chris Dumez. 7 8 Test: http/wpt/service-workers/fetchEvent.https.html 9 http/wpt/service-workers/extendableEvent.https.html 10 11 Adding support for ExtendableEvent and FetchEvent as per 12 https://w3c.github.io/ServiceWorker/v1/#extendableevent-interface and 13 https://w3c.github.io/ServiceWorker/v1/#fetchevent-interface. 14 15 Both events need to handle promises as method parameters. 16 Beefing up DOMPromise for that purpose by exposing status, result and being able to call then. 17 Adding a new DOMPromise create method that would be the base for https://heycam.github.io/webidl/#es-promise 18 which might be implemented in the binding generator as a follow-up. 19 20 This patch makes them exposed on Window for test purposes until they can be fully tested on ServiceWorker environment. 21 It is also adding two internal methods for the same reason. These should be removed once events can be tested in its environment. 22 23 * CMakeLists.txt: 24 * DerivedSources.make: 25 * Modules/fetch/FetchResponse.idl: 26 * WebCore.xcodeproj/project.pbxproj: 27 * bindings/js/JSDOMPromise.cpp: Added. 28 (WebCore::callFunction): 29 (WebCore::DOMPromise::create): 30 (WebCore::DOMPromise::whenSettled): 31 (WebCore::DOMPromise::result const): 32 (WebCore::DOMPromise::status const): 33 * bindings/js/JSDOMPromise.h: 34 * bindings/js/WebCoreBuiltinNames.h: 35 * dom/EventNames.in: 36 * testing/Internals.cpp: 37 (WebCore::Internals::waitFetchEventToFinish): 38 (WebCore::Internals::waitExtendableEventToFinish): 39 * testing/Internals.h: 40 * testing/Internals.idl: 41 * workers/service/ExtendableEvent.cpp: Added. 42 (WebCore::ExtendableEvent::ExtendableEvent): 43 (WebCore::ExtendableEvent::waitUntil): 44 (WebCore::ExtendableEvent::addPendingPromise): 45 * workers/service/ExtendableEvent.h: 46 (WebCore::ExtendableEvent::onFinishedWaiting): 47 (WebCore::ExtendableEvent::promiseSettled): 48 * workers/service/ExtendableEvent.idl: Added. 49 * workers/service/ExtendableEventInit.h: Added. 50 * workers/service/ExtendableEventInit.idl: Added. 51 * workers/service/FetchEvent.cpp: Added. 52 (WebCore::FetchEvent::FetchEvent): 53 (WebCore::FetchEvent::respondWith): 54 (WebCore::FetchEvent::onResponse): 55 (WebCore::FetchEvent::respondWithError): 56 (WebCore::FetchEvent::processResponse): 57 (WebCore::FetchEvent::promiseSettled): 58 * workers/service/FetchEvent.h: 59 * workers/service/FetchEvent.idl: 60 1 61 2017-10-17 Jer Noble <jer.noble@apple.com> 2 62 -
trunk/Source/WebCore/DerivedSources.make
r223338 r223562 911 911 $(WebCore)/workers/WorkerLocation.idl \ 912 912 $(WebCore)/workers/WorkerType.idl \ 913 $(WebCore)/workers/service/ExtendableEvent.idl \ 914 $(WebCore)/workers/service/ExtendableEventInit.idl \ 915 $(WebCore)/workers/service/FetchEvent.idl \ 913 916 $(WebCore)/workers/service/ServiceWorker.idl \ 914 917 $(WebCore)/workers/service/ServiceWorkerContainer.idl \ -
trunk/Source/WebCore/Modules/fetch/FetchRequest.idl
r223441 r223562 40 40 EnabledAtRuntime=FetchAPI, 41 41 Exposed=(Window,Worker), 42 GenerateIsReachable=Impl, 42 43 InterfaceName=Request, 43 44 ] interface FetchRequest { -
trunk/Source/WebCore/Modules/fetch/FetchResponse.idl
r223073 r223562 44 44 ConstructorMayThrowException, 45 45 EnabledAtRuntime=FetchAPI, 46 Export ToWrappedFunction,46 ExportMacro=WEBCORE_EXPORT, 47 47 Exposed=(Window,Worker), 48 48 InterfaceName=Response, -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r223476 r223562 1694 1694 413015D91C7B571400091C6E /* FetchResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 413015D51C7B570400091C6E /* FetchResponse.cpp */; }; 1695 1695 413015D91C7B571400091C6F /* FetchBodySource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 413015D51C7B570400091C6F /* FetchBodySource.cpp */; }; 1696 4131F3B31F9552860059995A /* JSFetchEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4131F3B11F9552810059995A /* JSFetchEventCustom.cpp */; }; 1696 1697 41380C261F3436A600155FDA /* DOMCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41380C201F34368A00155FDA /* DOMCache.cpp */; }; 1697 1698 41380C271F3436AC00155FDA /* DOMCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 41380C251F34369A00155FDA /* DOMCache.h */; }; … … 1777 1778 41ABE67C1D0580E0006D862D /* CrossOriginPreflightChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41ABE6791D0580D5006D862D /* CrossOriginPreflightChecker.cpp */; }; 1778 1779 41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 41AD75391CEF6BCE00A31486 /* FetchOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1780 41AF37991F8DADAA00111C31 /* ExtendableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF37921F8DA48A00111C31 /* ExtendableEvent.cpp */; }; 1781 41AF379B1F8DADAE00111C31 /* FetchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF37941F8DA49500111C31 /* FetchEvent.cpp */; }; 1782 41AF379D1F8DB1B500111C31 /* JSDOMPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF379C1F8DB1B100111C31 /* JSDOMPromise.cpp */; }; 1779 1783 41B28B141F8501A600FB52AC /* MediaEndpointConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */; }; 1780 1784 41B28B151F8501D300FB52AC /* MediaEndpointConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */; }; … … 3407 3411 7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; }; 3408 3412 7E4C96DC1AD4483500365A51 /* JSReadableStreamSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */; }; 3413 7E4C96DC1AD4483500365A52 /* WebCore/JSFetchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */; }; 3414 7E4C96DC1AD4483500365A53 /* WebCore/JSExtendableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */; }; 3415 7E4C96DC1AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */; }; 3409 3416 7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; }; 3410 3417 7E4C96DD1AD4483500365A51 /* JSReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */; }; 3418 7E4C96DD1AD4483500365A52 /* JSFetchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A52 /* JSFetchEvent.h */; }; 3419 7E4C96DD1AD4483500365A53 /* JSExtendableEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A53 /* JSExtendableEvent.h */; }; 3411 3420 7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */; }; 3412 3421 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; }; … … 9497 9506 413015D61C7B570400091C6F /* FetchBodySource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchBodySource.h; sourceTree = "<group>"; }; 9498 9507 413015D71C7B570400091C6E /* FetchResponse.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchResponse.idl; sourceTree = "<group>"; }; 9508 4131F3B11F9552810059995A /* JSFetchEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchEventCustom.cpp; sourceTree = "<group>"; }; 9509 4131F3B41F955BC30059995A /* ExtendableEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtendableEventInit.h; sourceTree = "<group>"; }; 9510 4131F3B51F955BC50059995A /* ExtendableEventInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ExtendableEventInit.idl; sourceTree = "<group>"; }; 9499 9511 41380C201F34368A00155FDA /* DOMCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DOMCache.cpp; path = Modules/cache/DOMCache.cpp; sourceTree = SOURCE_ROOT; }; 9500 9512 41380C211F34368D00155FDA /* DOMCacheStorage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DOMCacheStorage.cpp; path = Modules/cache/DOMCacheStorage.cpp; sourceTree = SOURCE_ROOT; }; … … 9599 9611 41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossOriginPreflightChecker.h; sourceTree = "<group>"; }; 9600 9612 41AD75391CEF6BCE00A31486 /* FetchOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchOptions.h; sourceTree = "<group>"; }; 9613 41AF37881F8C1E7900111C31 /* FetchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchEvent.h; sourceTree = "<group>"; }; 9614 41AF378A1F8C1E7A00111C31 /* ExtendableEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtendableEvent.h; sourceTree = "<group>"; }; 9615 41AF378D1F8C1E7B00111C31 /* FetchEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchEvent.idl; sourceTree = "<group>"; }; 9616 41AF378E1F8C1E7C00111C31 /* ExtendableEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ExtendableEvent.idl; sourceTree = "<group>"; }; 9617 41AF37921F8DA48A00111C31 /* ExtendableEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtendableEvent.cpp; sourceTree = "<group>"; }; 9618 41AF37941F8DA49500111C31 /* FetchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchEvent.cpp; sourceTree = "<group>"; }; 9619 41AF379C1F8DB1B100111C31 /* JSDOMPromise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPromise.cpp; sourceTree = "<group>"; }; 9601 9620 41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointConfiguration.h; sourceTree = "<group>"; }; 9602 9621 41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointConfiguration.cpp; sourceTree = "<group>"; }; … … 11694 11713 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = "<group>"; }; 11695 11714 7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamSource.cpp; sourceTree = "<group>"; }; 11715 7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSFetchEvent.cpp; sourceTree = "<group>"; }; 11716 7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSExtendableEvent.cpp; sourceTree = "<group>"; }; 11717 7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSExtendableEventInit.cpp; sourceTree = "<group>"; }; 11696 11718 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = "<group>"; }; 11697 11719 7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamSource.h; sourceTree = "<group>"; }; 11720 7E4C96D91AD4483500365A52 /* JSFetchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchEvent.h; sourceTree = "<group>"; }; 11721 7E4C96D91AD4483500365A53 /* JSExtendableEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExtendableEvent.h; sourceTree = "<group>"; }; 11698 11722 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskCacheMonitorCocoa.mm; sourceTree = "<group>"; }; 11699 11723 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESElementIndexUint.cpp; sourceTree = "<group>"; }; … … 19103 19127 isa = PBXGroup; 19104 19128 children = ( 19129 7E4C96D91AD4483500365A53 /* JSExtendableEvent.h */, 19130 7E4C96D91AD4483500365A52 /* JSFetchEvent.h */, 19105 19131 51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */, 19106 19132 51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */, … … 19115 19141 51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */, 19116 19142 51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */, 19143 7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */, 19144 7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */, 19145 7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */, 19117 19146 ); 19118 19147 name = ServiceWorkers; … … 19182 19211 517C87071F8E8FF200EB8076 /* context */, 19183 19212 517A52EC1F47532D00DCDC0A /* server */, 19213 41AF37921F8DA48A00111C31 /* ExtendableEvent.cpp */, 19214 41AF378A1F8C1E7A00111C31 /* ExtendableEvent.h */, 19215 41AF378E1F8C1E7C00111C31 /* ExtendableEvent.idl */, 19216 4131F3B41F955BC30059995A /* ExtendableEventInit.h */, 19217 4131F3B51F955BC50059995A /* ExtendableEventInit.idl */, 19218 41AF37941F8DA49500111C31 /* FetchEvent.cpp */, 19219 41AF37881F8C1E7900111C31 /* FetchEvent.h */, 19220 41AF378D1F8C1E7B00111C31 /* FetchEvent.idl */, 19184 19221 51F1755B1F3EBC0C00C74950 /* ServiceWorker.cpp */, 19185 19222 51F1755A1F3EBC0C00C74950 /* ServiceWorker.h */, … … 20362 20399 children = ( 20363 20400 DEC2975D1B4DEB2A005F5945 /* JSCustomEventCustom.cpp */, 20401 4131F3B11F9552810059995A /* JSFetchEventCustom.cpp */, 20364 20402 BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */, 20365 20403 410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */, … … 24249 24287 7C8139A41ED6281D00CE26E8 /* JSDOMOperation.h */, 24250 24288 7C8139A51ED6281D00CE26E8 /* JSDOMOperationReturningPromise.h */, 24289 41AF379C1F8DB1B100111C31 /* JSDOMPromise.cpp */, 24251 24290 E37C864F1EB63E2D0087C6CA /* JSDOMPromise.h */, 24252 24291 E172AF8D1811BC3700FBADB9 /* JSDOMPromiseDeferred.cpp */, … … 28686 28725 46B63F6C1C6E8D19002E914B /* JSEventTargetCustom.h in Headers */, 28687 28726 724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */, 28727 7E4C96DD1AD4483500365A53 /* JSExtendableEvent.h in Headers */, 28688 28728 5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */, 28689 28729 7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */, … … 28692 28732 77D510131ED5F4ED00DA4C87 /* JSFederatedCredentialRequestOptions.h in Headers */, 28693 28733 7F4C96DD1AD4483500365A50 /* JSFetchBody.h in Headers */, 28734 7E4C96DD1AD4483500365A52 /* JSFetchEvent.h in Headers */, 28694 28735 7D4C96DD1AD4483500365A50 /* JSFetchHeaders.h in Headers */, 28695 28736 7CE191711F2ABE7100272F78 /* JSFetchReferrerPolicy.h in Headers */, … … 31995 32036 51F645A41F4C001700B54DED /* ExceptionData.cpp in Sources */, 31996 32037 724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */, 32038 41AF37991F8DADAA00111C31 /* ExtendableEvent.cpp in Sources */, 31997 32039 31DCDF431DA1C45400EA5B93 /* ExtendedColor.cpp in Sources */, 31998 32040 6E67D2A61280E8A4008758F7 /* Extensions3DOpenGL.cpp in Sources */, … … 32023 32065 4147E2B81C89912F00A7E715 /* FetchBodyOwner.cpp in Sources */, 32024 32066 413015D91C7B571400091C6F /* FetchBodySource.cpp in Sources */, 32067 41AF379B1F8DADAE00111C31 /* FetchEvent.cpp in Sources */, 32025 32068 41F54F8D1C50C50800338488 /* FetchHeaders.cpp in Sources */, 32026 32069 4147E2B71C89912C00A7E715 /* FetchLoader.cpp in Sources */, … … 32671 32714 0F4966AC1DB40C4300A274BB /* JSDOMPointInit.cpp in Sources */, 32672 32715 0F4966AE1DB40C4300A274BB /* JSDOMPointReadOnly.cpp in Sources */, 32716 41AF379D1F8DB1B500111C31 /* JSDOMPromise.cpp in Sources */, 32673 32717 E172AF8F1811BC3700FBADB9 /* JSDOMPromiseDeferred.cpp in Sources */, 32674 32718 0FF3B9281EE3B6DE00B84144 /* JSDOMQuad.cpp in Sources */, … … 32719 32763 77D510141ED5F4F100DA4C87 /* JSFederatedCredentialRequestOptions.cpp in Sources */, 32720 32764 7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */, 32765 4131F3B31F9552860059995A /* JSFetchEventCustom.cpp in Sources */, 32721 32766 7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */, 32722 32767 7CE191701F2ABE7100272F78 /* JSFetchReferrerPolicy.cpp in Sources */, … … 34583 34628 9B0811241F67CDC00074BDE2 /* WebContentReaderIOS.mm in Sources */, 34584 34629 9B9299AE1F67865B006723C2 /* WebContentReaderMac.mm in Sources */, 34630 7E4C96DC1AD4483500365A53 /* WebCore/JSExtendableEvent.cpp in Sources */, 34631 7E4C96DC1AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp in Sources */, 34632 7E4C96DC1AD4483500365A52 /* WebCore/JSFetchEvent.cpp in Sources */, 34585 34633 CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */, 34586 34634 2D3EF44B1917915C00034184 /* WebCoreCALayerExtras.mm in Sources */, -
trunk/Source/WebCore/bindings/js/JSDOMPromise.h
r216501 r223562 34 34 class DOMPromise : public DOMGuarded<JSC::JSPromise> { 35 35 public: 36 static Ref<DOMPromise> create(JSC::ExecState&, JSC::JSValue); 36 37 static Ref<DOMPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 37 38 { … … 45 46 } 46 47 48 void whenSettled(std::function<void()>&&); 49 JSC::JSValue result() const; 50 51 enum class Status { Pending, Fulfilled, Rejected }; 52 Status status() const; 53 47 54 private: 48 55 DOMPromise(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r223328 r223562 44 44 macro(DataTransferItemList) \ 45 45 macro(DocumentTimeline) \ 46 macro(ExtendableEvent) \ 46 47 macro(FederatedCredential) \ 48 macro(FetchEvent) \ 47 49 macro(FileSystem) \ 48 50 macro(FileSystemDirectoryEntry) \ -
trunk/Source/WebCore/dom/EventNames.in
r223193 r223562 11 11 CompositionEvent 12 12 CustomEvent 13 ExtendableEvent conditional=SERVICE_WORKER 13 14 ErrorEvent 15 FetchEvent conditional=SERVICE_WORKER 14 16 FocusEvent 15 17 HashChangeEvent -
trunk/Source/WebCore/testing/Internals.cpp
r223476 r223562 58 58 #include "Element.h" 59 59 #include "EventHandler.h" 60 #include "ExtendableEvent.h" 60 61 #include "ExtensionStyleSheets.h" 61 #include "Fetch Response.h"62 #include "FetchEvent.h" 62 63 #include "File.h" 63 64 #include "FontCache.h" … … 88 89 #include "IntRect.h" 89 90 #include "InternalSettings.h" 91 #include "JSFetchResponse.h" 90 92 #include "JSImageData.h" 91 93 #include "LibWebRTCProvider.h" … … 4196 4198 } 4197 4199 4200 #if ENABLE(SERVICE_WORKER) 4201 void Internals::waitForFetchEventToFinish(FetchEvent& event, DOMPromiseDeferred<IDLInterface<FetchResponse>>&& promise) 4202 { 4203 event.onResponse([promise = WTFMove(promise), event = makeRef(event)] () mutable { 4204 if (auto* response = event->response()) 4205 promise.resolve(*response); 4206 else 4207 promise.reject(TypeError, ASCIILiteral("fetch event responded with error")); 4208 }); 4209 } 4210 4211 void Internals::waitForExtendableEventToFinish(ExtendableEvent& event, DOMPromiseDeferred<void>&& promise) 4212 { 4213 event.onFinishedWaitingForTesting([promise = WTFMove(promise)] () mutable { 4214 promise.resolve(); 4215 }); 4216 } 4217 4218 Ref<ExtendableEvent> Internals::createTrustedExtendableEvent() 4219 { 4220 return ExtendableEvent::create("ExtendableEvent", { }, Event::IsTrusted::Yes); 4221 } 4222 #endif 4223 4198 4224 } // namespace WebCore -
trunk/Source/WebCore/testing/Internals.h
r223073 r223562 51 51 class Document; 52 52 class Element; 53 class ExtendableEvent; 54 class FetchEvent; 53 55 class FetchResponse; 54 56 class File; … … 607 609 void setConsoleMessageListener(RefPtr<StringCallback>&&); 608 610 611 #if ENABLE(SERVICE_WORKER) 612 void waitForFetchEventToFinish(FetchEvent&, DOMPromiseDeferred<IDLInterface<FetchResponse>>&&); 613 void waitForExtendableEventToFinish(ExtendableEvent&, DOMPromiseDeferred<void>&&); 614 Ref<ExtendableEvent> createTrustedExtendableEvent(); 615 #endif 616 609 617 private: 610 618 explicit Internals(Document&); -
trunk/Source/WebCore/testing/Internals.idl
r223073 r223562 554 554 555 555 DOMString audioSessionCategory(); 556 }; 556 557 [Conditional=SERVICE_WORKER] Promise<Response> waitForFetchEventToFinish(FetchEvent event); 558 [Conditional=SERVICE_WORKER] Promise<void> waitForExtendableEventToFinish(ExtendableEvent event); 559 [Conditional=SERVICE_WORKER] ExtendableEvent createTrustedExtendableEvent(); 560 }; -
trunk/Source/WebCore/workers/service/ExtendableEvent.h
r223560 r223562 1 1 /* 2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Yusuke Suzuki <utatane.tea@gmail.com>. 2 * Copyright (C) 2017 Apple Inc. All rights reserved. 4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 27 26 #pragma once 28 27 29 #include "JSDOMGuardedObject.h" 30 #include <runtime/JSPromise.h> 28 #if ENABLE(SERVICE_WORKER) 29 30 #include "Event.h" 31 #include "ExtendableEventInit.h" 32 #include "JSDOMPromise.h" 33 #include <wtf/WeakPtr.h> 31 34 32 35 namespace WebCore { 33 36 34 class DOMPromise : public DOMGuarded<JSC::JSPromise>{37 class ExtendableEvent : public Event { 35 38 public: 36 static Ref< DOMPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise)39 static Ref<ExtendableEvent> create(const AtomicString& type, const ExtendableEventInit& initializer, IsTrusted isTrusted = IsTrusted::No) 37 40 { 38 return adoptRef(*new DOMPromise(globalObject, promise));41 return adoptRef(*new ExtendableEvent(type, initializer, isTrusted)); 39 42 } 40 43 41 JSC::JSPromise* promise() const 42 { 43 ASSERT(!isSuspended()); 44 return guarded(); 45 } 44 EventInterface eventInterface() const override { return ExtendableEventInterfaceType; } 45 46 ExceptionOr<void> waitUntil(JSC::ExecState&, JSC::JSValue); 47 48 WEBCORE_EXPORT void onFinishedWaitingForTesting(WTF::Function<void()>&&); 49 50 protected: 51 WEBCORE_EXPORT ExtendableEvent(const AtomicString&, const ExtendableEventInit&, IsTrusted); 52 53 WeakPtr<ExtendableEvent> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(*this); } 54 55 void addPendingPromise(Ref<DOMPromise>&&); 46 56 47 57 private: 48 DOMPromise(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 49 : DOMGuarded<JSC::JSPromise>(globalObject, promise) 50 { 51 } 58 HashSet<Ref<DOMPromise>> m_pendingPromises; 59 WeakPtrFactory<ExtendableEvent> m_weakPtrFactory; 60 WTF::Function<void()> m_onFinishedWaitingForTesting; 52 61 }; 53 62 54 63 } // namespace WebCore 64 65 #endif // ENABLE(SERVICE_WORKER) -
trunk/Source/WebCore/workers/service/ExtendableEventInit.h
r223560 r223562 1 1 /* 2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Yusuke Suzuki <utatane.tea@gmail.com>. 2 * Copyright (C) 2017 Apple Inc. All rights reserved. 4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 27 26 #pragma once 28 27 29 #include "JSDOMGuardedObject.h" 30 #include <runtime/JSPromise.h> 28 #if ENABLE(SERVICE_WORKER) 29 30 #include "Event.h" 31 31 32 32 namespace WebCore { 33 33 34 class DOMPromise : public DOMGuarded<JSC::JSPromise> { 35 public: 36 static Ref<DOMPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 37 { 38 return adoptRef(*new DOMPromise(globalObject, promise)); 39 } 40 41 JSC::JSPromise* promise() const 42 { 43 ASSERT(!isSuspended()); 44 return guarded(); 45 } 46 47 private: 48 DOMPromise(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 49 : DOMGuarded<JSC::JSPromise>(globalObject, promise) 50 { 51 } 34 struct ExtendableEventInit : EventInit { 52 35 }; 53 36 54 37 } // namespace WebCore 38 39 #endif // ENABLE(SERVICE_WORKER) -
trunk/Source/WebCore/workers/service/ExtendableEventInit.idl
r223560 r223562 1 1 /* 2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Yusuke Suzuki <utatane.tea@gmail.com>. 2 * Copyright (C) 2017 Apple Inc. All rights reserved. 4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 25 24 */ 26 25 27 #pragma once 28 29 #include "JSDOMGuardedObject.h" 30 #include <runtime/JSPromise.h> 31 32 namespace WebCore { 33 34 class DOMPromise : public DOMGuarded<JSC::JSPromise> { 35 public: 36 static Ref<DOMPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 37 { 38 return adoptRef(*new DOMPromise(globalObject, promise)); 39 } 40 41 JSC::JSPromise* promise() const 42 { 43 ASSERT(!isSuspended()); 44 return guarded(); 45 } 46 47 private: 48 DOMPromise(JSDOMGlobalObject& globalObject, JSC::JSPromise& promise) 49 : DOMGuarded<JSC::JSPromise>(globalObject, promise) 50 { 51 } 26 [ 27 Conditional=SERVICE_WORKER, 28 ] 29 dictionary ExtendableEventInit : EventInit { 52 30 }; 53 54 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.