Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Issue 2369693002: Shapedetection module: Blink side implementation (Closed)

Created:
4 years, 2 months ago by xianglu
Modified:
4 years, 2 months ago
CC:
Aaron Boodman, abarth-chromium, blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin (slow to review), dglazkov+blink, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Shapedetection module: Blink side implementation This CL implements mojom client on blink side. - FaceDetector::detect() sends an image to the browser through shared_buffer; - FaceDetector::onDetectFace() receives a list of boundingBoxes from Chrome. A mock mojom server is added to test the connection. This CL also reduces the API surface by removing Detector and DetectedObject interface, so that the hierarchy is simpler and cleaner. BUG=646083 TEST=Pass LayoutTest detectface.html Committed: https://crrev.com/ad9ded8c22140567a8bb457f1e64904da7ab4a19 Cr-Commit-Position: refs/heads/master@{#422729}

Patch Set 1 : Refactor code into getSharedBufferHandle() && Update *-expected.txt #

Total comments: 26

Patch Set 2 : Naming and const correctness suggestions by mcasas@ #

Total comments: 10

Patch Set 3 : rockot@ comments #

Total comments: 14

Patch Set 4 : Code reformatting #

Total comments: 12

Patch Set 5 : mcasas@ comments #

Total comments: 5

Patch Set 6 : FaceDetector: remove normalization && use ScriptState in constructor #

Total comments: 1

Patch Set 7 : tests outside the [0, 1] range #

Unified diffs Side-by-side diffs Delta from patch set Stats (+284 lines, -145 lines) Patch
M content/public/app/mojo/content_browser_manifest.json View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-creation.html View 1 chunk +0 lines, -16 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/shapedetection/detectface.html View 1 2 1 chunk +43 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js View 1 2 3 4 5 6 1 chunk +45 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/modules/modules_idl_files.gni View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/DEPS View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/DetectedFace.h View 1 2 3 1 chunk +9 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/DetectedFace.cpp View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/DetectedObject.h View 1 2 3 4 1 chunk +0 lines, -28 lines 0 comments Download
D third_party/WebKit/Source/modules/shapedetection/DetectedObject.idl View 1 chunk +0 lines, -13 lines 0 comments Download
D third_party/WebKit/Source/modules/shapedetection/Detector.h View 1 2 3 1 chunk +0 lines, -29 lines 0 comments Download
D third_party/WebKit/Source/modules/shapedetection/Detector.idl View 1 chunk +0 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/FaceDetector.h View 1 2 3 4 5 1 chunk +22 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp View 1 2 3 4 5 1 chunk +117 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/public/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A + third_party/WebKit/public/platform/modules/shapedetection/OWNERS View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A third_party/WebKit/public/platform/modules/shapedetection/shapedetection.mojom View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 95 (72 generated)
xianglu
ptal.
4 years, 2 months ago (2016-09-29 21:51:37 UTC) #29
mcasas
A few minor comments. https://codereview.chromium.org/2369693002/diff/260001/third_party/WebKit/LayoutTests/shapedetection/detectface.html File third_party/WebKit/LayoutTests/shapedetection/detectface.html (right): https://codereview.chromium.org/2369693002/diff/260001/third_party/WebKit/LayoutTests/shapedetection/detectface.html#newcode30 third_party/WebKit/LayoutTests/shapedetection/detectface.html:30: uint32ArrayReceivedByMock = theMock.getFrameData(); s/uint32ArrayReceivedByMock/const receivedImage/ ...
4 years, 2 months ago (2016-09-30 02:14:59 UTC) #39
xianglu
ptal. https://codereview.chromium.org/2369693002/diff/260001/third_party/WebKit/LayoutTests/shapedetection/detectface.html File third_party/WebKit/LayoutTests/shapedetection/detectface.html (right): https://codereview.chromium.org/2369693002/diff/260001/third_party/WebKit/LayoutTests/shapedetection/detectface.html#newcode30 third_party/WebKit/LayoutTests/shapedetection/detectface.html:30: uint32ArrayReceivedByMock = theMock.getFrameData(); On 2016/09/30 02:14:59, mcasas wrote: ...
4 years, 2 months ago (2016-09-30 16:37:41 UTC) #42
xianglu
ptal.
4 years, 2 months ago (2016-09-30 16:53:10 UTC) #44
xianglu
Hi Ken, please take a look at SharedBuffer in FaceDetector.cpp, shapedetection.mojom, mock-shapedetection.js and detectface.html. Thanks!
4 years, 2 months ago (2016-09-30 17:01:51 UTC) #46
Ken Rockot(use gerrit already)
Generally looks good, a few comments https://codereview.chromium.org/2369693002/diff/280001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js File third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js (right): https://codereview.chromium.org/2369693002/diff/280001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js#newcode25 third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js:25: let mojoResult = ...
4 years, 2 months ago (2016-09-30 18:05:24 UTC) #48
xianglu
ptal. https://codereview.chromium.org/2369693002/diff/280001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js File third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js (right): https://codereview.chromium.org/2369693002/diff/280001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js#newcode25 third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js:25: let mojoResult = mojo.mapBuffer(frame_data, 0 /*offset*/, width*height*4/*size*/, 0/*flag*/); ...
4 years, 2 months ago (2016-10-03 18:12:08 UTC) #56
Ken Rockot(use gerrit already)
lgtm
4 years, 2 months ago (2016-10-03 18:20:38 UTC) #57
xianglu
tsepez@, PTAL at public/platform/modules/shapedetection/shapedetection.mojom
4 years, 2 months ago (2016-10-03 19:59:30 UTC) #64
mcasas
looking good, a few comments. https://codereview.chromium.org/2369693002/diff/340001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js File third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js (right): https://codereview.chromium.org/2369693002/diff/340001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js#newcode20 third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js:20: this.stub_ = connection.bindHandleToStub(pipe, shapeDetection.ShapeDetection); ...
4 years, 2 months ago (2016-10-03 21:02:47 UTC) #65
Tom Sepez
mojom LGTM after reformatting to 80 cols.
4 years, 2 months ago (2016-10-03 21:54:31 UTC) #66
xianglu
mcasas@ ptal. https://codereview.chromium.org/2369693002/diff/340001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js File third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js (right): https://codereview.chromium.org/2369693002/diff/340001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js#newcode20 third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js:20: this.stub_ = connection.bindHandleToStub(pipe, shapeDetection.ShapeDetection); On 2016/10/03 21:02:46, ...
4 years, 2 months ago (2016-10-03 22:00:06 UTC) #67
mcasas
lgtm with some comments/nits https://codereview.chromium.org/2369693002/diff/360001/third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl File third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl (right): https://codereview.chromium.org/2369693002/diff/360001/third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl#newcode11 third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl:11: // TODO(xianglu): Implement missing fields. ...
4 years, 2 months ago (2016-10-03 22:18:09 UTC) #70
esprehn
Hmm, I'm not sure I understand those asserts. You assert that x + width <= ...
4 years, 2 months ago (2016-10-03 23:59:38 UTC) #74
haraken
https://codereview.chromium.org/2369693002/diff/380001/third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl File third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl (right): https://codereview.chromium.org/2369693002/diff/380001/third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl#newcode10 third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl:10: ConstructorCallWith=Document, Use ConstructorCallWith=ScriptState. We're unifying all information about script ...
4 years, 2 months ago (2016-10-04 00:03:54 UTC) #76
xianglu
esprehn@, haraken@, ptal. https://codereview.chromium.org/2369693002/diff/360001/third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl File third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl (right): https://codereview.chromium.org/2369693002/diff/360001/third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl#newcode11 third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl:11: // TODO(xianglu): Implement missing fields. https://crbug.com/646083 ...
4 years, 2 months ago (2016-10-04 00:58:26 UTC) #78
esprehn
lgtm https://codereview.chromium.org/2369693002/diff/440001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js File third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js (right): https://codereview.chromium.org/2369693002/diff/440001/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js#newcode33 third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js:33: { x : 0.0, y: 0.0, width: 0.8, ...
4 years, 2 months ago (2016-10-04 01:01:44 UTC) #79
haraken
LGTM
4 years, 2 months ago (2016-10-04 02:15:33 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2369693002/460001
4 years, 2 months ago (2016-10-04 07:18:43 UTC) #89
commit-bot: I haz the power
Committed patchset #7 (id:460001)
4 years, 2 months ago (2016-10-04 07:24:35 UTC) #91
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/ad9ded8c22140567a8bb457f1e64904da7ab4a19 Cr-Commit-Position: refs/heads/master@{#422729}
4 years, 2 months ago (2016-10-04 07:26:23 UTC) #93
qyearsley
On 2016/10/04 at 07:26:23, commit-bot wrote: > Patchset 7 (id:??) landed as https://crrev.com/ad9ded8c22140567a8bb457f1e64904da7ab4a19 > Cr-Commit-Position: ...
4 years, 2 months ago (2016-10-04 16:27:42 UTC) #94
qyearsley
4 years, 2 months ago (2016-10-04 21:51:32 UTC) #95
Message was sent while issue was closed.
On 2016/10/04 at 16:27:42, qyearsley wrote:
> On 2016/10/04 at 07:26:23, commit-bot wrote:
> > Patchset 7 (id:??) landed as
https://crrev.com/ad9ded8c22140567a8bb457f1e64904da7ab4a19
> > Cr-Commit-Position: refs/heads/master@{#422729}
> 
> Note, it looks like some builders on chromium.webkit may be failing
shapedetection/detectface.html after this CL. But not all; notably, linux is
passing.

Update: This is http://crbug.com/652761, should be fixed by
http://crrev.com/2389093003.

Powered by Google App Engine
This is Rietveld 408576698