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

Unified Diff: Source/core/html/track/TrackEvent.h

Issue 790973002: Use event init dictionary in core/html/track (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@union-includes
Patch Set: Created 6 years 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 | « Source/core/html/track/TextTrackList.cpp ('k') | Source/core/html/track/TrackEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TrackEvent.h
diff --git a/Source/core/html/track/TrackEvent.h b/Source/core/html/track/TrackEvent.h
index ff59d7812ebceec3d6d5ff39550f5af0aba1299a..a91d01a9d480c2d8228c8bcb6a39e0e9934b8593 100644
--- a/Source/core/html/track/TrackEvent.h
+++ b/Source/core/html/track/TrackEvent.h
@@ -28,17 +28,12 @@
#include "core/events/Event.h"
#include "core/html/track/TrackBase.h"
+#include "core/html/track/TrackEventInit.h"
namespace blink {
class VideoTrackOrAudioTrackOrTextTrack;
-struct TrackEventInit : public EventInit {
- TrackEventInit();
-
- RefPtrWillBeMember<TrackBase> track;
-};
-
class TrackEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -54,6 +49,12 @@ public:
return adoptRefWillBeNoop(new TrackEvent(type, initializer));
}
+ template <typename T>
+ static PassRefPtrWillBeRawPtr<TrackEvent> create(const AtomicString& type, PassRefPtrWillBeRawPtr<T> track)
+ {
+ return adoptRefWillBeNoop(new TrackEvent(type, track));
+ }
+
virtual const AtomicString& interfaceName() const override;
void track(VideoTrackOrAudioTrackOrTextTrack&);
@@ -63,6 +64,12 @@ public:
private:
TrackEvent();
TrackEvent(const AtomicString& type, const TrackEventInit& initializer);
+ template <typename T>
+ TrackEvent(const AtomicString& type, PassRefPtrWillBeRawPtr<T> track)
+ : Event(type, false, false)
+ , m_track(track)
+ {
+ }
RefPtrWillBeMember<TrackBase> m_track;
};
« no previous file with comments | « Source/core/html/track/TextTrackList.cpp ('k') | Source/core/html/track/TrackEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698