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

Unified Diff: media/capture/video/video_capture_device.h

Issue 2005753006: ImageCapture: ScopedResultCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reillyg@ second round of 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
Index: media/capture/video/video_capture_device.h
diff --git a/media/capture/video/video_capture_device.h b/media/capture/video/video_capture_device.h
index 24dec1d185780911d032f77b4f48eedcd34dfd02..fa02cb857162b68308a5f5020590992d1653a562 100644
--- a/media/capture/video/video_capture_device.h
+++ b/media/capture/video/video_capture_device.h
@@ -28,6 +28,8 @@
#include "media/base/media_export.h"
#include "media/base/video_capture_types.h"
#include "media/base/video_frame.h"
+#include "media/capture/video/scoped_callback.h"
+#include "third_party/WebKit/public/platform/modules/imagecapture/image_capture.mojom.h"
#include "ui/gfx/gpu_memory_buffer.h"
namespace tracked_objects {
@@ -300,14 +302,10 @@ class MEDIA_EXPORT VideoCaptureDevice {
virtual void StopAndDeAllocate() = 0;
// Asynchronously takes a photo, possibly reconfiguring the capture objects
- // and/or interrupting the capture flow. Returns false if taking the picture
- // could not be scheduled at all, or else runs |photo_callback| (on the thread
- // where TakePhoto() is run).
- using TakePhotoCallback =
- base::Callback<void(const std::string&,
- std::unique_ptr<std::vector<uint8_t>>)>;
- virtual bool TakePhoto(const TakePhotoCallback& photo_callback)
- WARN_UNUSED_RESULT;
+ // and/or interrupting the capture flow. Runs |callback| on the thread
+ // where TakePhoto() is called, if the photo was successfully taken.
+ using TakePhotoCallback = blink::mojom::ImageCapture::TakePhotoCallback;
+ virtual void TakePhoto(ScopedCallback<TakePhotoCallback> callback);
// Gets the power line frequency, either from the params if specified by the
// user or from the current system time zone.

Powered by Google App Engine
This is Rietveld 408576698