Changeset 225296 in webkit
- Timestamp:
- Nov 29, 2017, 2:19:23 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r225281 r225296 1 2017-11-29 Chris Dumez <cdumez@apple.com> 2 3 Start exposing self.registration inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=180162 5 6 Reviewed by Brady Eidson. 7 8 Add layout test coverage. 9 10 * TestExpectations: 11 Skip test that covers self.registration.update() because it now times out. We do not support update() 12 on registrations inside service workers yet so the test times out waiting for the updatefound event 13 on the registration. 14 15 * http/tests/workers/service/ServiceWorkerGlobalScope_registration_SameObject-expected.txt: Added. 16 * http/tests/workers/service/ServiceWorkerGlobalScope_registration_SameObject.html: Added. 17 * http/tests/workers/service/resources/ServiceWorkerGlobalScope_registration_SameObject-worker.js: Added. 18 * http/tests/workers/service/resources/self_registration-worker.js: Added. 19 * http/tests/workers/service/self_registration-expected.txt: Added. 20 * http/tests/workers/service/self_registration.html: Added. 21 1 22 2017-11-29 Javier M. Mellid <jmunhoz@igalia.com> 2 23 -
trunk/LayoutTests/TestExpectations
r225269 r225296 147 147 imported/w3c/web-platform-tests/fetch/api/abort/general-serviceworker.https.html [ Skip ] 148 148 imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https.html [ Skip ] 149 imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https.html [ Skip ]150 149 imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https.html [ Skip ] 150 imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/update.https.html [ Skip ] 151 151 imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-on-evaluation.https.html [ Skip ] 152 152 imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html [ Skip ] … … 169 169 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/redirect.https.html [ Skip ] 170 170 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/request-headers.https.html [ Skip ] 171 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html [ Skip ] 171 172 imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https.html [ Skip ] 172 173 imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-msgport-to-client.https.html [ Skip ] … … 195 196 imported/w3c/web-platform-tests/service-workers/service-worker/multiple-update.https.html [ Pass Failure ] 196 197 imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html [ Pass Failure ] 197 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html [ Pass Failure ]198 198 webkit.org/b/179452 imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html [ Pass Failure ] 199 199 webkit.org/b/179194 imported/w3c/web-platform-tests/service-workers/service-worker/registration-mime-types.https.html [ Pass Failure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r225294 r225296 1 2017-11-29 Chris Dumez <cdumez@apple.com> 2 3 Start exposing self.registration inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=180162 5 6 Reviewed by Brady Eidson. 7 8 * web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt: 9 1 10 2017-11-29 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt
r224730 r225296 1 1 2 Harness Error (TIMEOUT), message = null3 2 4 FAIL Verify registration attributes on ServiceWorkerGlobalScope assert_ unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.scope') Reached unreachable code5 FAIL Verify registration attributes on ServiceWorkerGlobalScope of the newer worker assert_unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.scope') Reached unreachable code3 FAIL Verify registration attributes on ServiceWorkerGlobalScope assert_equals: Service Worker should respond to fetch expected "updatefound,install,statechange(installed),statechange(activating),activate,statechange(activated),fetch" but got "{\"error\": {\"message\": \"\", \"code\": 404}}" 4 FAIL Verify registration attributes on ServiceWorkerGlobalScope of the newer worker promise_test: Unhandled rejection with value: object "Error: wait_for_state must be passed a ServiceWorker" 6 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https-expected.txt
r224724 r225296 2 2 Harness Error (TIMEOUT), message = null 3 3 4 FAIL Unregister on script evaluation assert_unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.unregister') Reached unreachable code 5 TIMEOUT Unregister on installing event Test timed out 4 TIMEOUT Unregister on script evaluation Test timed out 5 NOTRUN Unregister on installing event 6 6 NOTRUN Unregister on activate event 7 7 NOTRUN Unregister controlling service worker -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/update.https-expected.txt
r224724 r225296 1 1 2 FAIL Update a registration on ServiceWorkerGlobalScope assert_unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.addEventListener') Reached unreachable code3 2 3 Harness Error (TIMEOUT), message = null 4 5 TIMEOUT Update a registration on ServiceWorkerGlobalScope Test timed out 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt
r224923 r225296 1 CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: TypeError: null is not an object (evaluating 'self.registration.scope') 2 CONSOLE MESSAGE: line 50: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'registrations[0].unregister') 1 3 2 3 Harness Error (TIMEOUT), message = null 4 4 5 FAIL Normal redirect to same-origin scope. assert_unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.scope') Reached unreachable code6 FAIL Normal redirect to other-origin scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"7 FAIL SW-fallbacked redirect to same-origin out-scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"8 FAIL SW-fallbacked redirect to same-origin same-scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"9 FAIL SW-fallbacked redirect to same-origin other-scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"10 FAIL SW-fallbacked redirect to other-origin out-scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"11 FAIL SW-fallbacked redirect to other-origin in-scope. promise_test: Unhandled rejection with value: object " TypeError: undefined is not an object (evaluating 'registration.active')"12 FAIL SW-generated redirect to same-origin out-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 13 FAIL SW-generated redirect to same-origin same-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 14 FAIL SW-generated redirect to same-origin other-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 15 FAIL SW-generated redirect to other-origin out-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 16 FAIL SW-generated redirect to other-origin in-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 17 FAIL SW-fetched redirect to same-origin out-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 18 FAIL SW-fetched redirect to same-origin same-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 19 FAIL SW-fetched redirect to same-origin other-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 20 FAIL SW-fetched redirect to other-origin out-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 21 FAIL SW-fetched redirect to other-origin in-scope. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 22 FAIL Redirect to same-origin out-scope with opaque redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 23 FAIL Redirect to same-origin same-scope with opaque redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 24 FAIL Redirect to same-origin other-scope with opaque redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 25 FAIL Redirect to other-origin out-scope with opaque redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 26 FAIL Redirect to other-origin in-scope with opaque redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 27 FAIL No location redirect response. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 28 FAIL Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 29 FAIL Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 30 FAIL Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 31 FAIL Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 32 FAIL Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 33 FAIL No location redirect response via Cache. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.active')" 5 FAIL Normal redirect to same-origin scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 6 FAIL Normal redirect to other-origin scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 7 FAIL SW-fallbacked redirect to same-origin out-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 8 FAIL SW-fallbacked redirect to same-origin same-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 9 FAIL SW-fallbacked redirect to same-origin other-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 10 FAIL SW-fallbacked redirect to other-origin out-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 11 FAIL SW-fallbacked redirect to other-origin in-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 12 TIMEOUT SW-generated redirect to same-origin out-scope. Test timed out 13 NOTRUN SW-generated redirect to same-origin same-scope. 14 NOTRUN SW-generated redirect to same-origin other-scope. 15 NOTRUN SW-generated redirect to other-origin out-scope. 16 NOTRUN SW-generated redirect to other-origin in-scope. 17 NOTRUN SW-fetched redirect to same-origin out-scope. 18 NOTRUN SW-fetched redirect to same-origin same-scope. 19 NOTRUN SW-fetched redirect to same-origin other-scope. 20 NOTRUN SW-fetched redirect to other-origin out-scope. 21 NOTRUN SW-fetched redirect to other-origin in-scope. 22 NOTRUN Redirect to same-origin out-scope with opaque redirect response. 23 NOTRUN Redirect to same-origin same-scope with opaque redirect response. 24 NOTRUN Redirect to same-origin other-scope with opaque redirect response. 25 NOTRUN Redirect to other-origin out-scope with opaque redirect response. 26 NOTRUN Redirect to other-origin in-scope with opaque redirect response. 27 NOTRUN No location redirect response. 28 NOTRUN Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. 29 NOTRUN Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. 30 NOTRUN Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. 31 NOTRUN Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. 32 NOTRUN Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. 33 NOTRUN No location redirect response via Cache. 34 34 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt
r224723 r225296 1 1 2 FAIL initialize global state (service worker registration and caches) assert_unreached: unregister and register should not fail: TypeError: null is not an object (evaluating 'self.registration.scope') Reached unreachable code 3 FAIL mode: "follow", non-intercepted request, no server redirect promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 4 FAIL mode: "follow", non-intercepted request promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 5 FAIL mode: "manual", non-intercepted request promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 6 FAIL mode: "error", non-intercepted request promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 7 FAIL mode: "follow", no mode change, no server redirect promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 8 FAIL mode: "follow", no mode change promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 9 FAIL mode: "error", mode change: "follow" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 10 FAIL mode: "manual", mode change: "follow" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 11 FAIL mode: "follow", mode change: "manual" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 12 FAIL mode: "error", mode change: "manual" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 13 FAIL mode: "manual", no mode change promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 14 FAIL mode: "follow", generated redirect response promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 15 FAIL mode: "error", generated redirect response promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 16 FAIL mode: "manual", generated redirect response promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 17 FAIL Fetch should follow the redirect response 20 times promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 18 FAIL Fetch should not follow the redirect response 21 times. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'registration.installing')" 19 FAIL restore global state (service worker registration) undefined is not an object (evaluating 'registration.unregister') 2 FAIL initialize global state (service worker registration and caches) promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 3 FAIL mode: "follow", non-intercepted request, no server redirect promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 4 FAIL mode: "follow", non-intercepted request promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 5 FAIL mode: "manual", non-intercepted request promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 6 FAIL mode: "error", non-intercepted request promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 7 FAIL mode: "follow", no mode change, no server redirect promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 8 FAIL mode: "follow", no mode change promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 9 FAIL mode: "error", mode change: "follow" promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 10 FAIL mode: "manual", mode change: "follow" promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 11 FAIL mode: "follow", mode change: "manual" promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 12 FAIL mode: "error", mode change: "manual" promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 13 FAIL mode: "manual", no mode change promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 14 FAIL mode: "follow", generated redirect response promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 15 FAIL mode: "error", generated redirect response promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 16 FAIL mode: "manual", generated redirect response promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 17 FAIL Fetch should follow the redirect response 20 times promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 18 FAIL Fetch should not follow the redirect response 21 times. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported" 19 PASS restore global state (service worker registration) 20 PASS restore global state (caches) 20 21 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/register-foreign-fetch-errors.https-expected.txt
r224663 r225296 1 1 2 2 PASS foreign fetch registration 3 FAIL Untitled TypeError: null is not an object (evaluating 'registration.scope') 3 PASS Invalid options 4 PASS Scopes not an array 5 PASS Scopes not a string in array 6 PASS Relative url not under scope 7 PASS Absolute url not under scope 8 PASS Empty scope array 9 FAIL Call after event returned assert_throws: function "function () { 10 event.registerForeignFetch({scopes: [scope], origins: ['*']}); 11 }" threw object "TypeError: event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({scopes: [scope], origins: ['*']})', 'event.registerForeignFetch' is undefined)" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11 12 FAIL Valid scopes with wildcard origin string event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({scopes: [scope], origins: ['*']})', 'event.registerForeignFetch' is undefined) 13 FAIL Absolute urls event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({scopes: [scope, scope + '/foo'], origins: ['*']})', 'event.registerForeignFetch' is undefined) 14 FAIL Relative urls undefined is not a function (near '...event.registerForeignFetch...') 15 PASS No origins specified 16 PASS Origins not a string or array 17 PASS Origins contains something not a string 18 PASS Origin not an absolute URL 19 FAIL Wildcard origin string in array event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({scopes: [scope], origins: ['*']})', 'event.registerForeignFetch' is undefined) 20 PASS Origin string 21 FAIL Origin string in array event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({scopes: [scope], origins: ['https://example.com/']})', 'event.registerForeignFetch' is undefined) 22 FAIL Array with multiple origins event.registerForeignFetch is not a function. (In 'event.registerForeignFetch({ 23 scopes: [scope], origins: ['https://example.com/', 'https://chromium.org']})', 'event.registerForeignFetch' is undefined) 24 PASS Origins includes wildcard and other strings 25 PASS Origins includes other strings and wildcard 4 26 -
trunk/Source/WebCore/ChangeLog
r225294 r225296 1 2017-11-29 Chris Dumez <cdumez@apple.com> 2 3 Start exposing self.registration inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=180162 5 6 Reviewed by Brady Eidson. 7 8 Start exposing self.registration inside service workers as per: 9 - https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-interface 10 11 This is very initial support: 12 - The operations on the registration (such as update) will reject the promise for now. 13 - The registration's service workers are not yet populated. 14 15 This will be implemented in a follow-up. 16 17 Tests: http/tests/workers/service/ServiceWorkerGlobalScope_registration_SameObject.html 18 http/tests/workers/service/self_registration.html 19 20 * bindings/js/JSServiceWorkerGlobalScopeCustom.cpp: 21 (WebCore::JSServiceWorkerGlobalScope::visitAdditionalChildren): 22 * workers/service/ServiceWorkerContainer.cpp: 23 (WebCore::ServiceWorkerContainer::addRegistration): 24 * workers/service/ServiceWorkerContextData.cpp: 25 (WebCore::ServiceWorkerContextData::isolatedCopy const): 26 * workers/service/ServiceWorkerContextData.h: 27 (WebCore::ServiceWorkerContextData::encode const): 28 (WebCore::ServiceWorkerContextData::decode): 29 * workers/service/ServiceWorkerGlobalScope.cpp: 30 (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope): 31 * workers/service/ServiceWorkerGlobalScope.h: 32 (WebCore::ServiceWorkerGlobalScope::registration): 33 * workers/service/server/SWServer.cpp: 34 (WebCore::SWServer::updateWorker): 35 (WebCore::SWServer::installContextData): 36 * workers/service/server/SWServer.h: 37 * workers/service/server/SWServerJobQueue.cpp: 38 (WebCore::SWServerJobQueue::scriptFetchFinished): 39 1 40 2017-11-29 Youenn Fablet <youenn@apple.com> 2 41 -
trunk/Source/WebCore/bindings/js/JSServiceWorkerGlobalScopeCustom.cpp
r225249 r225296 38 38 { 39 39 visitor.addOpaqueRoot(&wrapped().clients()); 40 visitor.addOpaqueRoot( wrapped().registration());40 visitor.addOpaqueRoot(&wrapped().registration()); 41 41 } 42 42 -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r225283 r225296 423 423 void ServiceWorkerContainer::addRegistration(ServiceWorkerRegistration& registration) 424 424 { 425 m_swConnection->addServiceWorkerRegistrationInServer(registration.identifier());425 ensureSWClientConnection().addServiceWorkerRegistrationInServer(registration.identifier()); 426 426 m_registrations.add(registration.identifier(), ®istration); 427 427 } -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp
r225031 r225296 33 33 ServiceWorkerContextData ServiceWorkerContextData::isolatedCopy() const 34 34 { 35 return { jobDataIdentifier, registration Key.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), scriptURL.isolatedCopy(), workerType };35 return { jobDataIdentifier, registration.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), scriptURL.isolatedCopy(), workerType }; 36 36 } 37 37 -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h
r225031 r225296 28 28 #include "ServiceWorkerIdentifier.h" 29 29 #include "ServiceWorkerJobDataIdentifier.h" 30 #include "ServiceWorkerRegistration Key.h"30 #include "ServiceWorkerRegistrationData.h" 31 31 #include "URL.h" 32 32 #include "WorkerType.h" … … 38 38 struct ServiceWorkerContextData { 39 39 ServiceWorkerJobDataIdentifier jobDataIdentifier; 40 ServiceWorkerRegistration Key registrationKey;40 ServiceWorkerRegistrationData registration; 41 41 ServiceWorkerIdentifier serviceWorkerIdentifier; 42 42 String script; … … 53 53 void ServiceWorkerContextData::encode(Encoder& encoder) const 54 54 { 55 encoder << jobDataIdentifier << registration Key<< serviceWorkerIdentifier << script << scriptURL << workerType;55 encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << scriptURL << workerType; 56 56 } 57 57 … … 64 64 return std::nullopt; 65 65 66 auto registrationKey = ServiceWorkerRegistrationKey::decode(decoder); 67 if (!registrationKey) 66 std::optional<ServiceWorkerRegistrationData> registration; 67 decoder >> registration; 68 if (!registration) 68 69 return std::nullopt; 69 70 … … 84 85 return std::nullopt; 85 86 86 return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration Key), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(scriptURL), workerType }};87 return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(scriptURL), workerType }}; 87 88 } 88 89 -
trunk/Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp
r224801 r225296 31 31 #include "ServiceWorkerClients.h" 32 32 #include "ServiceWorkerThread.h" 33 #include "WorkerNavigator.h" 33 34 34 35 namespace WebCore { … … 37 38 : WorkerGlobalScope(url, identifier, userAgent, isOnline, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID) 38 39 , m_contextData(crossThreadCopy(data)) 40 , m_registration(ServiceWorkerRegistration::getOrCreate(*this, navigator().serviceWorker(), WTFMove(m_contextData.registration))) 39 41 , m_clients(ServiceWorkerClients::create(*this)) 40 42 { … … 42 44 43 45 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() = default; 44 45 ServiceWorkerRegistration* ServiceWorkerGlobalScope::registration()46 {47 // FIXME: implement this.48 return nullptr;49 }50 46 51 47 void ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) -
trunk/Source/WebCore/workers/service/ServiceWorkerGlobalScope.h
r224801 r225296 50 50 51 51 ServiceWorkerClients& clients() { return m_clients.get(); } 52 ServiceWorkerRegistration * registration();52 ServiceWorkerRegistration& registration() { return m_registration.get(); } 53 53 54 54 void skipWaiting(Ref<DeferredPromise>&&); … … 62 62 63 63 ServiceWorkerContextData m_contextData; 64 Ref<ServiceWorkerRegistration> m_registration; 64 65 Ref<ServiceWorkerClients> m_clients; 65 66 }; -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r225251 r225296 345 345 } 346 346 347 void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, const ServiceWorkerRegistrationKey& registrationKey, const URL& url, const String& script, WorkerType type)347 void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const String& script, WorkerType type) 348 348 { 349 349 auto serviceWorkerIdentifier = generateServiceWorkerIdentifier(); 350 350 351 ServiceWorkerContextData data = { jobDataIdentifier, registration Key, serviceWorkerIdentifier, script, url, type };351 ServiceWorkerContextData data = { jobDataIdentifier, registration.data(), serviceWorkerIdentifier, script, url, type }; 352 352 353 353 // Right now we only ever keep up to one connection to one SW context process. … … 376 376 ASSERT(connection); 377 377 378 auto* registration = m_registrations.get(data.registration Key);378 auto* registration = m_registrations.get(data.registration.key); 379 379 RELEASE_ASSERT(registration); 380 380 -
trunk/Source/WebCore/workers/service/server/SWServer.h
r225251 r225296 122 122 void postTaskReply(CrossThreadTask&&); 123 123 124 void updateWorker(Connection&, const ServiceWorkerJobDataIdentifier&, const ServiceWorkerRegistrationKey&, const URL&, const String& script, WorkerType);124 void updateWorker(Connection&, const ServiceWorkerJobDataIdentifier&, SWServerRegistration&, const URL&, const String& script, WorkerType); 125 125 void terminateWorker(SWServerWorker&); 126 126 void fireInstallEvent(SWServerWorker&); -
trunk/Source/WebCore/workers/service/server/SWServerJobQueue.cpp
r225031 r225296 88 88 89 89 // FIXME: Support the proper worker type (classic vs module) 90 m_server.updateWorker(connection, job.identifier(), m_registrationKey, job.scriptURL, result.script, WorkerType::Classic);90 m_server.updateWorker(connection, job.identifier(), *registration, job.scriptURL, result.script, WorkerType::Classic); 91 91 } 92 92
Note:
See TracChangeset
for help on using the changeset viewer.