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

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: foolip comments and rebase 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 90c8f006eed37519a8f90899d0d09a5412d96ffa..715f8f4c966eacb91e7d918024e9b8191f127d03 100644
--- a/media/capture/video/android/video_capture_device_android.cc
+++ b/media/capture/video/android/video_capture_device_android.cc
@@ -339,10 +339,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);
}
« no previous file with comments | « content/browser/media/capture/image_capture_impl.cc ('k') | media/capture/video/fake_video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698