Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
SW "Hello world".
https://bugs.webkit.org/show_bug.cgi?id=178187 Reviewed by Andy Estes. Source/WebCore: No new tests (Covered by changes to existing tests). With this patch, SW scripts are actually compiled and run inside a ServiceWorkerGlobalScope environment in the SW context process. * WebCore.xcodeproj/project.pbxproj: * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::initScript): * dom/EventTargetFactory.in: * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::isServiceWorkerGlobalScope const): * workers/service/ServiceWorkerContextData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp. (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope): (WebCore::ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope): (WebCore::ServiceWorkerGlobalScope::registration): (WebCore::ServiceWorkerGlobalScope::eventTargetInterface const): * workers/service/ServiceWorkerGlobalScope.h: (WebCore::ServiceWorkerGlobalScope::create): (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const): * workers/service/context/SWContextManager.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp. (WebCore::SWContextManager::singleton): (WebCore::SWContextManager::SWContextManager): (WebCore::SWContextManager::startServiceWorkerContext): * workers/service/context/SWContextManager.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h. * workers/service/context/ServiceWorkerThread.cpp: Added. (WebCore::ServiceWorkerThreadProxy::sharedDummyProxy): (WebCore::ServiceWorkerThread::ServiceWorkerThread): (WebCore::m_workerObjectProxy): (WebCore::ServiceWorkerThread::~ServiceWorkerThread): (WebCore::ServiceWorkerThread::createWorkerGlobalScope): (WebCore::ServiceWorkerThread::runEventLoop): * workers/service/context/ServiceWorkerThread.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h. (WebCore::ServiceWorkerThread::create): (WebCore::ServiceWorkerThread::workerObjectProxy const): * workers/service/server/SWServer.cpp: (WebCore::SWServer::createWorker): Source/WebKit: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startServiceWorkerContext): LayoutTests: * http/tests/workers/service/basic-register-exceptions-expected.txt: * http/tests/workers/service/basic-register-expected.txt: * http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt: Canonical link: https://commits.webkit.org/194491@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
20 changed files
with
508 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,3 @@ | ||
CONSOLE MESSAGE: line 10: Registration failed with error: UnknownError: Failed to start service worker script of length 41 | ||
CONSOLE MESSAGE: line 21: Registration failed with error: UnknownError: Failed to start service worker script of length 0 | ||
CONSOLE MESSAGE: line 10: Registration failed with error: UnknownError: Worker script successfully started, but it has no way to communicate yet | ||
CONSOLE MESSAGE: line 21: Registration failed with error: UnknownError: Worker script successfully started, but it has no way to communicate yet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,2 +1,2 @@ | ||
ALERT: Unexpected error received from server: UnknownError: Failed to start service worker script of length 41 | ||
ALERT: Unexpected error received from server: UnknownError: Worker script successfully started, but it has no way to communicate yet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2017 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "config.h" | ||
#include "ServiceWorkerContextData.h" | ||
|
||
#if ENABLE(SERVICE_WORKER) | ||
|
||
namespace WebCore { | ||
|
||
ServiceWorkerContextData ServiceWorkerContextData::isolatedCopy() const | ||
{ | ||
return { registrationKey.isolatedCopy(), workerID.isolatedCopy(), script.isolatedCopy(), scriptURL.isolatedCopy() }; | ||
} | ||
|
||
} // namespace WebCore | ||
|
||
#endif // ENABLE(SERVICE_WORKER) |
Oops, something went wrong.