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 24 matching lines...) Expand all Loading... |
35 #include "modules/mediastream/MediaStream.h" | 35 #include "modules/mediastream/MediaStream.h" |
36 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" | 36 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" |
37 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" | 37 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" |
38 #include "modules/mediastream/MediaTrackSettings.h" | 38 #include "modules/mediastream/MediaTrackSettings.h" |
39 #include "modules/mediastream/UserMediaController.h" | 39 #include "modules/mediastream/UserMediaController.h" |
40 #include "platform/mediastream/MediaStreamCenter.h" | 40 #include "platform/mediastream/MediaStreamCenter.h" |
41 #include "platform/mediastream/MediaStreamComponent.h" | 41 #include "platform/mediastream/MediaStreamComponent.h" |
42 #include "public/platform/WebMediaStreamTrack.h" | 42 #include "public/platform/WebMediaStreamTrack.h" |
43 #include "public/platform/WebSourceInfo.h" | 43 #include "public/platform/WebSourceInfo.h" |
44 #include "wtf/Assertions.h" | 44 #include "wtf/Assertions.h" |
| 45 #include <memory> |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
47 | 48 |
48 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, MediaStrea
mComponent* component) | 49 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, MediaStrea
mComponent* component) |
49 { | 50 { |
50 MediaStreamTrack* track = new MediaStreamTrack(context, component); | 51 MediaStreamTrack* track = new MediaStreamTrack(context, component); |
51 track->suspendIfNeeded(); | 52 track->suspendIfNeeded(); |
52 return track; | 53 return track; |
53 } | 54 } |
54 | 55 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // while finalizing m_component. Which dispatches an 'ended' event, | 249 // while finalizing m_component. Which dispatches an 'ended' event, |
249 // referring to this object as the target. If this object is then GCed | 250 // referring to this object as the target. If this object is then GCed |
250 // at the same time, v8 objects will retain (wrapper) references to | 251 // at the same time, v8 objects will retain (wrapper) references to |
251 // this dead MediaStreamTrack object. Bad. | 252 // this dead MediaStreamTrack object. Bad. |
252 // | 253 // |
253 // Hence insisting on keeping this object alive until the 'ended' | 254 // Hence insisting on keeping this object alive until the 'ended' |
254 // state has been reached & handled. | 255 // state has been reached & handled. |
255 return !ended() && hasEventListeners(EventTypeNames::ended); | 256 return !ended() && hasEventListeners(EventTypeNames::ended); |
256 } | 257 } |
257 | 258 |
258 PassOwnPtr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource() | 259 std::unique_ptr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource() |
259 { | 260 { |
260 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac
k(component()); | 261 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac
k(component()); |
261 } | 262 } |
262 | 263 |
263 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream) | 264 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream) |
264 { | 265 { |
265 CHECK(!m_isIteratingRegisteredMediaStreams); | 266 CHECK(!m_isIteratingRegisteredMediaStreams); |
266 CHECK(!m_registeredMediaStreams.contains(mediaStream)); | 267 CHECK(!m_registeredMediaStreams.contains(mediaStream)); |
267 m_registeredMediaStreams.add(mediaStream); | 268 m_registeredMediaStreams.add(mediaStream); |
268 } | 269 } |
(...skipping 18 matching lines...) Expand all Loading... |
287 | 288 |
288 DEFINE_TRACE(MediaStreamTrack) | 289 DEFINE_TRACE(MediaStreamTrack) |
289 { | 290 { |
290 visitor->trace(m_registeredMediaStreams); | 291 visitor->trace(m_registeredMediaStreams); |
291 visitor->trace(m_component); | 292 visitor->trace(m_component); |
292 EventTargetWithInlineData::trace(visitor); | 293 EventTargetWithInlineData::trace(visitor); |
293 ActiveDOMObject::trace(visitor); | 294 ActiveDOMObject::trace(visitor); |
294 } | 295 } |
295 | 296 |
296 } // namespace blink | 297 } // namespace blink |
OLD | NEW |