Commit e56b140c authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Ship Transferable Streams

Remove the feature flag for Transferable Streams and turn it on by
default.

Also remove the web test that I created to stop us shipping it by
accident, since now we are shipping it on purpose.

See the intent to ship thread at
https://groups.google.com/a/chromium.org/g/blink-dev/c/1LStSgBt6AM/m/sJaTciPKBwAJ
and the completed TAG review at
https://github.com/w3ctag/design-reviews/issues/551.

BUG=894838

Change-Id: I56f8891bd1051202ef68bb4623ad8bec53045dff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2428509Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811606}
parent 9d520f2f
...@@ -370,7 +370,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() { ...@@ -370,7 +370,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"RawClipboard", blink::features::kRawClipboard}, {"RawClipboard", blink::features::kRawClipboard},
{"ShadowDOMV0", blink::features::kWebComponentsV0}, {"ShadowDOMV0", blink::features::kWebComponentsV0},
{"StorageAccessAPI", blink::features::kStorageAccessAPI}, {"StorageAccessAPI", blink::features::kStorageAccessAPI},
{"TransferableStreams", blink::features::kTransferableStreams},
{"TrustedDOMTypes", features::kTrustedDOMTypes}, {"TrustedDOMTypes", features::kTrustedDOMTypes},
{"UserAgentClientHint", features::kUserAgentClientHint}, {"UserAgentClientHint", features::kUserAgentClientHint},
{"WebAppManifestDisplayOverride", {"WebAppManifestDisplayOverride",
......
...@@ -6943,27 +6943,6 @@ ...@@ -6943,27 +6943,6 @@
] ]
} }
], ],
"TransferableStreams": [
{
"platforms": [
"android",
"android_weblayer",
"android_webview",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"TransferableStreams"
]
}
]
}
],
"TranslateCompactUI": [ "TranslateCompactUI": [
{ {
"platforms": [ "platforms": [
......
...@@ -750,11 +750,6 @@ const base::Feature kReducedReferrerGranularity{ ...@@ -750,11 +750,6 @@ const base::Feature kReducedReferrerGranularity{
const base::Feature kContentCaptureUserActivatedDelay = { const base::Feature kContentCaptureUserActivatedDelay = {
"ContentCaptureUserActivatedDelay", base::FEATURE_DISABLED_BY_DEFAULT}; "ContentCaptureUserActivatedDelay", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable ReadableStream, WritableStream and TransformStream objects to be
// transferred with postMessage().
const base::Feature kTransferableStreams{"TransferableStreams",
base::FEATURE_DISABLED_BY_DEFAULT};
// Dispatches a fake fetch event to a service worker to check the offline // Dispatches a fake fetch event to a service worker to check the offline
// capability of the site before promoting installation. // capability of the site before promoting installation.
// See https://crbug.com/965802 for more details. // See https://crbug.com/965802 for more details.
......
...@@ -303,8 +303,6 @@ BLINK_COMMON_EXPORT extern const base::Feature kReducedReferrerGranularity; ...@@ -303,8 +303,6 @@ BLINK_COMMON_EXPORT extern const base::Feature kReducedReferrerGranularity;
BLINK_COMMON_EXPORT extern const base::Feature BLINK_COMMON_EXPORT extern const base::Feature
kContentCaptureUserActivatedDelay; kContentCaptureUserActivatedDelay;
BLINK_COMMON_EXPORT extern const base::Feature kTransferableStreams;
BLINK_COMMON_EXPORT extern const base::Feature kCheckOfflineCapability; BLINK_COMMON_EXPORT extern const base::Feature kCheckOfflineCapability;
BLINK_COMMON_EXPORT extern const base::Feature BLINK_COMMON_EXPORT extern const base::Feature
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include "third_party/blink/renderer/platform/file_metadata.h" #include "third_party/blink/renderer/platform/file_metadata.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h" #include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/date_math.h" #include "third_party/blink/renderer/platform/wtf/date_math.h"
#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkImage.h"
...@@ -1879,8 +1878,6 @@ TEST(V8ScriptValueSerializerTest, DecodeWithInefficientVersionEnvelope) { ...@@ -1879,8 +1878,6 @@ TEST(V8ScriptValueSerializerTest, DecodeWithInefficientVersionEnvelope) {
// Sanity check for transferring ReadableStreams. This is mostly tested via // Sanity check for transferring ReadableStreams. This is mostly tested via
// web tests. // web tests.
TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) { TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope; V8TestingScope scope;
auto* isolate = scope.GetIsolate(); auto* isolate = scope.GetIsolate();
auto* script_state = scope.GetScriptState(); auto* script_state = scope.GetScriptState();
...@@ -1903,8 +1900,6 @@ TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) { ...@@ -1903,8 +1900,6 @@ TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) {
} }
TEST(V8ScriptValueSerializerTest, TransformStreamIntegerOverflow) { TEST(V8ScriptValueSerializerTest, TransformStreamIntegerOverflow) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope; V8TestingScope scope;
auto* isolate = scope.GetIsolate(); auto* isolate = scope.GetIsolate();
auto* script_state = scope.GetScriptState(); auto* script_state = scope.GetScriptState();
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/string_resource.h" #include "third_party/blink/renderer/platform/bindings/string_resource.h"
#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
...@@ -354,8 +353,6 @@ TEST_F(ReadableStreamTest, LockAndDisturb) { ...@@ -354,8 +353,6 @@ TEST_F(ReadableStreamTest, LockAndDisturb) {
} }
TEST_F(ReadableStreamTest, Serialize) { TEST_F(ReadableStreamTest, Serialize) {
ScopedTransferableStreamsForTest enabled(true);
V8TestingScope scope; V8TestingScope scope;
auto* script_state = scope.GetScriptState(); auto* script_state = scope.GetScriptState();
auto* isolate = scope.GetIsolate(); auto* isolate = scope.GetIsolate();
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h" #include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
...@@ -48,8 +47,6 @@ TEST(WritableStreamTest, GetWriter) { ...@@ -48,8 +47,6 @@ TEST(WritableStreamTest, GetWriter) {
} }
TEST(WritableStreamTest, Serialize) { TEST(WritableStreamTest, Serialize) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope; V8TestingScope scope;
auto* script_state = scope.GetScriptState(); auto* script_state = scope.GetScriptState();
......
...@@ -1870,7 +1870,7 @@ ...@@ -1870,7 +1870,7 @@
}, },
{ {
name: "TransferableStreams", name: "TransferableStreams",
status: "experimental", status: "stable",
origin_trial_feature_name: "RTCInsertableStreams", origin_trial_feature_name: "RTCInsertableStreams",
implied_by: ["RTCInsertableStreams"], implied_by: ["RTCInsertableStreams"],
}, },
......
...@@ -111,7 +111,6 @@ ...@@ -111,7 +111,6 @@
"prefix": "stable", "prefix": "stable",
"bases": ["fast/css3-text/css3-text-decoration/stable", "bases": ["fast/css3-text/css3-text-decoration/stable",
"fast/dom/Window", "fast/dom/Window",
"http/tests/streams/transferable/enabled",
"http/tests/navigation", "http/tests/navigation",
"http/tests/origin_trials/feature-policy-reporting", "http/tests/origin_trials/feature-policy-reporting",
"http/tests/sendbeacon", "http/tests/sendbeacon",
......
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// Quick test for whether transferable streams are enabled or not, since it
// doesn't affect the symbols visible on the global object. When not enabled,
// all the tests should fail. This will help prevent accidentally shipping the
// feature.
test(() => {
const rs = new ReadableStream();
postMessage(rs, '*', [rs]);
}, 'postMessage of a ReadableStream should work');
test(() => {
const ws = new WritableStream();
postMessage(ws, '*', [ws]);
}, 'postMessage of a WritableStream should work');
test(() => {
const ts = new TransformStream();
postMessage(ts, '*', [ts]);
}, 'postMessage of a TransformStream should work');
</script>
This test exists to ensure that transferable streams are not shipped by
accident. If all three subtests are failing, then transferable streams are not
enabled.
This is a testharness.js-based test.
FAIL postMessage of a ReadableStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
FAIL postMessage of a WritableStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
FAIL postMessage of a TransformStream should work Failed to execute 'postMessage' on 'Window': Value at index 0 does not have a transferable type.
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment