| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void MediaStreamTrack::stopTrack(ExceptionState& exceptionState) { | 191 void MediaStreamTrack::stopTrack(ExceptionState& exceptionState) { |
| 192 if (ended()) | 192 if (ended()) |
| 193 return; | 193 return; |
| 194 | 194 |
| 195 m_readyState = MediaStreamSource::ReadyStateEnded; | 195 m_readyState = MediaStreamSource::ReadyStateEnded; |
| 196 MediaStreamCenter::instance().didStopMediaStreamTrack(component()); | 196 MediaStreamCenter::instance().didStopMediaStreamTrack(component()); |
| 197 dispatchEvent(Event::create(EventTypeNames::ended)); | 197 dispatchEvent(Event::create(EventTypeNames::ended)); |
| 198 propagateTrackEnded(); | 198 propagateTrackEnded(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 MediaStreamTrack* MediaStreamTrack::clone(ExecutionContext* context) { | 201 MediaStreamTrack* MediaStreamTrack::clone(ScriptState* scriptState) { |
| 202 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned | 202 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned |
| 203 // tracks. | 203 // tracks. |
| 204 MediaStreamComponent* clonedComponent = component()->clone(); | 204 MediaStreamComponent* clonedComponent = component()->clone(); |
| 205 MediaStreamTrack* clonedTrack = | 205 MediaStreamTrack* clonedTrack = MediaStreamTrack::create( |
| 206 MediaStreamTrack::create(context, clonedComponent); | 206 scriptState->getExecutionContext(), clonedComponent); |
| 207 MediaStreamCenter::instance().didCreateMediaStreamTrack(clonedComponent); | 207 MediaStreamCenter::instance().didCreateMediaStreamTrack(clonedComponent); |
| 208 return clonedTrack; | 208 return clonedTrack; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void MediaStreamTrack::getConstraints(MediaTrackConstraints& constraints) { | 211 void MediaStreamTrack::getConstraints(MediaTrackConstraints& constraints) { |
| 212 MediaConstraintsImpl::convertConstraints(m_constraints, constraints); | 212 MediaConstraintsImpl::convertConstraints(m_constraints, constraints); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) { | 215 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) { |
| 216 m_constraints = constraints; | 216 m_constraints = constraints; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 | 334 |
| 335 DEFINE_TRACE(MediaStreamTrack) { | 335 DEFINE_TRACE(MediaStreamTrack) { |
| 336 visitor->trace(m_registeredMediaStreams); | 336 visitor->trace(m_registeredMediaStreams); |
| 337 visitor->trace(m_component); | 337 visitor->trace(m_component); |
| 338 EventTargetWithInlineData::trace(visitor); | 338 EventTargetWithInlineData::trace(visitor); |
| 339 ContextLifecycleObserver::trace(visitor); | 339 ContextLifecycleObserver::trace(visitor); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace blink | 342 } // namespace blink |
| OLD | NEW |