Commit 489ea56f authored by Miguel Casas-Sanchez's avatar Miguel Casas-Sanchez Committed by Commit Bot

Shape Detection: use constructors for UMA counters instead of detect() methods

Remove the per-detect() UMA counters and use instead constructors,
because in a normal usage pattern the detect() method can be called
many times on the same object, and we don't want to skew the UMA.

Bug: 659138
Change-Id: Ib4aef88c35dd4853ececbf71cc12a96eaca020f3
Reviewed-on: https://chromium-review.googlesource.com/511344
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#473798}
parent f1ca6523
...@@ -1310,8 +1310,6 @@ class CORE_EXPORT UseCounter { ...@@ -1310,8 +1310,6 @@ class CORE_EXPORT UseCounter {
kCSSFlexibleBox = 1692, kCSSFlexibleBox = 1692,
kCSSGridLayout = 1693, kCSSGridLayout = 1693,
kV8BarcodeDetector_Detect_Method = 1694,
kV8FaceDetector_Detect_Method = 1695,
kFullscreenAllowedByOrientationChange = 1696, kFullscreenAllowedByOrientationChange = 1696,
kServiceWorkerRespondToNavigationRequestWithRedirectedResponse = 1697, kServiceWorkerRespondToNavigationRequestWithRedirectedResponse = 1697,
kV8AudioContext_Constructor = 1698, kV8AudioContext_Constructor = 1698,
...@@ -1413,7 +1411,6 @@ class CORE_EXPORT UseCounter { ...@@ -1413,7 +1411,6 @@ class CORE_EXPORT UseCounter {
kCSSValueUserModifyReadOnly = 1798, kCSSValueUserModifyReadOnly = 1798,
kCSSValueUserModifyReadWrite = 1799, kCSSValueUserModifyReadWrite = 1799,
kCSSValueUserModifyReadWritePlaintextOnly = 1800, kCSSValueUserModifyReadWritePlaintextOnly = 1800,
kV8TextDetector_Detect_Method = 1801,
kCSSValueOnDemand = 1802, kCSSValueOnDemand = 1802,
kServiceWorkerNavigationPreload = 1803, kServiceWorkerNavigationPreload = 1803,
kFullscreenRequestWithPendingElement = 1804, kFullscreenRequestWithPendingElement = 1804,
...@@ -1602,6 +1599,9 @@ class CORE_EXPORT UseCounter { ...@@ -1602,6 +1599,9 @@ class CORE_EXPORT UseCounter {
kCredentialManagerCustomFetch = 1988, kCredentialManagerCustomFetch = 1988,
kNetInfoRtt = 1989, kNetInfoRtt = 1989,
kNetInfoDownlink = 1990, kNetInfoDownlink = 1990,
kShapeDetection_BarcodeDetectorConstructor = 1991,
kShapeDetection_FaceDetectorConstructor = 1992,
kShapeDetection_TextDetectorConstructor = 1993,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
[ [
Constructor, Constructor,
Exposed=(Window,Worker), Exposed=(Window,Worker),
MeasureAs=ShapeDetection_BarcodeDetectorConstructor,
RuntimeEnabled=ShapeDetection, RuntimeEnabled=ShapeDetection,
] interface BarcodeDetector { ] interface BarcodeDetector {
[CallWith=ScriptState, Measure] Promise<sequence<DetectedBarcode>> detect(ImageBitmapSource image); [CallWith=ScriptState] Promise<sequence<DetectedBarcode>> detect(ImageBitmapSource image);
}; };
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
[ [
Constructor(optional FaceDetectorOptions faceDetectorOptions), Constructor(optional FaceDetectorOptions faceDetectorOptions),
Exposed=(Window,Worker), Exposed=(Window,Worker),
MeasureAs=ShapeDetection_FaceDetectorConstructor,
RuntimeEnabled=ShapeDetection, RuntimeEnabled=ShapeDetection,
] interface FaceDetector { ] interface FaceDetector {
[CallWith=ScriptState, Measure] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image); [CallWith=ScriptState] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image);
}; };
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
[ [
Constructor, Constructor,
Exposed=(Window,Worker), Exposed=(Window,Worker),
MeasureAs=ShapeDetection_TextDetectorConstructor,
RuntimeEnabled=ShapeDetection, RuntimeEnabled=ShapeDetection,
] interface TextDetector { ] interface TextDetector {
[CallWith=ScriptState, Measure] Promise<sequence<DetectedText>> detect(ImageBitmapSource image); [CallWith=ScriptState] Promise<sequence<DetectedText>> detect(ImageBitmapSource image);
}; };
...@@ -15005,6 +15005,9 @@ uploading your change for review. These are checked by presubmit scripts. ...@@ -15005,6 +15005,9 @@ uploading your change for review. These are checked by presubmit scripts.
<int value="1988" label="CredentialManagerCustomFetch"/> <int value="1988" label="CredentialManagerCustomFetch"/>
<int value="1989" label="NetInfoRtt"/> <int value="1989" label="NetInfoRtt"/>
<int value="1990" label="NetInfoDownlink"/> <int value="1990" label="NetInfoDownlink"/>
<int value="1991" label="ShapeDetection_BarcodeDetectorConstructor"/>
<int value="1992" label="ShapeDetection_FaceDetectorConstructor"/>
<int value="1993" label="ShapeDetection_TextDetectorConstructor"/>
</enum> </enum>
<enum name="FeedbackSource" type="int"> <enum name="FeedbackSource" type="int">
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