OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 #define MediaSource_h | 32 #define MediaSource_h |
33 | 33 |
34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
35 #include "modules/mediasource/MediaSourceBase.h" | 35 #include "modules/mediasource/MediaSourceBase.h" |
36 #include "modules/mediasource/SourceBuffer.h" | 36 #include "modules/mediasource/SourceBuffer.h" |
37 #include "modules/mediasource/SourceBufferList.h" | 37 #include "modules/mediasource/SourceBufferList.h" |
38 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class ExceptionState; | |
43 | |
44 class MediaSource : public MediaSourceBase, public ScriptWrappable { | 42 class MediaSource : public MediaSourceBase, public ScriptWrappable { |
45 public: | 43 public: |
46 static PassRefPtr<MediaSource> create(ScriptExecutionContext*); | 44 static PassRefPtr<MediaSource> create(ScriptExecutionContext*); |
47 virtual ~MediaSource(); | 45 virtual ~MediaSource(); |
48 | 46 |
49 // MediaSource.idl methods | 47 // MediaSource.idl methods |
50 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } | 48 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); } |
51 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } | 49 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get()
; } |
52 SourceBuffer* addSourceBuffer(const String& type, ExceptionState&); | 50 SourceBuffer* addSourceBuffer(const String& type, ExceptionCode&); |
53 void removeSourceBuffer(SourceBuffer*, ExceptionState&); | 51 void removeSourceBuffer(SourceBuffer*, ExceptionCode&); |
54 static bool isTypeSupported(const String& type); | 52 static bool isTypeSupported(const String& type); |
55 | 53 |
56 // EventTarget interface | 54 // EventTarget interface |
57 virtual const AtomicString& interfaceName() const OVERRIDE; | 55 virtual const AtomicString& interfaceName() const OVERRIDE; |
58 | 56 |
59 using RefCounted<MediaSourceBase>::ref; | 57 using RefCounted<MediaSourceBase>::ref; |
60 using RefCounted<MediaSourceBase>::deref; | 58 using RefCounted<MediaSourceBase>::deref; |
61 | 59 |
62 private: | 60 private: |
63 explicit MediaSource(ScriptExecutionContext*); | 61 explicit MediaSource(ScriptExecutionContext*); |
64 | 62 |
65 // MediaSourceBase interface | 63 // MediaSourceBase interface |
66 virtual void onReadyStateChange(const AtomicString&, const AtomicString&) OV
ERRIDE; | 64 virtual void onReadyStateChange(const AtomicString&, const AtomicString&) OV
ERRIDE; |
67 virtual Vector<RefPtr<TimeRanges> > activeRanges() const OVERRIDE; | 65 virtual Vector<RefPtr<TimeRanges> > activeRanges() const OVERRIDE; |
68 | 66 |
69 RefPtr<SourceBufferList> m_sourceBuffers; | 67 RefPtr<SourceBufferList> m_sourceBuffers; |
70 RefPtr<SourceBufferList> m_activeSourceBuffers; | 68 RefPtr<SourceBufferList> m_activeSourceBuffers; |
71 }; | 69 }; |
72 | 70 |
73 } // namespace WebCore | 71 } // namespace WebCore |
74 | 72 |
75 #endif | 73 #endif |
OLD | NEW |