| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/ExecutionContext.h" | 31 #include "core/dom/ExecutionContext.h" |
| 32 #include "core/events/Event.h" | 32 #include "core/events/Event.h" |
| 33 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" | 33 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" |
| 34 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" | 34 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" |
| 35 #include "platform/mediastream/MediaStreamCenter.h" | 35 #include "platform/mediastream/MediaStreamCenter.h" |
| 36 #include "platform/mediastream/MediaStreamComponent.h" | 36 #include "platform/mediastream/MediaStreamComponent.h" |
| 37 #include "public/platform/WebSourceInfo.h" | 37 #include "public/platform/WebSourceInfo.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 PassRefPtr<MediaStreamTrack> MediaStreamTrack::create(ExecutionContext* context,
MediaStreamComponent* component) | 41 PassRefPtrWillBeRawPtr<MediaStreamTrack> MediaStreamTrack::create(ExecutionConte
xt* context, MediaStreamComponent* component) |
| 42 { | 42 { |
| 43 RefPtr<MediaStreamTrack> track = adoptRef(new MediaStreamTrack(context, comp
onent)); | 43 RefPtrWillBeRawPtr<MediaStreamTrack> track = adoptRefCountedWillBeRefCounted
GarbageCollected(new MediaStreamTrack(context, component)); |
| 44 track->suspendIfNeeded(); | 44 track->suspendIfNeeded(); |
| 45 return track.release(); | 45 return track.release(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, MediaStreamCompone
nt* component) | 48 MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, MediaStreamCompone
nt* component) |
| 49 : ActiveDOMObject(context) | 49 : ActiveDOMObject(context) |
| 50 , m_stopped(false) | 50 , m_stopped(false) |
| 51 , m_component(component) | 51 , m_component(component) |
| 52 { | 52 { |
| 53 ScriptWrappable::init(this); | 53 ScriptWrappable::init(this); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, PassOwnPtr<MediaStr
eamTrackSourcesCallback> callback, ExceptionState& exceptionState) | 124 void MediaStreamTrack::getSources(ExecutionContext* context, PassOwnPtr<MediaStr
eamTrackSourcesCallback> callback, ExceptionState& exceptionState) |
| 125 { | 125 { |
| 126 RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequ
estImpl::create(context->securityOrigin()->toString(), callback); | 126 RefPtrWillBeRawPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrac
kSourcesRequestImpl::create(context->securityOrigin()->toString(), callback); |
| 127 if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request.releas
e())) | 127 if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request.releas
e())) |
| 128 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::f
ailedToExecute("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& exceptionState) | 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())) |
| (...skipping 51 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 |