Skip to content

Commit

Permalink
Create separate Blink feature flags for Shape Detection APIs
Browse files Browse the repository at this point in the history
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: Yoav Weiss <yoavweiss@chromium.org>
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741673}
  • Loading branch information
reillyeon authored and Commit Bot committed Feb 15, 2020
1 parent b7d936c commit 57ae4c5
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class ShapeDetectionBrowserTest
public ::testing::WithParamInterface<struct TestParameters> {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
// Flag to enable ShapeDetection API.
// Enable FaceDetector since it is still experimental.
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kEnableBlinkFeatures, "ShapeDetection");
switches::kEnableBlinkFeatures, "FaceDetector");
}

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection
RuntimeEnabled=BarcodeDetector
] interface BarcodeDetector {
[CallWith=ExecutionContext, RaisesException, MeasureAs=ShapeDetection_BarcodeDetectorConstructor] constructor(optional BarcodeDetectorOptions barcodeDetectorOptions = {});
[CallWith=ScriptState] static Promise<sequence<BarcodeFormat>> getSupportedFormats();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection
RuntimeEnabled=FaceDetector
] interface FaceDetector {
[CallWith=ExecutionContext, MeasureAs=ShapeDetection_FaceDetectorConstructor] constructor(optional FaceDetectorOptions faceDetectorOptions = {});
[CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[
Exposed=(Window,Worker),
SecureContext,
RuntimeEnabled=ShapeDetection
RuntimeEnabled=TextDetector
] interface TextDetector {
[CallWith=ExecutionContext, MeasureAs=ShapeDetection_TextDetectorConstructor] constructor();
[CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedText>> detect(ImageBitmapSource image);
Expand Down
16 changes: 12 additions & 4 deletions third_party/blink/renderer/platform/runtime_enabled_features.json5
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@
name: "Badging",
status: "stable",
},
{
name: "BarcodeDetector",
status: "stable",
},
{
name: "BidiCaretAffinity",
},
Expand Down Expand Up @@ -706,6 +710,10 @@
{
name: "ExtraWebGLVideoTextureMetadata",
},
{
name: "FaceDetector",
status: "experimental",
},
{
name: "FallbackCursorMode",
},
Expand Down Expand Up @@ -1582,10 +1590,6 @@
name: "ShadowPiercingDescendantCombinator",
status: "experimental",
},
{
name: "ShapeDetection",
status: "experimental",
},
{
name: "SharedArrayBuffer",
status: "stable",
Expand Down Expand Up @@ -1649,6 +1653,10 @@
name: "SurfaceEmbeddingFeatures",
status: "stable",
},
{
name: "TextDetector",
status: "experimental",
},
{
name: "TextFragmentIdentifiers",
origin_trial_feature_name: "TextFragmentIdentifiers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent
attribute @@toStringTag
method constructor
method updateUI
interface BarcodeDetector
static method getSupportedFormats
attribute @@toStringTag
method constructor
method detect
interface Blob
attribute @@toStringTag
getter size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method match
[Worker] method matchAll
[Worker] setter onprogress
[Worker] interface BarcodeDetector
[Worker] static method getSupportedFormats
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method detect
[Worker] interface Blob
[Worker] attribute @@toStringTag
[Worker] getter size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ interface BarProp
attribute @@toStringTag
getter visible
method constructor
interface BarcodeDetector
static method getSupportedFormats
attribute @@toStringTag
method constructor
method detect
interface BaseAudioContext : EventTarget
attribute @@toStringTag
getter audioWorklet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] method match
[Worker] method matchAll
[Worker] setter onprogress
[Worker] interface BarcodeDetector
[Worker] static method getSupportedFormats
[Worker] attribute @@toStringTag
[Worker] method constructor
[Worker] method detect
[Worker] interface Blob
[Worker] attribute @@toStringTag
[Worker] getter size
Expand Down

0 comments on commit 57ae4c5

Please sign in to comment.