Commit 57ae4c5d authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Create separate Blink feature flags for Shape Detection APIs

The BarcodeDetector, FaceDetector and TextDetector APIs will be released
individually. This change creates separate runtime enabled feature flags
for each to allow this staggered release.

BarcodeDetector is marked stable for launch.

Intent to Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/j-PLtssE5fo/budv_U6fCwAJ

Bug: 659138
Change-Id: I880ac0d4a619e907b7e310b514f082b470bfad14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717915
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarYoav Weiss <yoavweiss@chromium.org>
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741673}
parent b7d936c3
...@@ -49,9 +49,9 @@ class ShapeDetectionBrowserTest ...@@ -49,9 +49,9 @@ class ShapeDetectionBrowserTest
public ::testing::WithParamInterface<struct TestParameters> { public ::testing::WithParamInterface<struct TestParameters> {
public: public:
void SetUpCommandLine(base::CommandLine* command_line) override { void SetUpCommandLine(base::CommandLine* command_line) override {
// Flag to enable ShapeDetection API. // Enable FaceDetector since it is still experimental.
CommandLine::ForCurrentProcess()->AppendSwitchASCII( CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kEnableBlinkFeatures, "ShapeDetection"); switches::kEnableBlinkFeatures, "FaceDetector");
} }
protected: protected:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
[ [
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext, SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=BarcodeDetector
] interface BarcodeDetector { ] interface BarcodeDetector {
[CallWith=ExecutionContext, RaisesException, MeasureAs=ShapeDetection_BarcodeDetectorConstructor] constructor(optional BarcodeDetectorOptions barcodeDetectorOptions = {}); [CallWith=ExecutionContext, RaisesException, MeasureAs=ShapeDetection_BarcodeDetectorConstructor] constructor(optional BarcodeDetectorOptions barcodeDetectorOptions = {});
[CallWith=ScriptState] static Promise<sequence<BarcodeFormat>> getSupportedFormats(); [CallWith=ScriptState] static Promise<sequence<BarcodeFormat>> getSupportedFormats();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
[ [
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext, SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=FaceDetector
] interface FaceDetector { ] interface FaceDetector {
[CallWith=ExecutionContext, MeasureAs=ShapeDetection_FaceDetectorConstructor] constructor(optional FaceDetectorOptions faceDetectorOptions = {}); [CallWith=ExecutionContext, MeasureAs=ShapeDetection_FaceDetectorConstructor] constructor(optional FaceDetectorOptions faceDetectorOptions = {});
[CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image); [CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
[ [
Exposed=(Window,Worker), Exposed=(Window,Worker),
SecureContext, SecureContext,
RuntimeEnabled=ShapeDetection RuntimeEnabled=TextDetector
] interface TextDetector { ] interface TextDetector {
[CallWith=ExecutionContext, MeasureAs=ShapeDetection_TextDetectorConstructor] constructor(); [CallWith=ExecutionContext, MeasureAs=ShapeDetection_TextDetectorConstructor] constructor();
[CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedText>> detect(ImageBitmapSource image); [CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedText>> detect(ImageBitmapSource image);
......
...@@ -230,6 +230,10 @@ ...@@ -230,6 +230,10 @@
name: "Badging", name: "Badging",
status: "stable", status: "stable",
}, },
{
name: "BarcodeDetector",
status: "stable",
},
{ {
name: "BidiCaretAffinity", name: "BidiCaretAffinity",
}, },
...@@ -706,6 +710,10 @@ ...@@ -706,6 +710,10 @@
{ {
name: "ExtraWebGLVideoTextureMetadata", name: "ExtraWebGLVideoTextureMetadata",
}, },
{
name: "FaceDetector",
status: "experimental",
},
{ {
name: "FallbackCursorMode", name: "FallbackCursorMode",
}, },
...@@ -1582,10 +1590,6 @@ ...@@ -1582,10 +1590,6 @@
name: "ShadowPiercingDescendantCombinator", name: "ShadowPiercingDescendantCombinator",
status: "experimental", status: "experimental",
}, },
{
name: "ShapeDetection",
status: "experimental",
},
{ {
name: "SharedArrayBuffer", name: "SharedArrayBuffer",
status: "stable", status: "stable",
...@@ -1649,6 +1653,10 @@ ...@@ -1649,6 +1653,10 @@
name: "SurfaceEmbeddingFeatures", name: "SurfaceEmbeddingFeatures",
status: "stable", status: "stable",
}, },
{
name: "TextDetector",
status: "experimental",
},
{ {
name: "TextFragmentIdentifiers", name: "TextFragmentIdentifiers",
origin_trial_feature_name: "TextFragmentIdentifiers", origin_trial_feature_name: "TextFragmentIdentifiers",
......
...@@ -49,6 +49,11 @@ interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent ...@@ -49,6 +49,11 @@ interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent
attribute @@toStringTag attribute @@toStringTag
method constructor method constructor
method updateUI method updateUI
interface BarcodeDetector
static method getSupportedFormats
attribute @@toStringTag
method constructor
method detect
interface Blob interface Blob
attribute @@toStringTag attribute @@toStringTag
getter size getter size
......
...@@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method match [Worker] method match
[Worker] method matchAll [Worker] method matchAll
[Worker] setter onprogress [Worker] setter onprogress
[Worker] interface BarcodeDetector
[Worker] static method getSupportedFormats
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method detect
[Worker] interface Blob [Worker] interface Blob
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter size [Worker] getter size
......
...@@ -290,6 +290,11 @@ interface BarProp ...@@ -290,6 +290,11 @@ interface BarProp
attribute @@toStringTag attribute @@toStringTag
getter visible getter visible
method constructor method constructor
interface BarcodeDetector
static method getSupportedFormats
attribute @@toStringTag
method constructor
method detect
interface BaseAudioContext : EventTarget interface BaseAudioContext : EventTarget
attribute @@toStringTag attribute @@toStringTag
getter audioWorklet getter audioWorklet
......
...@@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method match [Worker] method match
[Worker] method matchAll [Worker] method matchAll
[Worker] setter onprogress [Worker] setter onprogress
[Worker] interface BarcodeDetector
[Worker] static method getSupportedFormats
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method detect
[Worker] interface Blob [Worker] interface Blob
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter size [Worker] getter size
......
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