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

Side by Side Diff: Source/modules/mediasource/MediaSource.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/URL.idl ('k') | Source/modules/mediasource/MediaSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 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
11 * copyright notice, this list of conditions and the following disclaimer 11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the 12 * in the documentation and/or other materials provided with the
13 * distribution. 13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its 14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from 15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission. 16 * this software without specific prior written permission.
17 * 17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebKitMediaSource_h 31 #ifndef MediaSource_h
32 #define WebKitMediaSource_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/WebKitSourceBuffer.h" 36 #include "modules/mediasource/SourceBuffer.h"
37 #include "modules/mediasource/WebKitSourceBufferList.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 WebKitMediaSource : public MediaSourceBase, public ScriptWrappable { 42 class MediaSource : public MediaSourceBase, public ScriptWrappable {
43 public: 43 public:
44 static PassRefPtr<WebKitMediaSource> create(ScriptExecutionContext*); 44 static PassRefPtr<MediaSource> create(ScriptExecutionContext*);
45 virtual ~WebKitMediaSource() { } 45 virtual ~MediaSource();
46 46
47 // WebKitMediaSource.idl methods 47 // MediaSource.idl methods
48 WebKitSourceBufferList* sourceBuffers(); 48 SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); }
49 WebKitSourceBufferList* activeSourceBuffers(); 49 SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get() ; }
50 WebKitSourceBuffer* addSourceBuffer(const String& type, ExceptionCode&); 50 SourceBuffer* addSourceBuffer(const String& type, ExceptionCode&);
51 void removeSourceBuffer(WebKitSourceBuffer*, ExceptionCode&); 51 void removeSourceBuffer(SourceBuffer*, ExceptionCode&);
52 static bool isTypeSupported(const String& type); 52 static bool isTypeSupported(const String& type);
53 53
54 // EventTarget interface 54 // EventTarget interface
55 virtual const AtomicString& interfaceName() const OVERRIDE; 55 virtual const AtomicString& interfaceName() const OVERRIDE;
56 56
57 using RefCounted<MediaSourceBase>::ref; 57 using RefCounted<MediaSourceBase>::ref;
58 using RefCounted<MediaSourceBase>::deref; 58 using RefCounted<MediaSourceBase>::deref;
59 59
60 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; 60 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
61 61
62 private: 62 private:
63 explicit WebKitMediaSource(ScriptExecutionContext*); 63 explicit MediaSource(ScriptExecutionContext*);
64 64
65 // MediaSourceBase interface 65 // MediaSourceBase interface
66 virtual void setReadyState(const AtomicString&) OVERRIDE; 66 virtual void setReadyState(const AtomicString&) OVERRIDE;
67 67
68 RefPtr<WebKitSourceBufferList> m_sourceBuffers; 68 RefPtr<SourceBufferList> m_sourceBuffers;
69 RefPtr<WebKitSourceBufferList> m_activeSourceBuffers; 69 RefPtr<SourceBufferList> m_activeSourceBuffers;
70 }; 70 };
71 71
72 } // namespace WebCore 72 } // namespace WebCore
73 73
74 #endif 74 #endif
OLDNEW
« no previous file with comments | « Source/core/html/URL.idl ('k') | Source/modules/mediasource/MediaSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698