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

Unified Diff: content/browser/media/capture/image_capture_impl.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
« no previous file with comments | « no previous file | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/image_capture_impl.cc
diff --git a/content/browser/media/capture/image_capture_impl.cc b/content/browser/media/capture/image_capture_impl.cc
index 9941b7b4decdd3e8a8db3959b6cd72fad3d624d6..269d90fc1d3432a482a0cf650679186bc1880420 100644
--- a/content/browser/media/capture/image_capture_impl.cc
+++ b/content/browser/media/capture/image_capture_impl.cc
@@ -51,19 +51,15 @@ void RunFailedSetOptionsCallback(
void RunTakePhotoCallbackOnUIThread(
const ImageCaptureImpl::TakePhotoCallback& callback,
- const std::string& mime_type,
- const std::vector<uint8_t>& data) {
- // TODO(mcasas): Use a mojo typemapping instead of const_cast to avoid copying
- // |data|, https://crbug.com/630040.
+ media::mojom::BlobPtr blob) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(callback, mime_type,
- base::Passed(const_cast<std::vector<uint8_t>*>(&data))));
+ base::Bind(callback, base::Passed(std::move(blob))));
}
void RunFailedTakePhotoCallback(const ImageCaptureImpl::TakePhotoCallback& cb) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- cb.Run("", std::vector<uint8_t>());
+ cb.Run(media::mojom::Blob::New());
}
void GetCapabilitiesOnIOThread(
« no previous file with comments | « no previous file | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698