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

Unified Diff: Source/core/html/MediaProvider.h

Issue 545933002: Implement HTMLMediaElement::srcObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments. Created 6 years, 3 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: Source/core/html/MediaProvider.h
diff --git a/Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp b/Source/core/html/MediaProvider.h
similarity index 67%
copy from Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
copy to Source/core/html/MediaProvider.h
index d5e946c4b0c7c7c94903f766a0981b4648e30b69..02efeda73a0412b7268c7c511d73e36d4f07d4af 100644
--- a/Source/core/dom/custom/CustomElementAsyncImportMicrotaskQueue.cpp
+++ b/Source/core/html/MediaProvider.h
@@ -28,28 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "core/dom/custom/CustomElementAsyncImportMicrotaskQueue.h"
+#ifndef MediaProvider_h
+#define MediaProvider_h
-#include "core/dom/custom/CustomElementMicrotaskImportStep.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Functional.h"
namespace blink {
-void CustomElementAsyncImportMicrotaskQueue::enqueue(PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep> step)
-{
- m_queue.append(step);
-}
+class EventTarget;
+class MediaProvider;
+class ScriptValue;
-void CustomElementAsyncImportMicrotaskQueue::doDispatch()
-{
- WillBeHeapVector<OwnPtrWillBeMember<CustomElementMicrotaskStep> > remaining;
+class MediaProvider : public WillBeGarbageCollectedMixin {
sof 2014/09/18 07:33:17 Do you need to derive from WillBeGarbageCollectedM
perkj_chrome 2014/09/18 14:47:09 I do right? Since HTMLMediaElement must be able to
+public:
+ // Converter must be a static function and is used for converting between a ScriptValue and a MediaProvider instance.
+ // If the ScriptValue can not be converted to a MediaProvider, the function must return null.
+ typedef Function<MediaProvider*(const ScriptValue&)> Converter;
+ static MediaProvider* convert(const ScriptValue&);
- for (unsigned i = 0; i < m_queue.size(); ++i) {
- if (CustomElementMicrotaskStep::Processing == m_queue[i]->process())
- remaining.append(m_queue[i].release());
- }
+ MediaProvider(const String& interfaceName, const Converter&);
+ virtual ~MediaProvider() { };
sof 2014/09/18 07:33:17 nit: remove ";"
perkj_chrome 2014/09/18 14:47:09 Done.
- m_queue.swap(remaining);
-}
+ virtual EventTarget* eventTarget() = 0;
+ virtual const String& getObjectUrl() = 0;
+};
} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698