 Chromium Code Reviews
 Chromium Code Reviews Issue 2818563006:
  ShapeDetection: Holding all of mock service to prevent GC  (Closed)
    
  
    Issue 2818563006:
  ShapeDetection: Holding all of mock service to prevent GC  (Closed) 
  | 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: [ |