Skip to content
Permalink
Browse files
Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

Source/WebCore:

* CMakeLists.txt: Add missing include paths and files to the build.
* Sources.txt: Add missing files to the build.
* WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
JSFetchEventCustom.cpp targets, they're now built via unified sources.
* bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
with the ENABLE(SERVICE_WORKER) guards.

Source/WebKit:

* CMakeLists.txt: Add missing files to the build.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didGetWorkerContextProcessConnection):
IPC::Attachment object should be accessed through an rvalue reference,
making it mutable and enabling releasing the file descriptor.
* StorageProcess/StorageProcess.h: Adjust the method signature.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
Explicitly include the ResourceError header from WebCore (using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
Include the CachedResource header from WebCore (again using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.

Source/WTF:

* wtf/Identified.h: Explicitly include the <atomic> header since
std::atomic<> is used in the ThreadSafeIdentified definition.

Tools:

* Scripts/webkitperl/FeatureList.pm: Add the --service-worker option
that enables the SERVICE_WORKER feature flag. For now it's enabled
on Apple's Cocoa ports (even when build-webkit isn't used for those
builds, the flag is enabled here for consistency).


Canonical link: https://commits.webkit.org/194947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
zdobersek committed Oct 25, 2017
1 parent 3172ebe commit f3a2c1415e2c170d8633bc5a6134431a973cc305
Showing 16 changed files with 84 additions and 6 deletions.
@@ -1,3 +1,13 @@
2017-10-25 Zan Dobersek <zdobersek@igalia.com>

Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

* wtf/Identified.h: Explicitly include the <atomic> header since
std::atomic<> is used in the ThreadSafeIdentified definition.

2017-10-24 Michael Saboff <msaboff@apple.com>

WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
@@ -25,6 +25,8 @@

#pragma once

#include <atomic>

namespace WTF {

template <typename IdentifierType, typename StaticType, typename ClassType>
@@ -129,6 +129,7 @@ set(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/websockets"
"${WEBCORE_DIR}/workers"
"${WEBCORE_DIR}/workers/service"
"${WEBCORE_DIR}/workers/service/context"
"${WEBCORE_DIR}/workers/service/server"
"${WEBCORE_DIR}/xml"
"${WEBCORE_DIR}/xml/parser"
@@ -2123,6 +2124,7 @@ set(WebCore_SOURCES
workers/service/ServiceWorkerClient.cpp
workers/service/ServiceWorkerClients.cpp
workers/service/ServiceWorkerContainer.cpp
workers/service/ServiceWorkerContextData.cpp
workers/service/ServiceWorkerGlobalScope.cpp
workers/service/ServiceWorkerJob.cpp
workers/service/ServiceWorkerJobData.cpp
@@ -2133,6 +2135,10 @@ set(WebCore_SOURCES
workers/service/ServiceWorkerRegistrationOptions.cpp
workers/service/ServiceWorkerWindowClient.cpp

workers/service/context/ServiceWorkerFetch.cpp
workers/service/context/ServiceWorkerThread.cpp
workers/service/context/ServiceWorkerThreadProxy.cpp

workers/service/server/SWClientConnection.cpp
workers/service/server/SWServer.cpp
workers/service/server/SWServerRegistration.cpp
@@ -1,3 +1,17 @@
2017-10-25 Zan Dobersek <zdobersek@igalia.com>

Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

* CMakeLists.txt: Add missing include paths and files to the build.
* Sources.txt: Add missing files to the build.
* WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
JSFetchEventCustom.cpp targets, they're now built via unified sources.
* bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
with the ENABLE(SERVICE_WORKER) guards.

2017-10-24 Alejandro G. Castro <alex@igalia.com>

Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
@@ -356,6 +356,7 @@ bindings/js/JSDOMGlobalObject.cpp
bindings/js/JSDOMGlobalObjectTask.cpp
bindings/js/JSDOMGuardedObject.cpp
bindings/js/JSDOMMapLike.cpp
bindings/js/JSDOMPromise.cpp
bindings/js/JSDOMPromiseDeferred.cpp
bindings/js/JSDOMWindowBase.cpp
bindings/js/JSDOMWindowCustom.cpp
@@ -371,6 +372,7 @@ bindings/js/JSEventCustom.cpp
bindings/js/JSEventListener.cpp
bindings/js/JSEventTargetCustom.cpp
bindings/js/JSExtendableMessageEventCustom.cpp
bindings/js/JSFetchEventCustom.cpp
bindings/js/JSFileSystemEntryCustom.cpp
bindings/js/JSHTMLCollectionCustom.cpp
bindings/js/JSHTMLDocumentCustom.cpp
@@ -1376,7 +1376,6 @@
4129C9AB1F59C573009D7403 /* ReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 418C395B1C8F0A610051C8A3 /* ReadableStreamSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
4129C9AF1F59CF5B009D7403 /* ReadableStreamSink.h in Headers */ = {isa = PBXBuildFile; fileRef = 4129C9801F5861C7009D7403 /* ReadableStreamSink.h */; settings = {ATTRIBUTES = (Private, ); }; };
4129DF861BB5B80C00322A16 /* JSReadableStreamPrivateConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
4131F3B31F9552860059995A /* JSFetchEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4131F3B11F9552810059995A /* JSFetchEventCustom.cpp */; };
4131F3E11F987CC00059995A /* ServiceWorkerFetch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 419ACF901F97E7D6009F1A83 /* ServiceWorkerFetch.cpp */; };
41380C271F3436AC00155FDA /* DOMCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 41380C251F34369A00155FDA /* DOMCache.h */; };
41380C291F3436AC00155FDA /* DOMCacheStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41380C221F34369000155FDA /* DOMCacheStorage.h */; };
@@ -1440,7 +1439,6 @@
41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 41AD75391CEF6BCE00A31486 /* FetchOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
41AF37991F8DADAA00111C31 /* ExtendableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF37921F8DA48A00111C31 /* ExtendableEvent.cpp */; };
41AF379B1F8DADAE00111C31 /* FetchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF37941F8DA49500111C31 /* FetchEvent.cpp */; };
41AF379D1F8DB1B500111C31 /* JSDOMPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41AF379C1F8DB1B100111C31 /* JSDOMPromise.cpp */; };
41B28B141F8501A600FB52AC /* MediaEndpointConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */; };
41B28B151F8501D300FB52AC /* MediaEndpointConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */; };
41B28B391F860BD600FB52AC /* LibWebRTCProviderCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41B28B381F860BD100FB52AC /* LibWebRTCProviderCocoa.cpp */; };
@@ -31552,8 +31550,6 @@
1AE96A921D1A0DDD00B86768 /* JSApplePayShippingMethodSelectedEvent.cpp in Sources */,
1ADFDFEE1E71E47C008F5D34 /* JSApplePayShippingMethodUpdate.cpp in Sources */,
1AE96A941D1A0DDD00B86768 /* JSApplePayValidateMerchantEvent.cpp in Sources */,
41AF379D1F8DB1B500111C31 /* JSDOMPromise.cpp in Sources */,
4131F3B31F9552860059995A /* JSFetchEventCustom.cpp in Sources */,
0FDA7C1E188322FC00C954B5 /* JSGestureEvent.cpp in Sources */,
538EC93E1F99BF5A004D22A8 /* JSQuickTimePluginReplacement.cpp in Sources */,
538EC9421F99CE47004D22A8 /* JSTouch.cpp in Sources */,
@@ -26,6 +26,8 @@
#include "config.h"
#include "JSFetchEvent.h"

#if ENABLE(SERVICE_WORKER)

namespace WebCore {

void JSFetchEvent::visitAdditionalChildren(JSC::SlotVisitor& visitor)
@@ -34,3 +36,5 @@ void JSFetchEvent::visitAdditionalChildren(JSC::SlotVisitor& visitor)
}

}

#endif
@@ -539,8 +539,11 @@ set(WebKit_SOURCES
WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
WebProcess/Plugins/Netscape/NetscapePluginStream.cpp

WebProcess/Storage/ServiceWorkerClientFetch.cpp
WebProcess/Storage/ServiceWorkerContextManager.cpp
WebProcess/Storage/WebSWClientConnection.cpp
WebProcess/Storage/WebSWOriginTable.cpp
WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
WebProcess/Storage/WebServiceWorkerProvider.cpp
WebProcess/Storage/WebToStorageProcessConnection.cpp

@@ -1,3 +1,22 @@
2017-10-25 Zan Dobersek <zdobersek@igalia.com>

Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

* CMakeLists.txt: Add missing files to the build.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didGetWorkerContextProcessConnection):
IPC::Attachment object should be accessed through an rvalue reference,
making it mutable and enabling releasing the file descriptor.
* StorageProcess/StorageProcess.h: Adjust the method signature.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
Explicitly include the ResourceError header from WebCore (using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
Include the CachedResource header from WebCore (again using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.

2017-10-24 Youenn Fablet <youenn@apple.com>

ServiceWorkerClientFetch should return an error that is not null in case of failure
@@ -368,7 +368,7 @@ WebSWOriginStore* StorageProcess::swOriginStoreForSession(PAL::SessionID session
return it->value.get();
}

void StorageProcess::didGetWorkerContextProcessConnection(const IPC::Attachment& encodedConnectionIdentifier)
void StorageProcess::didGetWorkerContextProcessConnection(IPC::Attachment&& encodedConnectionIdentifier)
{
ASSERT(m_waitingForWorkerContextProcessConnection);
m_waitingForWorkerContextProcessConnection = false;
@@ -116,7 +116,7 @@ class StorageProcess : public ChildProcess
void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&);
#endif
#if ENABLE(SERVICE_WORKER)
void didGetWorkerContextProcessConnection(const IPC::Attachment& encodedConnectionIdentifier);
void didGetWorkerContextProcessConnection(IPC::Attachment&& encodedConnectionIdentifier);
void serviceWorkerContextFailedToStart(uint64_t serverConnectionIdentifier, const WebCore::ServiceWorkerRegistrationKey&, const String& workerID, const String& message);
void serviceWorkerContextStarted(uint64_t serverConnectionIdentifier, const WebCore::ServiceWorkerRegistrationKey&, uint64_t identifier, const String& workerID);

@@ -31,6 +31,7 @@
#include "DataReference.h"
#include "WebServiceWorkerProvider.h"
#include <WebCore/NotImplemented.h>
#include <WebCore/ResourceError.h>

using namespace WebCore;

@@ -31,6 +31,7 @@
#include "WebProcess.h"
#include "WebSWServerConnection.h"
#include "WebToStorageProcessConnection.h"
#include <WebCore/CachedResource.h>
#include <WebCore/Exception.h>
#include <WebCore/ExceptionCode.h>
#include <WebCore/ServiceWorkerJob.h>
@@ -31,6 +31,10 @@
#include <WebCore/ServiceWorkerProvider.h>
#include <wtf/NeverDestroyed.h>

namespace WebCore {
class CachedResource;
}

namespace WebKit {

class WebServiceWorkerProvider final : public WebCore::ServiceWorkerProvider {
@@ -1,3 +1,15 @@
2017-10-25 Zan Dobersek <zdobersek@igalia.com>

Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

* Scripts/webkitperl/FeatureList.pm: Add the --service-worker option
that enables the SERVICE_WORKER feature flag. For now it's enabled
on Apple's Cocoa ports (even when build-webkit isn't used for those
builds, the flag is enabled here for consistency).

2017-10-24 Michael Catanzaro <mcatanzaro@igalia.com>

Unreviewed, fix name of Perl LibXML package on Fedora
@@ -118,6 +118,7 @@ my (
$registerProtocolHandlerSupport,
$resolutionMediaQuerySupport,
$scriptedSpeechSupport,
$serviceWorkerSupport,
$subtleCrypto,
$svgFontsSupport,
$systemMallocSupport,
@@ -339,6 +340,9 @@ my @features = (
{ option => "scripted-speech", desc => "Toggle Scripted Speech support",
define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },

{ option => "service-worker", desc => "Toggle Service Worker support",
define => "ENABLE_SERVICE_WORKER", default => isAppleCocoaWebKit(), value => \$serviceWorkerSupport },

{ option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isAppleCocoaWebKit() || isIOSWebKit() || isWPE()), value => \$subtleCrypto },

0 comments on commit f3a2c14

Please sign in to comment.