Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
46 45
47 namespace blink { 46 namespace blink {
48 47
49 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, MediaStrea mComponent* component) 48 MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, MediaStrea mComponent* component)
50 { 49 {
51 MediaStreamTrack* track = new MediaStreamTrack(context, component); 50 MediaStreamTrack* track = new MediaStreamTrack(context, component);
52 track->suspendIfNeeded(); 51 track->suspendIfNeeded();
53 return track; 52 return track;
54 } 53 }
55 54
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // while finalizing m_component. Which dispatches an 'ended' event, 248 // while finalizing m_component. Which dispatches an 'ended' event,
250 // referring to this object as the target. If this object is then GCed 249 // referring to this object as the target. If this object is then GCed
251 // at the same time, v8 objects will retain (wrapper) references to 250 // at the same time, v8 objects will retain (wrapper) references to
252 // this dead MediaStreamTrack object. Bad. 251 // this dead MediaStreamTrack object. Bad.
253 // 252 //
254 // Hence insisting on keeping this object alive until the 'ended' 253 // Hence insisting on keeping this object alive until the 'ended'
255 // state has been reached & handled. 254 // state has been reached & handled.
256 return !ended() && hasEventListeners(EventTypeNames::ended); 255 return !ended() && hasEventListeners(EventTypeNames::ended);
257 } 256 }
258 257
259 std::unique_ptr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource() 258 PassOwnPtr<AudioSourceProvider> MediaStreamTrack::createWebAudioSource()
260 { 259 {
261 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac k(component()); 260 return MediaStreamCenter::instance().createWebAudioSourceFromMediaStreamTrac k(component());
262 } 261 }
263 262
264 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream) 263 void MediaStreamTrack::registerMediaStream(MediaStream* mediaStream)
265 { 264 {
266 CHECK(!m_isIteratingRegisteredMediaStreams); 265 CHECK(!m_isIteratingRegisteredMediaStreams);
267 CHECK(!m_registeredMediaStreams.contains(mediaStream)); 266 CHECK(!m_registeredMediaStreams.contains(mediaStream));
268 m_registeredMediaStreams.add(mediaStream); 267 m_registeredMediaStreams.add(mediaStream);
269 } 268 }
(...skipping 18 matching lines...) Expand all
288 287
289 DEFINE_TRACE(MediaStreamTrack) 288 DEFINE_TRACE(MediaStreamTrack)
290 { 289 {
291 visitor->trace(m_registeredMediaStreams); 290 visitor->trace(m_registeredMediaStreams);
292 visitor->trace(m_component); 291 visitor->trace(m_component);
293 EventTargetWithInlineData::trace(visitor); 292 EventTargetWithInlineData::trace(visitor);
294 ActiveDOMObject::trace(visitor); 293 ActiveDOMObject::trace(visitor);
295 } 294 }
296 295
297 } // namespace blink 296 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698