Changeset 221699 in webkit
- Timestamp:
- Sep 6, 2017 1:40:01 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r221695 r221699 1 2017-09-06 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r221461. 4 5 The LayoutTest added with this change crashes under 6 GuardMalloc. 7 8 Reverted changeset: 9 10 "Add (entirely incorrect) fetching of ServiceWorker scripts." 11 https://bugs.webkit.org/show_bug.cgi?id=176179 12 http://trac.webkit.org/changeset/221461 13 1 14 2017-09-06 Devin Rousso <webkit@devinrousso.com> 2 15 -
trunk/LayoutTests/http/tests/workers/service/basic-register-expected.txt
r221461 r221699 1 CONSOLE MESSAGE: line 10: Registration failed with error: UnknownError: Script URL http://127.0.0.1:8000/workers/service/resources/empty-worker.js fetched with 41 bytes, but we're not using the result yet 2 CONSOLE MESSAGE: line 21: Registration failed with error: UnknownError: Script URL http://127.0.0.1:8000/workers/service/resources/empty-worker-doesnt-exist.js fetch resulted in error: ServiceWorker script network fetch failed with HTTP status code 404 1 CONSOLE MESSAGE: line 11: Registration failed with error: UnknownError: serviceWorker job scheduling is not yet implemented 3 2 -
trunk/LayoutTests/http/tests/workers/service/resources/basic-register.js
r221461 r221699 5 5 6 6 navigator.serviceWorker.register("resources/empty-worker.js", { }) 7 .then(function(r) {8 console.log("Registered!");9 }, function(e) {10 console.log("Registration failed with error: " + e);11 })12 .catch(function(e) {13 console.log("Exception registering: " + e);14 });15 16 navigator.serviceWorker.register("resources/empty-worker-doesnt-exist.js", { })17 7 .then(function(r) { 18 8 console.log("Registered!"); -
trunk/LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js
r221461 r221699 49 49 done(); 50 50 }, function(e) { 51 if (e+"" != "UnknownError: Script URL http://127.0.0.1:8000/workers/service/resources/empty-worker.js fetched with 41 bytes, but we're not using the result yet") {52 alert("Unexpected error received from server : " + e);51 if (e+"" != "UnknownError: serviceWorker job scheduling is not yet implemented") { 52 alert("Unexpected error received from server"); 53 53 finishSWTest(); 54 54 } -
trunk/Source/WebCore/ChangeLog
r221695 r221699 1 2017-09-06 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r221461. 4 5 The LayoutTest added with this change crashes under 6 GuardMalloc. 7 8 Reverted changeset: 9 10 "Add (entirely incorrect) fetching of ServiceWorker scripts." 11 https://bugs.webkit.org/show_bug.cgi?id=176179 12 http://trac.webkit.org/changeset/221461 13 1 14 2017-09-06 Devin Rousso <webkit@devinrousso.com> 2 15 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r221695 r221699 2307 2307 517A534E1F54A8BA00DCDC0A /* ServiceWorkerRegistrationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517A534B1F549D4A00DCDC0A /* ServiceWorkerRegistrationData.cpp */; }; 2308 2308 517A534F1F54A8BA00DCDC0A /* ServiceWorkerRegistrationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A534C1F549D4A00DCDC0A /* ServiceWorkerRegistrationData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2309 517A53581F5889E800DCDC0A /* FetchLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4147E2B61C89912600A7E715 /* FetchLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };2310 517A535A1F5889EF00DCDC0A /* FetchLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4147E2B51C89912600A7E715 /* FetchLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };2311 517A535B1F588A4C00DCDC0A /* FetchBodyConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = 41CF8BE51D46222000707DC9 /* FetchBodyConsumer.h */; settings = {ATTRIBUTES = (Private, ); }; };2312 517A535D1F5899FE00DCDC0A /* ServiceWorkerFetchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A535C1F5899F200DCDC0A /* ServiceWorkerFetchResult.h */; settings = {ATTRIBUTES = (Private, ); }; };2313 2309 517A63C31B74318700E7DCDC /* KeyedDecoderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517A63BF1B74317E00E7DCDC /* KeyedDecoderCF.cpp */; }; 2314 2310 517A63C41B74318B00E7DCDC /* KeyedEncoderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517A63C11B74317E00E7DCDC /* KeyedEncoderCF.cpp */; }; … … 10167 10163 517A534B1F549D4A00DCDC0A /* ServiceWorkerRegistrationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerRegistrationData.cpp; sourceTree = "<group>"; }; 10168 10164 517A534C1F549D4A00DCDC0A /* ServiceWorkerRegistrationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerRegistrationData.h; sourceTree = "<group>"; }; 10169 517A535C1F5899F200DCDC0A /* ServiceWorkerFetchResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerFetchResult.h; sourceTree = "<group>"; };10170 10165 517A63BF1B74317E00E7DCDC /* KeyedDecoderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedDecoderCF.cpp; sourceTree = "<group>"; }; 10171 10166 517A63C01B74317E00E7DCDC /* KeyedDecoderCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedDecoderCF.h; sourceTree = "<group>"; }; … … 18993 18988 51F175571F3EBC0C00C74950 /* ServiceWorkerContainer.h */, 18994 18989 51F175561F3EBC0C00C74950 /* ServiceWorkerContainer.idl */, 18995 517A535C1F5899F200DCDC0A /* ServiceWorkerFetchResult.h */,18996 18990 51F175551F3EBC0C00C74950 /* ServiceWorkerGlobalScope.cpp */, 18997 18991 51F175541F3EBC0C00C74950 /* ServiceWorkerGlobalScope.h */, -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r221509 r221699 33 33 #include "JSDOMPromiseDeferred.h" 34 34 #include "JSServiceWorkerRegistration.h" 35 #include "Logging.h"36 35 #include "NavigatorBase.h" 37 #include "ResourceError.h"38 36 #include "ScopeGuard.h" 39 37 #include "ScriptExecutionContext.h" … … 184 182 } 185 183 186 void ServiceWorkerContainer::startScriptFetchForJob(ServiceWorkerJob& job)187 {188 LOG(ServiceWorker, "SeviceWorkerContainer %p starting script fetch for job %" PRIu64, this, job.data().identifier());189 190 auto* context = scriptExecutionContext();191 if (!context) {192 LOG_ERROR("ServiceWorkerContainer::jobResolvedWithRegistration called but the container's ScriptExecutionContext is gone");193 m_swConnection->failedFetchingScript(job, { errorDomainWebKitInternal, 0, job.data().scriptURL, ASCIILiteral("Attempt to fetch service worker script with no ScriptExecutionContext") });194 jobDidFinish(job);195 return;196 }197 198 job.fetchScriptWithContext(*context);199 }200 201 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, Ref<SharedBuffer>&& data)202 {203 LOG(ServiceWorker, "SeviceWorkerContainer %p finished fetching script for job %" PRIu64, this, job.data().identifier());204 205 m_swConnection->finishedFetchingScript(job, data.get());206 }207 208 void ServiceWorkerContainer::jobFailedLoadingScript(ServiceWorkerJob& job, const ResourceError& error)209 {210 LOG(ServiceWorker, "SeviceWorkerContainer %p failed fetching script for job %" PRIu64, this, job.data().identifier());211 212 m_swConnection->failedFetchingScript(job, error);213 }214 215 184 void ServiceWorkerContainer::jobDidFinish(ServiceWorkerJob& job) 216 185 { -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h
r221461 r221699 74 74 void jobFailedWithException(ServiceWorkerJob&, const Exception&) final; 75 75 void jobResolvedWithRegistration(ServiceWorkerJob&, const ServiceWorkerRegistrationData&) final; 76 void startScriptFetchForJob(ServiceWorkerJob&) final;77 void jobFinishedLoadingScript(ServiceWorkerJob&, Ref<SharedBuffer>&&) final;78 void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&) final;79 80 76 void jobDidFinish(ServiceWorkerJob&); 81 77 -
trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp
r221646 r221699 29 29 #if ENABLE(SERVICE_WORKER) 30 30 31 #include "FetchHeaders.h"32 #include "FetchLoader.h"33 #include "FetchRequest.h"34 31 #include "JSDOMPromiseDeferred.h" 35 #include "ResourceError.h"36 #include "ResourceResponse.h"37 32 #include "ServiceWorkerJobData.h" 38 33 #include "ServiceWorkerRegistration.h" … … 70 65 } 71 66 72 void ServiceWorkerJob::startScriptFetch()73 {74 ASSERT(currentThread() == m_creationThread);75 ASSERT(!m_completed);76 77 m_client->startScriptFetchForJob(*this);78 }79 80 void ServiceWorkerJob::fetchScriptWithContext(ScriptExecutionContext& context)81 {82 ASSERT(currentThread() == m_creationThread);83 ASSERT(!m_completed);84 85 m_fetchLoader = std::make_unique<FetchLoader>(*this, nullptr);86 87 // FIXME: This Fetch request is set up incorrectly and without proper care.88 // The ServiceWorkers spec specifics many details to apply here.89 90 auto fetchHeaders = FetchHeaders::create();91 auto referrer = m_jobData.clientCreationURL.string();92 auto fetchRequest = FetchRequest::create(context, std::nullopt, WTFMove(fetchHeaders), { m_jobData.scriptURL }, { }, WTFMove(referrer));93 94 m_fetchLoader->start(context, fetchRequest);95 }96 97 void ServiceWorkerJob::didReceiveResponse(const ResourceResponse& response)98 {99 ASSERT(currentThread() == m_creationThread);100 ASSERT(!m_completed);101 ASSERT(m_fetchLoader);102 ASSERT(!m_scriptData);103 104 m_lastResponse = response;105 106 if (response.httpStatusCode() < 200 || response.httpStatusCode() > 399) {107 auto message = makeString(ASCIILiteral("ServiceWorker script network fetch failed with HTTP status code "), String::number(response.httpStatusCode()));108 didFail({ errorDomainWebKitInternal, 0, m_lastResponse.url(), message });109 }110 }111 112 void ServiceWorkerJob::didReceiveData(const char* data, size_t size)113 {114 ASSERT(currentThread() == m_creationThread);115 ASSERT(!m_completed);116 ASSERT(m_fetchLoader);117 118 if (!m_scriptData)119 m_scriptData = SharedBuffer::create();120 121 m_scriptData->get().append(data, size);122 }123 124 void ServiceWorkerJob::didSucceed()125 {126 ASSERT(currentThread() == m_creationThread);127 ASSERT(!m_completed);128 ASSERT(m_fetchLoader);129 130 if (!m_scriptData)131 m_scriptData = SharedBuffer::create();132 m_client->jobFinishedLoadingScript(*this, WTFMove(*m_scriptData));133 m_fetchLoader = nullptr;134 }135 136 void ServiceWorkerJob::didFail(const ResourceError& error)137 {138 ASSERT(currentThread() == m_creationThread);139 ASSERT(!m_completed);140 ASSERT(m_fetchLoader);141 142 m_client->jobFailedLoadingScript(*this, error);143 m_fetchLoader = nullptr;144 }145 146 67 } // namespace WebCore 147 68 -
trunk/Source/WebCore/workers/service/ServiceWorkerJob.h
r221646 r221699 28 28 #if ENABLE(SERVICE_WORKER) 29 29 30 #include "FetchLoader.h"31 #include "FetchLoaderClient.h"32 #include "ResourceResponse.h"33 30 #include "ServiceWorkerJobClient.h" 34 31 #include "ServiceWorkerJobData.h" … … 42 39 class DeferredPromise; 43 40 class Exception; 44 class ScriptExecutionContext;45 41 enum class ServiceWorkerJobType; 46 42 struct ServiceWorkerRegistrationData; 47 43 48 class ServiceWorkerJob : public ThreadSafeRefCounted<ServiceWorkerJob> , public FetchLoaderClient{44 class ServiceWorkerJob : public ThreadSafeRefCounted<ServiceWorkerJob> { 49 45 public: 50 46 static Ref<ServiceWorkerJob> create(ServiceWorkerJobClient& client, Ref<DeferredPromise>&& promise, ServiceWorkerJobData&& jobData) … … 57 53 void failedWithException(const Exception&); 58 54 void resolvedWithRegistration(const ServiceWorkerRegistrationData&); 59 void startScriptFetch();60 55 61 56 ServiceWorkerJobData data() const { return m_jobData; } 62 57 DeferredPromise& promise() { return m_promise.get(); } 63 58 64 void fetchScriptWithContext(ScriptExecutionContext&);65 66 59 private: 67 60 ServiceWorkerJob(ServiceWorkerJobClient&, Ref<DeferredPromise>&&, ServiceWorkerJobData&&); 68 69 // FetchLoaderClient70 void didReceiveResponse(const ResourceResponse&) final;71 void didReceiveData(const char*, size_t) final;72 void didSucceed() final;73 void didFail(const ResourceError&) final;74 61 75 62 Ref<ServiceWorkerJobClient> m_client; … … 80 67 81 68 Ref<RunLoop> m_runLoop { RunLoop::current() }; 82 std::unique_ptr<FetchLoader> m_fetchLoader;83 ResourceResponse m_lastResponse;84 std::optional<Ref<SharedBuffer>> m_scriptData;85 69 86 70 #if !ASSERT_DISABLED -
trunk/Source/WebCore/workers/service/ServiceWorkerJobClient.h
r221461 r221699 31 31 32 32 class Exception; 33 class ResourceError;34 33 class ServiceWorkerJob; 35 class SharedBuffer;36 34 struct ServiceWorkerRegistrationData; 37 35 … … 42 40 virtual void jobFailedWithException(ServiceWorkerJob&, const Exception&) = 0; 43 41 virtual void jobResolvedWithRegistration(ServiceWorkerJob&, const ServiceWorkerRegistrationData&) = 0; 44 virtual void startScriptFetchForJob(ServiceWorkerJob&) = 0;45 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, Ref<SharedBuffer>&&) = 0;46 virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&) = 0;47 42 48 43 virtual uint64_t connectionIdentifier() = 0; -
trunk/Source/WebCore/workers/service/server/SWClientConnection.cpp
r221646 r221699 30 30 31 31 #include "ExceptionData.h" 32 #include "ServiceWorkerFetchResult.h"33 32 #include "ServiceWorkerJobData.h" 34 33 … … 49 48 50 49 scheduleJobInServer(job.data()); 51 }52 53 void SWClientConnection::finishedFetchingScript(ServiceWorkerJob& job, SharedBuffer& data)54 {55 ASSERT(m_scheduledJobs.get(job.data().identifier()) == &job);56 57 Vector<uint8_t> vector;58 vector.append(reinterpret_cast<const uint8_t *>(data.data()), data.size());59 finishFetchingScriptInServer({ job.data().identifier(), job.data().connectionIdentifier(), job.data().registrationKey(), vector, { } });60 }61 62 void SWClientConnection::failedFetchingScript(ServiceWorkerJob& job, const ResourceError& error)63 {64 ASSERT(m_scheduledJobs.get(job.data().identifier()) == &job);65 66 finishFetchingScriptInServer({ job.data().identifier(), job.data().connectionIdentifier(), job.data().registrationKey(), { }, error });67 50 } 68 51 … … 89 72 } 90 73 91 void SWClientConnection::startScriptFetchForServer(uint64_t jobIdentifier)92 {93 auto job = m_scheduledJobs.get(jobIdentifier);94 if (!job) {95 LOG_ERROR("Job %" PRIu64 " instructed to start fetch from server, but job was not found", jobIdentifier);96 97 // FIXME: Should message back to the server here to signal failure to fetch,98 // but we currently need the registration key to do so, and don't have it here.99 // In the future we'll refactor to have a global, cross-process job identifier that can be used to overcome this.100 101 return;102 }103 104 job->startScriptFetch();105 }106 107 74 } // namespace WebCore 108 75 -
trunk/Source/WebCore/workers/service/server/SWClientConnection.h
r221461 r221699 34 34 namespace WebCore { 35 35 36 class ResourceError;37 class SharedBuffer;38 36 struct ExceptionData; 39 struct ServiceWorkerFetchResult;40 37 struct ServiceWorkerRegistrationData; 41 38 … … 46 43 47 44 void scheduleJob(ServiceWorkerJob&); 48 void finishedFetchingScript(ServiceWorkerJob&, SharedBuffer&);49 void failedFetchingScript(ServiceWorkerJob&, const ResourceError&);50 45 51 46 virtual uint64_t identifier() const = 0; … … 54 49 WEBCORE_EXPORT void jobRejectedInServer(uint64_t jobIdentifier, const ExceptionData&); 55 50 WEBCORE_EXPORT void jobResolvedInServer(uint64_t jobIdentifier, const ServiceWorkerRegistrationData&); 56 WEBCORE_EXPORT void startScriptFetchForServer(uint64_t jobIdentifier);57 51 58 52 private: 59 53 virtual void scheduleJobInServer(const ServiceWorkerJobData&) = 0; 60 virtual void finishFetchingScriptInServer(const ServiceWorkerFetchResult&) = 0;61 54 62 55 HashMap<uint64_t, RefPtr<ServiceWorkerJob>> m_scheduledJobs; -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r221461 r221699 33 33 #include "Logging.h" 34 34 #include "SWServerRegistration.h" 35 #include "ServiceWorkerFetchResult.h"36 35 #include "ServiceWorkerJobData.h" 37 36 #include <wtf/text/WTFString.h> … … 74 73 } 75 74 76 void SWServer::Connection::finishFetchingScriptInServer(const ServiceWorkerFetchResult& result)77 {78 m_server.scriptFetchFinished(result);79 }80 81 75 SWServer::SWServer() 82 76 { … … 117 111 118 112 connection->resolveJobInClient(jobData.identifier(), registrationData); 119 }120 121 void SWServer::startScriptFetch(const ServiceWorkerJobData& jobData)122 {123 LOG(ServiceWorker, "Server issuing startScriptFetch for current job %" PRIu64 "-%" PRIu64 " in client", jobData.connectionIdentifier(), jobData.identifier());124 auto* connection = m_connections.get(jobData.connectionIdentifier());125 if (!connection)126 return;127 128 connection->startScriptFetchInClient(jobData.identifier());129 }130 131 void SWServer::scriptFetchFinished(const ServiceWorkerFetchResult& result)132 {133 LOG(ServiceWorker, "Server handling scriptFetchFinished for current job %" PRIu64 "-%" PRIu64 " in client", result.connectionIdentifier, result.jobIdentifier);134 135 ASSERT(m_connections.contains(result.connectionIdentifier));136 137 auto registration = m_registrations.get(result.registrationKey);138 if (!registration)139 return;140 141 registration->scriptFetchFinished(result);142 113 } 143 114 -
trunk/Source/WebCore/workers/service/server/SWServer.h
r221461 r221699 44 44 class SWServerRegistration; 45 45 struct ExceptionData; 46 struct ServiceWorkerFetchResult;47 46 struct ServiceWorkerRegistrationData; 48 47 … … 59 58 60 59 WEBCORE_EXPORT void scheduleJobInServer(const ServiceWorkerJobData&); 61 WEBCORE_EXPORT void finishFetchingScriptInServer(const ServiceWorkerFetchResult&);62 60 63 61 private: 64 62 virtual void rejectJobInClient(uint64_t jobIdentifier, const ExceptionData&) = 0; 65 63 virtual void resolveJobInClient(uint64_t jobIdentifier, const ServiceWorkerRegistrationData&) = 0; 66 virtual void startScriptFetchInClient(uint64_t jobIdentifier) = 0;67 64 68 65 SWServer& m_server; … … 75 72 void rejectJob(const ServiceWorkerJobData&, const ExceptionData&); 76 73 void resolveJob(const ServiceWorkerJobData&, const ServiceWorkerRegistrationData&); 77 void startScriptFetch(const ServiceWorkerJobData&);78 79 74 void postTask(CrossThreadTask&&); 80 75 void postTaskReply(CrossThreadTask&&); … … 86 81 void taskThreadEntryPoint(); 87 82 void handleTaskRepliesOnMainThread(); 88 89 void scriptFetchFinished(const ServiceWorkerFetchResult&);90 83 91 84 HashMap<uint64_t, Connection*> m_connections; -
trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp
r221461 r221699 33 33 #include "SWServerWorker.h" 34 34 #include "SecurityOrigin.h" 35 #include "ServiceWorkerFetchResult.h"36 35 #include "ServiceWorkerRegistrationData.h" 37 36 #include "WorkerType.h" … … 63 62 if (!m_jobTimer.isActive()) 64 63 m_jobTimer.startOneShot(0_s); 65 }66 67 void SWServerRegistration::scriptFetchFinished(const ServiceWorkerFetchResult& result)68 {69 ASSERT(m_currentJob && m_currentJob->identifier() == result.jobIdentifier);70 71 // FIXME: We fetched the script contents but don't do anything with them yet.72 // These errors are for testing the current state of the feature.73 74 String message;75 if (result.scriptError.isNull())76 message = makeString("Script URL ", m_currentJob->scriptURL.string(), " fetched with ", String::number(result.scriptData.size()), " bytes, but we're not using the result yet");77 else78 message = makeString("Script URL ", m_currentJob->scriptURL.string(), " fetch resulted in error: ", result.scriptError.localizedDescription());79 80 rejectCurrentJob(ExceptionData { UnknownError, message });81 64 } 82 65 … … 167 150 return rejectWithExceptionOnMainThread(ExceptionData { TypeError, ASCIILiteral("Cannot update a service worker with a requested script URL whose newest worker has a different script URL") }); 168 151 169 startScriptFetchFromMainThread(); 152 // FIXME: At this point we are ready to actually fetch the script for the worker in the registering context. 153 // For now we're still hard coding the same rejection we have so far. 154 rejectWithExceptionOnMainThread(ExceptionData { UnknownError, ASCIILiteral("serviceWorker job scheduling is not yet implemented") }); 170 155 } 171 156 … … 180 165 ASSERT(!isMainThread()); 181 166 m_server.postTaskReply(createCrossThreadTask(*this, &SWServerRegistration::resolveCurrentJob, data())); 182 }183 184 void SWServerRegistration::startScriptFetchFromMainThread()185 {186 ASSERT(!isMainThread());187 m_server.postTaskReply(createCrossThreadTask(*this, &SWServerRegistration::startScriptFetchForCurrentJob));188 167 } 189 168 … … 206 185 207 186 finishCurrentJob(); 208 }209 210 void SWServerRegistration::startScriptFetchForCurrentJob()211 {212 ASSERT(isMainThread());213 ASSERT(m_currentJob);214 215 m_server.startScriptFetch(*m_currentJob);216 187 } 217 188 -
trunk/Source/WebCore/workers/service/server/SWServerRegistration.h
r221461 r221699 39 39 class SWServerWorker; 40 40 struct ExceptionData; 41 struct ServiceWorkerFetchResult;42 41 43 42 class SWServerRegistration : public ThreadSafeIdentified<SWServerRegistration> { … … 48 47 49 48 void enqueueJob(const ServiceWorkerJobData&); 50 void scriptFetchFinished(const ServiceWorkerFetchResult&);51 49 52 50 ServiceWorkerRegistrationData data() const; … … 57 55 void rejectCurrentJob(const ExceptionData&); 58 56 void resolveCurrentJob(const ServiceWorkerRegistrationData&); 59 void startScriptFetchForCurrentJob();60 57 void finishCurrentJob(); 61 58 … … 65 62 void rejectWithExceptionOnMainThread(const ExceptionData&); 66 63 void resolveWithRegistrationOnMainThread(); 67 void startScriptFetchFromMainThread();68 64 bool isEmpty(); 69 65 SWServerWorker* getNewestWorker(); -
trunk/Source/WebKit/ChangeLog
r221698 r221699 1 2017-09-06 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r221461. 4 5 The LayoutTest added with this change crashes under 6 GuardMalloc. 7 8 Reverted changeset: 9 10 "Add (entirely incorrect) fetching of ServiceWorker scripts." 11 https://bugs.webkit.org/show_bug.cgi?id=176179 12 http://trac.webkit.org/changeset/221461 13 1 14 2017-09-06 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
r221461 r221699 29 29 #if ENABLE(SERVICE_WORKER) 30 30 31 #include "DataReference.h"32 31 #include "Logging.h" 33 32 #include "StorageToWebProcessConnectionMessages.h" … … 72 71 } 73 72 74 void WebSWServerConnection::startScriptFetchInClient(uint64_t jobIdentifier)75 {76 send(Messages::WebSWClientConnection::StartScriptFetchForServer(jobIdentifier));77 }78 79 73 } // namespace WebKit 80 74 -
trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
r221461 r221699 52 52 void rejectJobInClient(uint64_t jobIdentifier, const WebCore::ExceptionData&) final; 53 53 void resolveJobInClient(uint64_t jobIdentifier, const WebCore::ServiceWorkerRegistrationData&) final; 54 void startScriptFetchInClient(uint64_t jobIdentifier) final;55 54 56 55 IPC::Connection* messageSenderConnection() final { return m_connection.ptr(); } -
trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in
r221461 r221699 26 26 # When possible, these messages can be implemented directly by WebCore::SWClientConnection 27 27 ScheduleJobInServer(struct WebCore::ServiceWorkerJobData jobData) 28 FinishFetchingScriptInServer(struct WebCore::ServiceWorkerFetchResult result)29 28 } 30 29 -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
r221461 r221699 31 31 #include "Logging.h" 32 32 #include "StorageToWebProcessConnectionMessages.h" 33 #include "WebCoreArgumentCoders.h"34 33 #include "WebSWServerConnectionMessages.h" 35 #include <WebCore/ServiceWorkerFetchResult.h>36 34 #include <WebCore/ServiceWorkerJobData.h> 37 35 … … 59 57 } 60 58 61 void WebSWClientConnection::finishFetchingScriptInServer(const ServiceWorkerFetchResult& result)62 {63 send(Messages::WebSWServerConnection::FinishFetchingScriptInServer(result));64 }65 66 59 } // namespace WebKit 67 60 -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h
r221461 r221699 49 49 50 50 void scheduleJobInServer(const WebCore::ServiceWorkerJobData&) final; 51 void finishFetchingScriptInServer(const WebCore::ServiceWorkerFetchResult&) final;52 51 53 52 void disconnectedFromWebProcess(); -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in
r221461 r221699 27 27 JobRejectedInServer(uint64_t identifier, struct WebCore::ExceptionData exception) 28 28 JobResolvedInServer(uint64_t identifier, struct WebCore::ServiceWorkerRegistrationData registration) 29 StartScriptFetchForServer(uint64_t jobIdentifier)30 29 } 31 30
Note: See TracChangeset
for help on using the changeset viewer.