OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 return createFromSourceVectors(context, audioSources, videoSources); | 97 return createFromSourceVectors(context, audioSources, videoSources); |
98 } | 98 } |
99 | 99 |
100 PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, Pas
sRefPtr<MediaStreamDescriptor> streamDescriptor) | 100 PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, Pas
sRefPtr<MediaStreamDescriptor> streamDescriptor) |
101 { | 101 { |
102 return adoptRef(new MediaStream(context, streamDescriptor)); | 102 return adoptRef(new MediaStream(context, streamDescriptor)); |
103 } | 103 } |
104 | 104 |
105 MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream
Descriptor> streamDescriptor) | 105 MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream
Descriptor> streamDescriptor) |
106 : ContextDestructionObserver(context) | 106 : ContextLifecycleObserver(context) |
107 , m_stopped(false) | 107 , m_stopped(false) |
108 , m_descriptor(streamDescriptor) | 108 , m_descriptor(streamDescriptor) |
109 , m_scheduledEventTimer(this, &MediaStream::scheduledEventTimerFired) | 109 , m_scheduledEventTimer(this, &MediaStream::scheduledEventTimerFired) |
110 { | 110 { |
111 ScriptWrappable::init(this); | 111 ScriptWrappable::init(this); |
112 m_descriptor->setClient(this); | 112 m_descriptor->setClient(this); |
113 | 113 |
114 size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents(); | 114 size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents(); |
115 m_audioTracks.reserveCapacity(numberOfAudioTracks); | 115 m_audioTracks.reserveCapacity(numberOfAudioTracks); |
116 for (size_t i = 0; i < numberOfAudioTracks; i++) | 116 for (size_t i = 0; i < numberOfAudioTracks; i++) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 { | 247 { |
248 if (ended()) | 248 if (ended()) |
249 return; | 249 return; |
250 | 250 |
251 m_descriptor->setEnded(); | 251 m_descriptor->setEnded(); |
252 scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false)); | 252 scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false)); |
253 } | 253 } |
254 | 254 |
255 void MediaStream::contextDestroyed() | 255 void MediaStream::contextDestroyed() |
256 { | 256 { |
257 ContextDestructionObserver::contextDestroyed(); | 257 ContextLifecycleObserver::contextDestroyed(); |
258 m_stopped = true; | 258 m_stopped = true; |
259 } | 259 } |
260 | 260 |
261 const AtomicString& MediaStream::interfaceName() const | 261 const AtomicString& MediaStream::interfaceName() const |
262 { | 262 { |
263 return eventNames().interfaceForMediaStream; | 263 return eventNames().interfaceForMediaStream; |
264 } | 264 } |
265 | 265 |
266 ScriptExecutionContext* MediaStream::scriptExecutionContext() const | 266 ScriptExecutionContext* MediaStream::scriptExecutionContext() const |
267 { | 267 { |
268 return ContextDestructionObserver::scriptExecutionContext(); | 268 return ContextLifecycleObserver::scriptExecutionContext(); |
269 } | 269 } |
270 | 270 |
271 EventTargetData* MediaStream::eventTargetData() | 271 EventTargetData* MediaStream::eventTargetData() |
272 { | 272 { |
273 return &m_eventTargetData; | 273 return &m_eventTargetData; |
274 } | 274 } |
275 | 275 |
276 EventTargetData* MediaStream::ensureEventTargetData() | 276 EventTargetData* MediaStream::ensureEventTargetData() |
277 { | 277 { |
278 return &m_eventTargetData; | 278 return &m_eventTargetData; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 354 |
355 events.clear(); | 355 events.clear(); |
356 } | 356 } |
357 | 357 |
358 URLRegistry& MediaStream::registry() const | 358 URLRegistry& MediaStream::registry() const |
359 { | 359 { |
360 return MediaStreamRegistry::registry(); | 360 return MediaStreamRegistry::registry(); |
361 } | 361 } |
362 | 362 |
363 } // namespace WebCore | 363 } // namespace WebCore |
OLD | NEW |