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

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js

Issue 2818563006: ShapeDetection: Holding all of mock service to prevent GC (Closed)
Patch Set: ShapeDetection: Holding the MockFaceDetection to prevent Binding Object to be GCd Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/detection-options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
index 1faf89f7727c4a8bcbeb293978e3c643e5d2693a..3935fee7d57fd74f12209b4ace1594f14e6227a0 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
@@ -17,22 +17,24 @@ let mockFaceDetectionProviderReady = define(
interfaces.addInterfaceOverrideForTesting(
faceDetectionProvider.FaceDetectionProvider.name,
handle => this.bindingSet_.addBinding(this, handle));
+
+ this.mockServiceInstances_ = [];
}
createFaceDetection(request, options) {
- this.mock_service_ = new MockFaceDetection(request, options);
+ this.mockServiceInstances_.push(new MockFaceDetection(request, options));
}
- getFrameData() {
- return this.mock_service_.buffer_data_;
+ getFrameData(index) {
Ken Rockot(use gerrit already) 2017/05/04 08:22:42 It seems index is always 0, so this is just a more
+ return this.mockServiceInstances_[index].bufferData_;
}
- getMaxDetectedFaces() {
- return this.mock_service_.maxDetectedFaces_;
+ getMaxDetectedFaces(index) {
+ return this.mockServiceInstances_[index].maxDetectedFaces_;
}
- getFastMode () {
- return this.mock_service_.fastMode_;
+ getFastMode (index) {
+ return this.mockServiceInstances_[index].fastMode_;
}
}
@@ -46,7 +48,7 @@ let mockFaceDetectionProviderReady = define(
detect(frame_data, width, height) {
let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
- this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
+ this.bufferData_ = new Uint32Array(receivedStruct.buffer);
return Promise.resolve({
result: {
bounding_boxes: [
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/detection-options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698