Title: [223973] trunk/Source/WebCore
Revision
223973
Author
[email protected]
Date
2017-10-25 12:36:08 -0700 (Wed, 25 Oct 2017)

Log Message

[Service Worker] Add stubs for serviceWorkerClient.type
https://bugs.webkit.org/show_bug.cgi?id=178812

Reviewed by Youenn Fablet.

Add stubs for serviceWorkerClient.type to match the latest specification:
- https://w3c.github.io/ServiceWorker/#enumdef-clienttype

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::type const):
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientType.h: Added.
* workers/service/ServiceWorkerClientType.idl: Added.
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerClients.idl:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (223972 => 223973)


--- trunk/Source/WebCore/CMakeLists.txt	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-10-25 19:36:08 UTC (rev 223973)
@@ -806,6 +806,7 @@
     workers/service/FetchEvent.idl
     workers/service/ServiceWorker.idl
     workers/service/ServiceWorkerClient.idl
+    workers/service/ServiceWorkerClientType.idl
     workers/service/ServiceWorkerClients.idl
     workers/service/ServiceWorkerContainer.idl
     workers/service/ServiceWorkerGlobalScope.idl

Modified: trunk/Source/WebCore/ChangeLog (223972 => 223973)


--- trunk/Source/WebCore/ChangeLog	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/ChangeLog	2017-10-25 19:36:08 UTC (rev 223973)
@@ -1,3 +1,26 @@
+2017-10-25  Chris Dumez  <[email protected]>
+
+        [Service Worker] Add stubs for serviceWorkerClient.type
+        https://bugs.webkit.org/show_bug.cgi?id=178812
+
+        Reviewed by Youenn Fablet.
+
+        Add stubs for serviceWorkerClient.type to match the latest specification:
+        - https://w3c.github.io/ServiceWorker/#enumdef-clienttype
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * workers/service/ServiceWorkerClient.cpp:
+        (WebCore::ServiceWorkerClient::type const):
+        * workers/service/ServiceWorkerClient.h:
+        * workers/service/ServiceWorkerClient.idl:
+        * workers/service/ServiceWorkerClientType.h: Added.
+        * workers/service/ServiceWorkerClientType.idl: Added.
+        * workers/service/ServiceWorkerClients.h:
+        * workers/service/ServiceWorkerClients.idl:
+
 2017-10-24  Keith Miller  <[email protected]>
 
         Move mathml and page to unified souces

Modified: trunk/Source/WebCore/DerivedSources.make (223972 => 223973)


--- trunk/Source/WebCore/DerivedSources.make	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/DerivedSources.make	2017-10-25 19:36:08 UTC (rev 223973)
@@ -927,6 +927,7 @@
     $(WebCore)/workers/service/FetchEvent.idl \
     $(WebCore)/workers/service/ServiceWorker.idl \
     $(WebCore)/workers/service/ServiceWorkerClient.idl \
+    $(WebCore)/workers/service/ServiceWorkerClientType.idl \
     $(WebCore)/workers/service/ServiceWorkerClients.idl \
     $(WebCore)/workers/service/ServiceWorkerContainer.idl \
     $(WebCore)/workers/service/ServiceWorkerGlobalScope.idl \

Modified: trunk/Source/WebCore/Sources.txt (223972 => 223973)


--- trunk/Source/WebCore/Sources.txt	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/Sources.txt	2017-10-25 19:36:08 UTC (rev 223973)
@@ -1799,6 +1799,7 @@
 JSSecurityPolicyViolationEvent.cpp
 JSServiceWorker.cpp
 JSServiceWorkerClient.cpp
+JSServiceWorkerClientType.cpp
 JSServiceWorkerClients.cpp
 JSServiceWorkerContainer.cpp
 JSServiceWorkerGlobalScope.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (223972 => 223973)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-10-25 19:36:08 UTC (rev 223973)
@@ -2834,8 +2834,8 @@
 		830519961BB0F11000F3772E /* HTMLTimeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 830519931BB0F0E700F3772E /* HTMLTimeElement.h */; };
 		830784B21C52EE2C00104D1D /* XMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 830784B11C52EE1900104D1D /* XMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */; };
+		83102B271F9EADD900E404B9 /* JSExtendableMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 83102B231F9EADC200E404B9 /* JSExtendableMessageEvent.h */; };
 		83120C701C56F3F6001CB112 /* HTMLDataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 831D1F291C56ECA000F5F6C0 /* HTMLDataElement.cpp */; };
-		83102B271F9EADD900E404B9 /* JSExtendableMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 83102B231F9EADC200E404B9 /* JSExtendableMessageEvent.h */; };
 		83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A71C56E83A00F3F0E3 /* HTMLDataElement.h */; };
 		8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */ = {isa = PBXBuildFile; fileRef = 8321507B1F27EA150095B136 /* NavigatorBeacon.h */; };
 		832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
@@ -2858,6 +2858,7 @@
 		836589DE1F54A76900DC31F4 /* JSFileSystemDirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 836589D91F54A76200DC31F4 /* JSFileSystemDirectoryReader.h */; };
 		836589E01F54A76E00DC31F4 /* JSFileSystemEntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 836589D81F54A76200DC31F4 /* JSFileSystemEntriesCallback.h */; };
 		8367587F1C56E99B008A1087 /* JSHTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A81C56E93E00F3F0E3 /* JSHTMLDataElement.h */; };
+		8369FDFC1FA102E300C1FF1F /* ServiceWorkerClientType.h in Headers */ = {isa = PBXBuildFile; fileRef = 8369FDFB1FA102CB00C1FF1F /* ServiceWorkerClientType.h */; };
 		836ACEC31ECA62C8004BD012 /* DOMMatrixReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 836ACEC01ECA62B0004BD012 /* DOMMatrixReadOnly.h */; };
 		836ACECA1ECA9569004BD012 /* DOMMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 836ACEC51ECA6654004BD012 /* DOMMatrix.h */; };
 		836ACECB1ECA956D004BD012 /* DOMMatrixInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 836ACEC71ECA6654004BD012 /* DOMMatrixInit.h */; };
@@ -10583,6 +10584,8 @@
 		836589DA1F54A76200DC31F4 /* JSFileSystemEntriesCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemEntriesCallback.cpp; sourceTree = "<group>"; };
 		836589DB1F54A76200DC31F4 /* JSFileSystemDirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemDirectoryReader.cpp; sourceTree = "<group>"; };
 		8369E58F1AFDD0300087DF68 /* NonDocumentTypeChildNode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NonDocumentTypeChildNode.idl; sourceTree = "<group>"; };
+		8369FDF91FA102CA00C1FF1F /* ServiceWorkerClientType.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerClientType.idl; sourceTree = "<group>"; };
+		8369FDFB1FA102CB00C1FF1F /* ServiceWorkerClientType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerClientType.h; sourceTree = "<group>"; };
 		836ACEBF1ECA62B0004BD012 /* DOMMatrixReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMatrixReadOnly.cpp; sourceTree = "<group>"; };
 		836ACEC01ECA62B0004BD012 /* DOMMatrixReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMMatrixReadOnly.h; sourceTree = "<group>"; };
 		836ACEC11ECA62B0004BD012 /* DOMMatrixReadOnly.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMMatrixReadOnly.idl; sourceTree = "<group>"; };
@@ -10649,6 +10652,8 @@
 		839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLWBRElement.cpp; sourceTree = "<group>"; };
 		839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLWBRElement.h; sourceTree = "<group>"; };
 		83A4A9F81CE7FD7E00709B00 /* JSXMLDocumentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLDocumentCustom.cpp; sourceTree = "<group>"; };
+		83B250091FA1181C00BC02D9 /* JSServiceWorkerClientType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerClientType.h; sourceTree = "<group>"; };
+		83B2500B1FA1181D00BC02D9 /* JSServiceWorkerClientType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorkerClientType.cpp; sourceTree = "<group>"; };
 		83B74EF21F3E0BD700996BC7 /* KeepaliveRequestTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeepaliveRequestTracker.cpp; sourceTree = "<group>"; };
 		83B74EF31F3E0BD700996BC7 /* KeepaliveRequestTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeepaliveRequestTracker.h; sourceTree = "<group>"; };
 		83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderConverter.h; sourceTree = "<group>"; };
@@ -18087,6 +18092,8 @@
 				46EB37C31F97CCCB00B65523 /* JSServiceWorkerClient.h */,
 				46EB37C41F97CCCB00B65523 /* JSServiceWorkerClients.cpp */,
 				46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */,
+				83B2500B1FA1181D00BC02D9 /* JSServiceWorkerClientType.cpp */,
+				83B250091FA1181C00BC02D9 /* JSServiceWorkerClientType.h */,
 				5182C2511F3142500059BA7C /* JSServiceWorkerContainer.cpp */,
 				5182C2541F3142500059BA7C /* JSServiceWorkerContainer.h */,
 				5182C24E1F3142500059BA7C /* JSServiceWorkerGlobalScope.cpp */,
@@ -18183,6 +18190,8 @@
 				46EF14211F97B7BA00C2A524 /* ServiceWorkerClients.cpp */,
 				46EF14221F97B7BA00C2A524 /* ServiceWorkerClients.h */,
 				46EF14231F97B7BA00C2A524 /* ServiceWorkerClients.idl */,
+				8369FDFB1FA102CB00C1FF1F /* ServiceWorkerClientType.h */,
+				8369FDF91FA102CA00C1FF1F /* ServiceWorkerClientType.idl */,
 				51F175581F3EBC0C00C74950 /* ServiceWorkerContainer.cpp */,
 				51F175571F3EBC0C00C74950 /* ServiceWorkerContainer.h */,
 				51F175561F3EBC0C00C74950 /* ServiceWorkerContainer.idl */,
@@ -29518,6 +29527,7 @@
 				51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
 				46EF142D1F97B7D800C2A524 /* ServiceWorkerClient.h in Headers */,
 				46EF142C1F97B7D800C2A524 /* ServiceWorkerClients.h in Headers */,
+				8369FDFC1FA102E300C1FF1F /* ServiceWorkerClientType.h in Headers */,
 				51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
 				51CA7EE91F883390003D3131 /* ServiceWorkerContextData.h in Headers */,
 				419ACF921F97E7DA009F1A83 /* ServiceWorkerFetch.h in Headers */,

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp (223972 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.cpp	2017-10-25 19:36:08 UTC (rev 223973)
@@ -56,6 +56,11 @@
     return FrameType::None;
 }
 
+auto ServiceWorkerClient::type() const -> Type
+{
+    return Type::Window;
+}
+
 String ServiceWorkerClient::id() const
 {
     return { };

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.h (223972 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.h	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.h	2017-10-25 19:36:08 UTC (rev 223973)
@@ -29,6 +29,7 @@
 
 #include "ActiveDOMObject.h"
 #include "ExceptionOr.h"
+#include "ServiceWorkerClientType.h"
 #include <heap/Strong.h>
 #include <wtf/RefCounted.h>
 
@@ -41,6 +42,7 @@
 
 class ServiceWorkerClient : public RefCounted<ServiceWorkerClient>, public ActiveDOMObject {
 public:
+    using Type = ServiceWorkerClientType;
     enum class FrameType {
         Auxiliary,
         TopLevel,
@@ -50,6 +52,7 @@
 
     String url() const;
     FrameType frameType() const;
+    Type type() const;
     String id() const;
 
     ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&& transfer);

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl (223972 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl	2017-10-25 19:36:08 UTC (rev 223973)
@@ -31,6 +31,7 @@
 ] interface ServiceWorkerClient {
     readonly attribute USVString url;
     readonly attribute FrameType frameType;
+    readonly attribute ServiceWorkerClientType type;
     readonly attribute DOMString id;
 
     [CallWith=ScriptState, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);

Copied: trunk/Source/WebCore/workers/service/ServiceWorkerClientType.h (from rev 223972, trunk/Source/WebCore/workers/service/ServiceWorkerClient.idl) (0 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClientType.h	                        (rev 0)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClientType.h	2017-10-25 19:36:08 UTC (rev 223973)
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#if ENABLE(SERVICE_WORKER)
+
+namespace WebCore {
+
+enum class ServiceWorkerClientType {
+    Window,
+    Worker,
+    Sharedworker,
+    All
+};
+
+}
+
+#endif

Added: trunk/Source/WebCore/workers/service/ServiceWorkerClientType.idl (0 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClientType.idl	                        (rev 0)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClientType.idl	2017-10-25 19:36:08 UTC (rev 223973)
@@ -0,0 +1,9 @@
+
+[
+    Conditional=SERVICE_WORKER,
+] enum ServiceWorkerClientType {
+    "window",
+    "worker",
+    "sharedworker",
+    "all"
+};

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClients.h (223972 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClients.h	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClients.h	2017-10-25 19:36:08 UTC (rev 223973)
@@ -28,6 +28,7 @@
 #if ENABLE(SERVICE_WORKER)
 
 #include "ActiveDOMObject.h"
+#include "ServiceWorkerClientType.h"
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 
@@ -42,16 +43,9 @@
         return adoptRef(*new ServiceWorkerClients(context));
     }
 
-    enum class ClientType {
-        Window,
-        Worker,
-        Sharedworker,
-        All
-    };
-
     struct ClientQueryOptions {
         bool includeUncontrolled { false };
-        ClientType type { ClientType::Window };
+        ServiceWorkerClientType type { ServiceWorkerClientType::Window };
     };
 
     void get(const String& id, Ref<DeferredPromise>&&);

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClients.idl (223972 => 223973)


--- trunk/Source/WebCore/workers/service/ServiceWorkerClients.idl	2017-10-25 19:27:05 UTC (rev 223972)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClients.idl	2017-10-25 19:36:08 UTC (rev 223973)
@@ -38,12 +38,5 @@
 
 dictionary ClientQueryOptions {
     boolean includeUncontrolled = false;
-    ClientType type = "window";
+    ServiceWorkerClientType type = "window";
 };
-
-enum ClientType {
-    "window",
-    "worker",
-    "sharedworker",
-    "all"
-};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to