Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 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 Stream_h | 31 #ifndef Stream_h |
| 32 #define Stream_h | 32 #define Stream_h |
| 33 | 33 |
| 34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "heap/Handle.h" | |
| 36 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 class ExecutionContext; | 44 class ExecutionContext; |
| 44 | 45 |
| 45 class Stream FINAL : public ScriptWrappable, public ActiveDOMObject, public RefC ounted<Stream> { | 46 class Stream FINAL : public RefCountedWillBeRefCountedGarbageCollected<Stream>, public ScriptWrappable, public ActiveDOMObject { |
|
haraken
2014/02/24 13:49:14
Not related to this CL, but we should kill ActiveD
sof
2014/02/24 17:09:09
Not doing that bookkeeping correctly was the cause
| |
| 47 DECLARE_GC_INFO; | |
| 46 public: | 48 public: |
| 47 static PassRefPtr<Stream> create(ExecutionContext* context, const String& me diaType) | 49 static PassRefPtrWillBeRawPtr<Stream> create(ExecutionContext* context, cons t String& mediaType) |
| 48 { | 50 { |
| 49 RefPtr<Stream> stream = adoptRef(new Stream(context, mediaType)); | 51 RefPtrWillBeRawPtr<Stream> stream = adoptRefCountedWillBeRefCountedGarba geCollected(new Stream(context, mediaType)); |
| 50 stream->suspendIfNeeded(); | 52 stream->suspendIfNeeded(); |
| 51 return stream.release(); | 53 return stream.release(); |
| 52 } | 54 } |
| 53 | 55 |
| 54 virtual ~Stream(); | 56 virtual ~Stream(); |
| 55 | 57 |
| 56 // Returns the internal URL referring to this stream. | 58 // Returns the internal URL referring to this stream. |
| 57 const KURL& url() const { return m_internalURL; } | 59 const KURL& url() const { return m_internalURL; } |
| 58 // Returns the media type of this stream. | 60 // Returns the media type of this stream. |
| 59 const String& type() const { return m_mediaType; } | 61 const String& type() const { return m_mediaType; } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 73 void neuter() { m_isNeutered = true; } | 75 void neuter() { m_isNeutered = true; } |
| 74 bool isNeutered() const { return m_isNeutered; } | 76 bool isNeutered() const { return m_isNeutered; } |
| 75 | 77 |
| 76 // Implementation of ActiveDOMObject. | 78 // Implementation of ActiveDOMObject. |
| 77 // | 79 // |
| 78 // FIXME: Implement suspend() and resume() when necessary. | 80 // FIXME: Implement suspend() and resume() when necessary. |
| 79 virtual void suspend() OVERRIDE; | 81 virtual void suspend() OVERRIDE; |
| 80 virtual void resume() OVERRIDE; | 82 virtual void resume() OVERRIDE; |
| 81 virtual void stop() OVERRIDE; | 83 virtual void stop() OVERRIDE; |
| 82 | 84 |
| 85 void trace(Visitor*) { } | |
| 86 | |
| 83 protected: | 87 protected: |
| 84 Stream(ExecutionContext*, const String& mediaType); | 88 Stream(ExecutionContext*, const String& mediaType); |
| 85 | 89 |
| 86 // This is an internal URL referring to the blob data associated with this o bject. It serves | 90 // This is an internal URL referring to the blob data associated with this o bject. It serves |
| 87 // as an identifier for this blob. The internal URL is never used to source the blob's content | 91 // as an identifier for this blob. The internal URL is never used to source the blob's content |
| 88 // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes. | 92 // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes. |
| 89 KURL m_internalURL; | 93 KURL m_internalURL; |
| 90 | 94 |
| 91 String m_mediaType; | 95 String m_mediaType; |
| 92 | 96 |
| 93 bool m_isNeutered; | 97 bool m_isNeutered; |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace WebCore | 100 } // namespace WebCore |
| 97 | 101 |
| 98 #endif // Stream_h | 102 #endif // Stream_h |
| OLD | NEW |