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 17 matching lines...) Expand all Loading... | |
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 HTMLMediaSource_h | 31 #ifndef HTMLMediaSource_h |
32 #define HTMLMediaSource_h | 32 #define HTMLMediaSource_h |
33 | 33 |
34 #include "core/html/HTMLMediaElement.h" | 34 #include "core/html/HTMLMediaElement.h" |
35 #include "core/html/URLRegistry.h" | 35 #include "core/html/URLRegistry.h" |
36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
37 | 37 |
38 namespace blink { | |
39 class WebMediaSource; | |
40 } | |
41 | |
38 namespace WebCore { | 42 namespace WebCore { |
39 | 43 |
40 class MediaSourcePrivate; | |
41 class TimeRanges; | 44 class TimeRanges; |
42 | 45 |
43 class HTMLMediaSource : public URLRegistrable { | 46 class HTMLMediaSource : public URLRegistrable { |
44 public: | 47 public: |
45 static void setRegistry(URLRegistry*); | 48 static void setRegistry(URLRegistry*); |
46 static HTMLMediaSource* lookup(const String& url) { return s_registry ? stat ic_cast<HTMLMediaSource*>(s_registry->lookup(url)) : 0; } | 49 static HTMLMediaSource* lookup(const String& url) { return s_registry ? stat ic_cast<HTMLMediaSource*>(s_registry->lookup(url)) : 0; } |
47 | 50 |
48 void ref() { refHTMLMediaSource(); } | 51 void ref() { refHTMLMediaSource(); } |
49 void deref() { derefHTMLMediaSource(); } | 52 void deref() { derefHTMLMediaSource(); } |
50 | 53 |
51 // Called when an HTMLMediaElement is attempting to attach to this object, | 54 // Called when an HTMLMediaElement is attempting to attach to this object, |
52 // and helps enforce attachment to at most one element at a time. | 55 // and helps enforce attachment to at most one element at a time. |
53 // If already attached, returns false. Otherwise, must be in | 56 // If already attached, returns false. Otherwise, must be in |
54 // 'closed' state, and returns true to indicate attachment success. | 57 // 'closed' state, and returns true to indicate attachment success. |
55 // Reattachment allowed by first calling close() (even if already in 'closed '). | 58 // Reattachment allowed by first calling close() (even if already in 'closed '). |
56 // Once attached, the source uses the element to synchronously service some | 59 // Once attached, the source uses the element to synchronously service some |
57 // API operations like duration change that may need to initiate seek. | 60 // API operations like duration change that may need to initiate seek. |
58 virtual bool attachToElement(HTMLMediaElement*) = 0; | 61 virtual bool attachToElement(HTMLMediaElement*) = 0; |
59 virtual void setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate>) = 0; | 62 virtual void setWebAndOpen(PassOwnPtr<blink::WebMediaSource>) = 0; |
acolwell GONE FROM CHROMIUM
2013/11/11 18:06:55
nit: s/setWeb/setWebMediaSource/
philipj_slow
2013/11/12 09:43:51
I was hoping you would say that! Done!
| |
60 virtual void close() = 0; | 63 virtual void close() = 0; |
61 virtual bool isClosed() const = 0; | 64 virtual bool isClosed() const = 0; |
62 virtual double duration() const = 0; | 65 virtual double duration() const = 0; |
63 virtual PassRefPtr<TimeRanges> buffered() const = 0; | 66 virtual PassRefPtr<TimeRanges> buffered() const = 0; |
64 virtual void refHTMLMediaSource() = 0; | 67 virtual void refHTMLMediaSource() = 0; |
65 virtual void derefHTMLMediaSource() = 0; | 68 virtual void derefHTMLMediaSource() = 0; |
66 | 69 |
67 // URLRegistrable | 70 // URLRegistrable |
68 virtual URLRegistry& registry() const OVERRIDE { return *s_registry; } | 71 virtual URLRegistry& registry() const OVERRIDE { return *s_registry; } |
69 | 72 |
70 private: | 73 private: |
71 static URLRegistry* s_registry; | 74 static URLRegistry* s_registry; |
72 }; | 75 }; |
73 | 76 |
74 } | 77 } |
75 | 78 |
76 #endif | 79 #endif |
OLD | NEW |