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

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

Issue 1926873002: MediaStream Image Capture (3): Adding mojo and browser impl for dummy takePhoto(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const auto& Created 4 years, 8 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: third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
index 16633e5bef94b7a9f0d52b219f96035825dd7586..a02f91d7ac51af9b15ed63ef6fb3b31d207d5506 100644
--- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
+++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
@@ -12,6 +12,7 @@
#include "modules/EventTargetModules.h"
#include "modules/ModulesExport.h"
#include "platform/AsyncMethodRunner.h"
+#include "public/platform/modules/imagecapture/image_capture.mojom-blink.h"
namespace blink {
@@ -43,6 +44,8 @@ public:
MediaStreamTrack* videoStreamTrack() const { return m_streamTrack.get(); }
+ ScriptPromise takePhoto(ScriptState*, ExceptionState&);
+
ScriptPromise grabFrame(ScriptState*, ExceptionState&);
DECLARE_VIRTUAL_TRACE();
@@ -50,11 +53,17 @@ public:
private:
ImageCapture(ExecutionContext*, MediaStreamTrack*);
+ void onTakePhoto(ScriptPromiseResolver*, const String& mimeType, mojo::WTFArray<uint8_t> data);
+ void onServiceConnectionError();
+
// EventTarget implementation.
bool addEventListenerInternal(const AtomicString& eventType, EventListener*, const EventListenerOptions&) override;
Member<MediaStreamTrack> m_streamTrack;
OwnPtr<WebImageCaptureFrameGrabber> m_frameGrabber;
+ mojom::blink::ImageCapturePtr m_service;
+
+ HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698