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

Unified Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp

Issue 1952463002: Media Stream Image Capture (4): wire takePhoto and implement in FakeVCDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tommi@ and mlamouri@ comments Created 4 years, 7 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 | « third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-takePhoto.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
index f2f3fe991838631fd804e1af30fad172f278079c..7e122398795f9aa9646a25252fb85c311319bfa7 100644
--- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
+++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
@@ -142,9 +142,12 @@ void ImageCapture::onTakePhoto(ScriptPromiseResolver* resolver, const String& mi
if (!m_serviceRequests.contains(resolver))
return;
- DCHECK(!data.is_null());
- const auto& storage = data.storage();
- resolver->resolve(Blob::create(storage.data(), storage.size(), mimeType));
+ if (data.is_null() || data.empty()) {
+ resolver->reject(DOMException::create(UnknownError, "platform error"));
+ } else {
+ const auto& storage = data.storage();
+ resolver->resolve(Blob::create(storage.data(), storage.size(), mimeType));
+ }
m_serviceRequests.remove(resolver);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-takePhoto.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698