Chromium Code Reviews| Index: services/shape_detection/android/java/src/org/chromium/shape_detection/SharedBufferUtils.java |
| diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/SharedBufferUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/SharedBufferUtils.java |
| index 807b18d646376bab51b5cac4819a98c74ffd8126..9112e265a6b93175b4038a6efa9a69a569561f92 100644 |
| --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/SharedBufferUtils.java |
| +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/SharedBufferUtils.java |
| @@ -8,6 +8,7 @@ import android.graphics.Bitmap; |
| import com.google.android.gms.vision.Frame; |
| +import org.chromium.mojo.system.MojoException; |
| import org.chromium.mojo.system.SharedBufferHandle; |
| import org.chromium.mojo.system.SharedBufferHandle.MapFlags; |
| @@ -35,6 +36,11 @@ public class SharedBufferUtils { |
| Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); |
| bitmap.copyPixelsFromBuffer(imageBuffer); |
| + try { |
|
Ken Rockot(use gerrit already)
2017/05/11 15:42:07
My Mojo-Java-fu is weak. Why is this wrapped in a
mcasas
2017/05/11 16:02:48
In Java-land, if it can throw, we have to catch it
|
| + frameData.unmap(imageBuffer); |
| + frameData.close(); |
| + } catch (MojoException e) { |
| + } |
| try { |
| // This constructor implies a pixel format conversion to YUV. |