0

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/+/2428509
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811606}
This commit is contained in:
Adam Rice
2020-09-29 07:22:57 +00:00
committed by Commit Bot
parent 9d520f2f73
commit e56b140ca1
12 changed files with 1 additions and 76 deletions
content/child
testing/variations
third_party/blink
common
public
renderer
web_tests
VirtualTestSuites
http
tests
streams
transferable
virtual
stable
http
tests
streams

@ -370,7 +370,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"RawClipboard", blink::features::kRawClipboard},
{"ShadowDOMV0", blink::features::kWebComponentsV0},
{"StorageAccessAPI", blink::features::kStorageAccessAPI},
{"TransferableStreams", blink::features::kTransferableStreams},
{"TrustedDOMTypes", features::kTrustedDOMTypes},
{"UserAgentClientHint", features::kUserAgentClientHint},
{"WebAppManifestDisplayOverride",

@ -6943,27 +6943,6 @@
]
}
],
"TransferableStreams": [
{
"platforms": [
"android",
"android_weblayer",
"android_webview",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"TransferableStreams"
]
}
]
}
],
"TranslateCompactUI": [
{
"platforms": [

@ -750,11 +750,6 @@ const base::Feature kReducedReferrerGranularity{
const base::Feature kContentCaptureUserActivatedDelay = {
"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
// capability of the site before promoting installation.
// See https://crbug.com/965802 for more details.

@ -303,8 +303,6 @@ BLINK_COMMON_EXPORT extern const base::Feature kReducedReferrerGranularity;
BLINK_COMMON_EXPORT extern const base::Feature
kContentCaptureUserActivatedDelay;
BLINK_COMMON_EXPORT extern const base::Feature kTransferableStreams;
BLINK_COMMON_EXPORT extern const base::Feature kCheckOfflineCapability;
BLINK_COMMON_EXPORT extern const base::Feature

@ -55,7 +55,6 @@
#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/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/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
@ -1879,8 +1878,6 @@ TEST(V8ScriptValueSerializerTest, DecodeWithInefficientVersionEnvelope) {
// Sanity check for transferring ReadableStreams. This is mostly tested via
// web tests.
TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope;
auto* isolate = scope.GetIsolate();
auto* script_state = scope.GetScriptState();
@ -1903,8 +1900,6 @@ TEST(V8ScriptValueSerializerTest, RoundTripReadableStream) {
}
TEST(V8ScriptValueSerializerTest, TransformStreamIntegerOverflow) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope;
auto* isolate = scope.GetIsolate();
auto* script_state = scope.GetScriptState();

@ -21,7 +21,6 @@
#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/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 "v8/include/v8.h"
@ -354,8 +353,6 @@ TEST_F(ReadableStreamTest, LockAndDisturb) {
}
TEST_F(ReadableStreamTest, Serialize) {
ScopedTransferableStreamsForTest enabled(true);
V8TestingScope scope;
auto* script_state = scope.GetScriptState();
auto* isolate = scope.GetIsolate();

@ -14,7 +14,6 @@
#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/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 "v8/include/v8.h"
@ -48,8 +47,6 @@ TEST(WritableStreamTest, GetWriter) {
}
TEST(WritableStreamTest, Serialize) {
ScopedTransferableStreamsForTest enable_transferable_streams(true);
V8TestingScope scope;
auto* script_state = scope.GetScriptState();

@ -1870,7 +1870,7 @@
},
{
name: "TransferableStreams",
status: "experimental",
status: "stable",
origin_trial_feature_name: "RTCInsertableStreams",
implied_by: ["RTCInsertableStreams"],
},

@ -111,7 +111,6 @@
"prefix": "stable",
"bases": ["fast/css3-text/css3-text-decoration/stable",
"fast/dom/Window",
"http/tests/streams/transferable/enabled",
"http/tests/navigation",
"http/tests/origin_trials/feature-policy-reporting",
"http/tests/sendbeacon",

@ -1,25 +0,0 @@
<!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>

@ -1,3 +0,0 @@
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.

@ -1,6 +0,0 @@
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.