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

Unified Diff: media/capture/video/android/video_capture_device_android.cc

Issue 2167313002: ImageCapture: introduce image_capture Blob to allow move-only semantics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: media/capture/video/android/video_capture_device_android.cc
diff --git a/media/capture/video/android/video_capture_device_android.cc b/media/capture/video/android/video_capture_device_android.cc
index 35e12ae0c493ae34f8c8c51d26f81b92bcef71cc..7da417f9b24c39d44cab7b5b258371fac57c11cb 100644
--- a/media/capture/video/android/video_capture_device_android.cc
+++ b/media/capture/video/android/video_capture_device_android.cc
@@ -259,10 +259,10 @@ void VideoCaptureDeviceAndroid::OnPhotoTaken(
return;
}
- std::vector<uint8_t> native_data;
- base::android::JavaByteArrayToByteVector(env, data.obj(), &native_data);
-
- cb->Run(std::string(native_data.empty() ? "" : "image/jpeg"), native_data);
+ mojom::BlobPtr blob = mojom::Blob::New();
+ base::android::JavaByteArrayToByteVector(env, data.obj(), &blob->data);
+ blob->mime_type = blob->data.empty() ? "" : "image/jpeg";
+ cb->Run(std::move(blob));
photo_callbacks_.erase(reference_it);
}

Powered by Google App Engine
This is Rietveld 408576698