| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/streams/Stream.h" | 31 #include "core/streams/Stream.h" |
| 32 | 32 |
| 33 #include "platform/blob/BlobData.h" | 33 #include "platform/blob/BlobData.h" |
| 34 #include "platform/blob/BlobRegistry.h" | 34 #include "platform/blob/BlobRegistry.h" |
| 35 #include "platform/blob/BlobURL.h" | 35 #include "platform/blob/BlobURL.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 Stream::Stream(ExecutionContext* context, const String& mediaType) | 39 Stream::Stream(ExecutionContext* context, const String& mediaType) |
| 40 : ContextLifecycleObserver(context) | 40 : ActiveDOMObject(context) |
| 41 , m_mediaType(mediaType) | 41 , m_mediaType(mediaType) |
| 42 , m_isNeutered(false) | 42 , m_isNeutered(false) |
| 43 { | 43 { |
| 44 // Create a new internal URL for a stream and register it with the provided | 44 // Create a new internal URL for a stream and register it with the provided |
| 45 // media type. | 45 // media type. |
| 46 m_internalURL = BlobURL::createInternalStreamURL(); | 46 m_internalURL = BlobURL::createInternalStreamURL(); |
| 47 BlobRegistry::registerStreamURL(m_internalURL, m_mediaType); | 47 BlobRegistry::registerStreamURL(m_internalURL, m_mediaType); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void Stream::addData(const char* data, size_t len) | 50 void Stream::addData(const char* data, size_t len) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 void Stream::abort() | 68 void Stream::abort() |
| 69 { | 69 { |
| 70 BlobRegistry::abortStream(m_internalURL); | 70 BlobRegistry::abortStream(m_internalURL); |
| 71 } | 71 } |
| 72 | 72 |
| 73 Stream::~Stream() | 73 Stream::~Stream() |
| 74 { | 74 { |
| 75 BlobRegistry::unregisterStreamURL(m_internalURL); | 75 BlobRegistry::unregisterStreamURL(m_internalURL); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void Stream::contextDestroyed() | 78 void Stream::suspend() |
| 79 { |
| 80 } |
| 81 |
| 82 void Stream::resume() |
| 83 { |
| 84 } |
| 85 |
| 86 void Stream::stop() |
| 79 { | 87 { |
| 80 neuter(); | 88 neuter(); |
| 81 abort(); | 89 abort(); |
| 82 } | 90 } |
| 83 | 91 |
| 84 DEFINE_TRACE(Stream) | 92 DEFINE_TRACE(Stream) |
| 85 { | 93 { |
| 86 ContextLifecycleObserver::trace(visitor); | 94 ActiveDOMObject::trace(visitor); |
| 87 } | 95 } |
| 88 | 96 |
| 89 } // namespace blink | 97 } // namespace blink |
| OLD | NEW |