WebKit Bugzilla
Attachment 343390 Details for
Bug 186931
: Disable WebSocket in WatchOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing, fixing path to testharness.js
bug-186931-20180622162125.patch (text/plain), 5.33 KB, created by
youenn fablet
on 2018-06-22 16:21:26 PDT
(
hide
)
Description:
Patch for landing, fixing path to testharness.js
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-06-22 16:21:26 PDT
Size:
5.33 KB
patch
obsolete
>Subversion Revision: 233079 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e33e37ef6a2593ab6db3a8c792578d043b85f08d..4b0aa985340493c6b4213da5fc461d73d5044dac 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-06-22 Youenn Fablet <youenn@apple.com> >+ >+ Disable WebSocket in WatchOS >+ https://bugs.webkit.org/show_bug.cgi?id=186931 >+ <rdar://problem/39584458> >+ >+ Reviewed by Wenson Hsieh. >+ >+ Add a runtime flag to enable/disable WebSocket. >+ By default, flag is on for all platforms except for WatchOS. >+ >+ Test: fast/dom/Window/watchos/websocket/watchos/no-websocket-in-watchos.html >+ >+ * Modules/websockets/WebSocket.idl: >+ * page/RuntimeEnabledFeatures.cpp: >+ (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setWebSocketEnabled): >+ (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): >+ > 2018-06-22 Youenn Fablet <youenn@apple.com> > > Incoming G722 doesn't work >diff --git a/Source/WebCore/Modules/websockets/WebSocket.idl b/Source/WebCore/Modules/websockets/WebSocket.idl >index 51a2b45263acb9a40ef50f49e2164d25aa15b7ae..90d55f176c8d66b1f09ae6ac78fc3bac58e3e31b 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.idl >+++ b/Source/WebCore/Modules/websockets/WebSocket.idl >@@ -36,6 +36,7 @@ > ConstructorMayThrowException, > ConstructorCallWith=ScriptExecutionContext, > Exposed=(Window,Worker), >+ EnabledAtRuntime=WebSocket > ] interface WebSocket : EventTarget { > readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons. > readonly attribute USVString url; >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.cpp b/Source/WebCore/page/RuntimeEnabledFeatures.cpp >index 8eb8e439dfca0b00fb031891e5633abd2c32cfea..4be436c3a38025e40535ba7c018831ad75d479da 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.cpp >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.cpp >@@ -43,6 +43,9 @@ RuntimeEnabledFeatures::RuntimeEnabledFeatures() > #if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA) > m_isMediaDevicesEnabled = false; > #endif >+#if PLATFORM(WATCHOS) >+ m_isWebSocketEnabled = false; >+#endif > } > > RuntimeEnabledFeatures& RuntimeEnabledFeatures::sharedFeatures() >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 8ac422ec490e36f4417c7aef7d57a14aa139c1a1..61ea8ed0e260df6eea1dd609c7b528ab42d9b739 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -194,7 +194,10 @@ public: > > void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; } > bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; } >- >+ >+ void setWebSocketEnabled(bool isEnabled) { m_isWebSocketEnabled = isEnabled; } >+ bool webSocketEnabled() const { return m_isWebSocketEnabled; } >+ > #if ENABLE(STREAMS_API) > void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; } > bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; } >@@ -370,6 +373,8 @@ private: > bool m_isCacheAPIEnabled { false }; > bool m_isFetchAPIEnabled { true }; > >+ bool m_isWebSocketEnabled { true }; >+ > #if ENABLE(DOWNLOAD_ATTRIBUTE) > bool m_isDownloadAttributeEnabled { false }; > #endif >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 898fbe548da186568f9af4726854c81c96b53b4c..e673efac2091f6c79764c8695df9656da800cfad 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-22 Youenn Fablet <youenn@apple.com> >+ >+ Disable WebSocket in WatchOS >+ https://bugs.webkit.org/show_bug.cgi?id=186931 >+ <rdar://problem/39584458> >+ >+ Reviewed by Wenson Hsieh. >+ >+ * TestExpectations: >+ * fast/dom/Window/watchos/no-websocket-in-watchos-expected.txt: Added. >+ * fast/dom/Window/watchos/no-websocket-in-watchos.html: Added. >+ > 2018-06-22 Youenn Fablet <youenn@apple.com> > > Incoming G722 doesn't work >diff --git a/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos-expected.txt b/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0ae93a41a11dfa40f0724c77a7845b2cc9c4dc08 >--- /dev/null >+++ b/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Ensure that WebSocket is disabled in WatchOS >+ >diff --git a/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos.html b/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a8831802de425421982b3beace005bb6bfc3099d >--- /dev/null >+++ b/LayoutTests/fast/dom/Window/watchos/no-websocket-in-watchos.html >@@ -0,0 +1,16 @@ >+<!doctype html> >+<html> >+ <head> >+ <meta charset="utf-8"> >+ <title>No websocket in watchos</title> >+ <script src="../../../../resources/testharness.js"></script> >+ <script src="../../../../resources/testharnessreport.js"></script> >+ </head> >+ <body> >+ <script> >+test(() => { >+ assert_equals(window.WebSocket, undefined); >+}, 'Ensure that WebSocket is disabled in WatchOS'); >+ </script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186931
:
343344
|
343353
|
343364
| 343390