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

Unified Diff: Source/modules/mediasource/SourceBufferList.h

Issue 16625011: Add minimal implementation of unprefixed MediaSource API that has feature parity with prefixed API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix global-constructors-listing-expected.txt Created 7 years, 6 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 | « Source/modules/mediasource/SourceBuffer.idl ('k') | Source/modules/mediasource/SourceBufferList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediasource/SourceBufferList.h
diff --git a/Source/modules/mediasource/WebKitSourceBufferList.h b/Source/modules/mediasource/SourceBufferList.h
similarity index 69%
copy from Source/modules/mediasource/WebKitSourceBufferList.h
copy to Source/modules/mediasource/SourceBufferList.h
index c8a4b5cc08510dbe0558e9df2f948f5a107f0ea8..cbe649c1c2afc464873a495d95dad37489b11d59 100644
--- a/Source/modules/mediasource/WebKitSourceBufferList.h
+++ b/Source/modules/mediasource/SourceBufferList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitSourceBufferList_h
-#define WebKitSourceBufferList_h
+#ifndef SourceBufferList_h
+#define SourceBufferList_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/EventTarget.h"
@@ -38,39 +38,40 @@
namespace WebCore {
-class WebKitSourceBuffer;
+class SourceBuffer;
class GenericEventQueue;
-class WebKitSourceBufferList : public RefCounted<WebKitSourceBufferList>, public ScriptWrappable, public EventTarget {
+class SourceBufferList : public RefCounted<SourceBufferList>, public ScriptWrappable, public EventTarget {
public:
- static PassRefPtr<WebKitSourceBufferList> create(ScriptExecutionContext* context, GenericEventQueue* asyncEventQueue)
+ static PassRefPtr<SourceBufferList> create(ScriptExecutionContext* context, GenericEventQueue* asyncEventQueue)
{
- return adoptRef(new WebKitSourceBufferList(context, asyncEventQueue));
+ return adoptRef(new SourceBufferList(context, asyncEventQueue));
}
- virtual ~WebKitSourceBufferList() { }
+ virtual ~SourceBufferList();
- unsigned long length() const;
- WebKitSourceBuffer* item(unsigned index) const;
+ unsigned long length() const { return m_list.size(); }
+ SourceBuffer* item(unsigned long index) const { return (index < m_list.size()) ? m_list[index].get() : 0; }
- void add(PassRefPtr<WebKitSourceBuffer>);
- bool remove(WebKitSourceBuffer*);
+ void add(PassRefPtr<SourceBuffer>);
+ void remove(SourceBuffer*);
+ bool contains(SourceBuffer* buffer) { return m_list.find(buffer) != notFound; }
void clear();
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
- using RefCounted<WebKitSourceBufferList>::ref;
- using RefCounted<WebKitSourceBufferList>::deref;
+ using RefCounted<SourceBufferList>::ref;
+ using RefCounted<SourceBufferList>::deref;
protected:
virtual EventTargetData* eventTargetData() OVERRIDE;
virtual EventTargetData* ensureEventTargetData() OVERRIDE;
private:
- WebKitSourceBufferList(ScriptExecutionContext*, GenericEventQueue*);
+ SourceBufferList(ScriptExecutionContext*, GenericEventQueue*);
- void createAndFireEvent(const AtomicString&);
+ void scheduleEvent(const AtomicString&);
virtual void refEventTarget() OVERRIDE { ref(); }
virtual void derefEventTarget() OVERRIDE { deref(); }
@@ -79,7 +80,7 @@ private:
ScriptExecutionContext* m_scriptExecutionContext;
GenericEventQueue* m_asyncEventQueue;
- Vector<RefPtr<WebKitSourceBuffer> > m_list;
+ Vector<RefPtr<SourceBuffer> > m_list;
};
} // namespace WebCore
« no previous file with comments | « Source/modules/mediasource/SourceBuffer.idl ('k') | Source/modules/mediasource/SourceBufferList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698