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

Side by Side Diff: Source/modules/mediastream/MediaStream.cpp

Issue 17351003: Rename ContextDestructionObserver to ContextLifecycleObserver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reapplied Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/mediastream/MediaStream.h ('k') | Source/modules/mediastream/UserMediaRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011, 2012 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 return createFromSourceVectors(context, audioSources, videoSources); 97 return createFromSourceVectors(context, audioSources, videoSources);
98 } 98 }
99 99
100 PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, Pas sRefPtr<MediaStreamDescriptor> streamDescriptor) 100 PassRefPtr<MediaStream> MediaStream::create(ScriptExecutionContext* context, Pas sRefPtr<MediaStreamDescriptor> streamDescriptor)
101 { 101 {
102 return adoptRef(new MediaStream(context, streamDescriptor)); 102 return adoptRef(new MediaStream(context, streamDescriptor));
103 } 103 }
104 104
105 MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream Descriptor> streamDescriptor) 105 MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream Descriptor> streamDescriptor)
106 : ContextDestructionObserver(context) 106 : ContextLifecycleObserver(context)
107 , m_stopped(false) 107 , m_stopped(false)
108 , m_descriptor(streamDescriptor) 108 , m_descriptor(streamDescriptor)
109 , m_scheduledEventTimer(this, &MediaStream::scheduledEventTimerFired) 109 , m_scheduledEventTimer(this, &MediaStream::scheduledEventTimerFired)
110 { 110 {
111 ScriptWrappable::init(this); 111 ScriptWrappable::init(this);
112 m_descriptor->setClient(this); 112 m_descriptor->setClient(this);
113 113
114 size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents(); 114 size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents();
115 m_audioTracks.reserveCapacity(numberOfAudioTracks); 115 m_audioTracks.reserveCapacity(numberOfAudioTracks);
116 for (size_t i = 0; i < numberOfAudioTracks; i++) 116 for (size_t i = 0; i < numberOfAudioTracks; i++)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 { 247 {
248 if (ended()) 248 if (ended())
249 return; 249 return;
250 250
251 m_descriptor->setEnded(); 251 m_descriptor->setEnded();
252 scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false)); 252 scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false));
253 } 253 }
254 254
255 void MediaStream::contextDestroyed() 255 void MediaStream::contextDestroyed()
256 { 256 {
257 ContextDestructionObserver::contextDestroyed(); 257 ContextLifecycleObserver::contextDestroyed();
258 m_stopped = true; 258 m_stopped = true;
259 } 259 }
260 260
261 const AtomicString& MediaStream::interfaceName() const 261 const AtomicString& MediaStream::interfaceName() const
262 { 262 {
263 return eventNames().interfaceForMediaStream; 263 return eventNames().interfaceForMediaStream;
264 } 264 }
265 265
266 ScriptExecutionContext* MediaStream::scriptExecutionContext() const 266 ScriptExecutionContext* MediaStream::scriptExecutionContext() const
267 { 267 {
268 return ContextDestructionObserver::scriptExecutionContext(); 268 return ContextLifecycleObserver::scriptExecutionContext();
269 } 269 }
270 270
271 EventTargetData* MediaStream::eventTargetData() 271 EventTargetData* MediaStream::eventTargetData()
272 { 272 {
273 return &m_eventTargetData; 273 return &m_eventTargetData;
274 } 274 }
275 275
276 EventTargetData* MediaStream::ensureEventTargetData() 276 EventTargetData* MediaStream::ensureEventTargetData()
277 { 277 {
278 return &m_eventTargetData; 278 return &m_eventTargetData;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 events.clear(); 355 events.clear();
356 } 356 }
357 357
358 URLRegistry& MediaStream::registry() const 358 URLRegistry& MediaStream::registry() const
359 { 359 {
360 return MediaStreamRegistry::registry(); 360 return MediaStreamRegistry::registry();
361 } 361 }
362 362
363 } // namespace WebCore 363 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/MediaStream.h ('k') | Source/modules/mediastream/UserMediaRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698