| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 case MediaStreamSource::ReadyStateMuted: | 114 case MediaStreamSource::ReadyStateMuted: |
| 115 return "muted"; | 115 return "muted"; |
| 116 case MediaStreamSource::ReadyStateEnded: | 116 case MediaStreamSource::ReadyStateEnded: |
| 117 return "ended"; | 117 return "ended"; |
| 118 } | 118 } |
| 119 | 119 |
| 120 ASSERT_NOT_REACHED(); | 120 ASSERT_NOT_REACHED(); |
| 121 return String(); | 121 return String(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void MediaStreamTrack::getSources(ExecutionContext* context, PassRefPtr<MediaStr
eamTrackSourcesCallback> callback, ExceptionState& es) | 124 void MediaStreamTrack::getSources(ExecutionContext* context, PassRefPtr<MediaStr
eamTrackSourcesCallback> callback, ExceptionState& exceptionState) |
| 125 { | 125 { |
| 126 RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequ
est::create(context, callback); | 126 RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequ
est::create(context, callback); |
| 127 if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request.releas
e())) | 127 if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request.releas
e())) |
| 128 es.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecu
te("getSources", "MediaStreamTrack", "Functionality not implemented yet")); | 128 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::f
ailedToExecute("getSources", "MediaStreamTrack", "Functionality not implemented
yet")); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void MediaStreamTrack::stopTrack(ExceptionState& es) | 131 void MediaStreamTrack::stopTrack(ExceptionState& exceptionState) |
| 132 { | 132 { |
| 133 if (ended()) | 133 if (ended()) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 if (!MediaStreamCenter::instance().didStopMediaStreamTrack(component())) | 136 if (!MediaStreamCenter::instance().didStopMediaStreamTrack(component())) |
| 137 es.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecu
te("stop", "MediaStreamTrack", "Functionality not implemented yet")); | 137 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::f
ailedToExecute("stop", "MediaStreamTrack", "Functionality not implemented yet"))
; |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool MediaStreamTrack::ended() const | 140 bool MediaStreamTrack::ended() const |
| 141 { | 141 { |
| 142 return m_stopped || (m_component->source()->readyState() == MediaStreamSourc
e::ReadyStateEnded); | 142 return m_stopped || (m_component->source()->readyState() == MediaStreamSourc
e::ReadyStateEnded); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void MediaStreamTrack::sourceChangedState() | 145 void MediaStreamTrack::sourceChangedState() |
| 146 { | 146 { |
| 147 if (m_stopped) | 147 if (m_stopped) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 { | 188 { |
| 189 return EventTargetNames::MediaStreamTrack; | 189 return EventTargetNames::MediaStreamTrack; |
| 190 } | 190 } |
| 191 | 191 |
| 192 ExecutionContext* MediaStreamTrack::executionContext() const | 192 ExecutionContext* MediaStreamTrack::executionContext() const |
| 193 { | 193 { |
| 194 return ActiveDOMObject::executionContext(); | 194 return ActiveDOMObject::executionContext(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace WebCore | 197 } // namespace WebCore |
| OLD | NEW |