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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 294053006: Oilpan: Use transition types for HTMLMediaElement and make AudioSourceProviderClient a GC mixin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 , m_completelyLoaded(false) 279 , m_completelyLoaded(false)
280 , m_havePreparedToPlay(false) 280 , m_havePreparedToPlay(false)
281 , m_delayingLoadForPreloadNone(false) 281 , m_delayingLoadForPreloadNone(false)
282 , m_tracksAreReady(true) 282 , m_tracksAreReady(true)
283 , m_haveVisibleTextTrack(false) 283 , m_haveVisibleTextTrack(false)
284 , m_processingPreferenceChange(false) 284 , m_processingPreferenceChange(false)
285 , m_lastTextTrackUpdateTime(-1) 285 , m_lastTextTrackUpdateTime(-1)
286 , m_textTracks(nullptr) 286 , m_textTracks(nullptr)
287 , m_ignoreTrackDisplayUpdate(0) 287 , m_ignoreTrackDisplayUpdate(0)
288 #if ENABLE(WEB_AUDIO) 288 #if ENABLE(WEB_AUDIO)
289 , m_audioSourceNode(0) 289 , m_audioSourceNode(nullptr)
290 #endif 290 #endif
291 { 291 {
292 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); 292 ASSERT(RuntimeEnabledFeatures::mediaEnabled());
293 293
294 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement"); 294 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement");
295 ScriptWrappable::init(this); 295 ScriptWrappable::init(this);
296 296
297 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes ture()) 297 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes ture())
298 m_userGestureRequiredForPlay = true; 298 m_userGestureRequiredForPlay = true;
299 299
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 #if !ENABLE(OILPAN) 356 #if !ENABLE(OILPAN)
357 // Destroying the player may cause a resource load to be canceled, 357 // Destroying the player may cause a resource load to be canceled,
358 // which could result in Document::dispatchWindowLoadEvent() being 358 // which could result in Document::dispatchWindowLoadEvent() being
359 // called via ResourceFetch::didLoadResource() then 359 // called via ResourceFetch::didLoadResource() then
360 // FrameLoader::loadDone(). To prevent load event dispatching during 360 // FrameLoader::loadDone(). To prevent load event dispatching during
361 // object destruction, we use Document::incrementLoadEventDelayCount(). 361 // object destruction, we use Document::incrementLoadEventDelayCount().
362 // See http://crbug.com/275223 for more details. 362 // See http://crbug.com/275223 for more details.
363 document().incrementLoadEventDelayCount(); 363 document().incrementLoadEventDelayCount();
364 #endif 364 #endif
365 365
366 #if ENABLE(OILPAN)
367 #if ENABLE(WEB_AUDIO)
368 if (audioSourceProvider())
369 audioSourceProvider()->setClient(0);
370 #endif
371 m_player.clear();
372 #else
373 ASSERT(!m_audioSourceNode);
haraken 2014/05/21 16:35:58 I'm curious why you added this ASSERT. If m_audioS
zerny-chromium 2014/05/22 05:54:32 Exactly. That is why I inlined the reduced code in
Mads Ager (chromium) 2014/05/22 08:02:56 Maybe we can split this into two methods: clearMe
366 clearMediaPlayerAndAudioSourceProviderClient(); 374 clearMediaPlayerAndAudioSourceProviderClient();
375 #endif
367 376
368 #if !ENABLE(OILPAN) 377 #if !ENABLE(OILPAN)
369 document().decrementLoadEventDelayCount(); 378 document().decrementLoadEventDelayCount();
370 #endif 379 #endif
371 } 380 }
372 381
373 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) 382 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument)
374 { 383 {
375 WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument"); 384 WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument");
376 385
(...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 return fastHasAttribute(controlsAttr); 3654 return fastHasAttribute(controlsAttr);
3646 } 3655 }
3647 3656
3648 void HTMLMediaElement::trace(Visitor* visitor) 3657 void HTMLMediaElement::trace(Visitor* visitor)
3649 { 3658 {
3650 visitor->trace(m_error); 3659 visitor->trace(m_error);
3651 visitor->trace(m_currentSourceNode); 3660 visitor->trace(m_currentSourceNode);
3652 visitor->trace(m_nextChildNodeToConsider); 3661 visitor->trace(m_nextChildNodeToConsider);
3653 visitor->trace(m_textTracks); 3662 visitor->trace(m_textTracks);
3654 visitor->trace(m_textTracksWhenResourceSelectionBegan); 3663 visitor->trace(m_textTracksWhenResourceSelectionBegan);
3664 visitor->trace(m_audioSourceNode);
3655 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor); 3665 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor);
3656 HTMLElement::trace(visitor); 3666 HTMLElement::trace(visitor);
3657 } 3667 }
3658 3668
3659 } 3669 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698