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 24 matching lines...) Expand all Loading... |
35 #include "platform/blob/BlobRegistry.h" | 35 #include "platform/blob/BlobRegistry.h" |
36 #include "platform/blob/BlobURL.h" | 36 #include "platform/blob/BlobURL.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 Stream::Stream(ExecutionContext* context, const String& mediaType) | 40 Stream::Stream(ExecutionContext* context, const String& mediaType) |
41 : ActiveDOMObject(context) | 41 : ActiveDOMObject(context) |
42 , m_mediaType(mediaType) | 42 , m_mediaType(mediaType) |
43 , m_isNeutered(false) | 43 , m_isNeutered(false) |
44 { | 44 { |
45 ScriptWrappable::init(this); | |
46 | |
47 // Create a new internal URL for a stream and register it with the provided | 45 // Create a new internal URL for a stream and register it with the provided |
48 // media type. | 46 // media type. |
49 m_internalURL = BlobURL::createInternalStreamURL(); | 47 m_internalURL = BlobURL::createInternalStreamURL(); |
50 BlobRegistry::registerStreamURL(m_internalURL, m_mediaType); | 48 BlobRegistry::registerStreamURL(m_internalURL, m_mediaType); |
51 } | 49 } |
52 | 50 |
53 void Stream::addData(const char* data, size_t len) | 51 void Stream::addData(const char* data, size_t len) |
54 { | 52 { |
55 RefPtr<RawData> buffer(RawData::create()); | 53 RefPtr<RawData> buffer(RawData::create()); |
56 buffer->mutableData()->resize(len); | 54 buffer->mutableData()->resize(len); |
(...skipping 24 matching lines...) Expand all Loading... |
81 { | 79 { |
82 } | 80 } |
83 | 81 |
84 void Stream::stop() | 82 void Stream::stop() |
85 { | 83 { |
86 neuter(); | 84 neuter(); |
87 abort(); | 85 abort(); |
88 } | 86 } |
89 | 87 |
90 } // namespace blink | 88 } // namespace blink |
OLD | NEW |