| 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 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2011 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 namespace { | 46 namespace { |
| 47 static const char kContentHintStringNone[] = ""; | 47 static const char kContentHintStringNone[] = ""; |
| 48 static const char kContentHintStringAudioSpeech[] = "speech"; | 48 static const char kContentHintStringAudioSpeech[] = "speech"; |
| 49 static const char kContentHintStringAudioMusic[] = "music"; | 49 static const char kContentHintStringAudioMusic[] = "music"; |
| 50 static const char kContentHintStringVideoFluid[] = "fluid"; | 50 static const char kContentHintStringVideoFluid[] = "fluid"; |
| 51 static const char kContentHintStringVideoDetailed[] = "detailed"; | 51 static const char kContentHintStringVideoDetailed[] = "detailed"; |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, | 54 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, |
| 55 MediaStreamComponent* component) { | 55 MediaStreamComponent* component) { |
| 56 MediaStreamTrack* track = new MediaStreamTrack(context, component); | 56 return new MediaStreamTrack(context, component); |
| 57 track->suspendIfNeeded(); | |
| 58 return track; | |
| 59 } | 57 } |
| 60 | 58 |
| 61 MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, | 59 MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, |
| 62 MediaStreamComponent* component) | 60 MediaStreamComponent* component) |
| 63 : SuspendableObject(context), | 61 : ContextLifecycleObserver(context), |
| 64 m_readyState(MediaStreamSource::ReadyStateLive), | 62 m_readyState(MediaStreamSource::ReadyStateLive), |
| 65 m_isIteratingRegisteredMediaStreams(false), | 63 m_isIteratingRegisteredMediaStreams(false), |
| 66 m_stopped(false), | 64 m_stopped(false), |
| 67 m_component(component), | 65 m_component(component), |
| 68 // The source's constraints aren't yet initialized at creation time. | 66 // The source's constraints aren't yet initialized at creation time. |
| 69 m_constraints() { | 67 m_constraints() { |
| 70 m_component->source()->addObserver(this); | 68 m_component->source()->addObserver(this); |
| 71 } | 69 } |
| 72 | 70 |
| 73 MediaStreamTrack::~MediaStreamTrack() {} | 71 MediaStreamTrack::~MediaStreamTrack() {} |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 m_registeredMediaStreams.find(mediaStream); | 303 m_registeredMediaStreams.find(mediaStream); |
| 306 CHECK(iter != m_registeredMediaStreams.end()); | 304 CHECK(iter != m_registeredMediaStreams.end()); |
| 307 m_registeredMediaStreams.remove(iter); | 305 m_registeredMediaStreams.remove(iter); |
| 308 } | 306 } |
| 309 | 307 |
| 310 const AtomicString& MediaStreamTrack::interfaceName() const { | 308 const AtomicString& MediaStreamTrack::interfaceName() const { |
| 311 return EventTargetNames::MediaStreamTrack; | 309 return EventTargetNames::MediaStreamTrack; |
| 312 } | 310 } |
| 313 | 311 |
| 314 ExecutionContext* MediaStreamTrack::getExecutionContext() const { | 312 ExecutionContext* MediaStreamTrack::getExecutionContext() const { |
| 315 return SuspendableObject::getExecutionContext(); | 313 return ContextLifecycleObserver::getExecutionContext(); |
| 316 } | 314 } |
| 317 | 315 |
| 318 DEFINE_TRACE(MediaStreamTrack) { | 316 DEFINE_TRACE(MediaStreamTrack) { |
| 319 visitor->trace(m_registeredMediaStreams); | 317 visitor->trace(m_registeredMediaStreams); |
| 320 visitor->trace(m_component); | 318 visitor->trace(m_component); |
| 321 EventTargetWithInlineData::trace(visitor); | 319 EventTargetWithInlineData::trace(visitor); |
| 322 SuspendableObject::trace(visitor); | 320 ContextLifecycleObserver::trace(visitor); |
| 323 } | 321 } |
| 324 | 322 |
| 325 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |