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

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

Issue 585903002: Fix the "inactive document" condition for HTMLMediaElement GC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | « LayoutTests/media/gc-pending-event-inactive-document.html ('k') | no next file » | 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) 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 3511 matching lines...) Expand 10 before | Expand all | Expand 10 after
3522 renderer()->updateFromElement(); 3522 renderer()->updateFromElement();
3523 3523
3524 stopPeriodicTimers(); 3524 stopPeriodicTimers();
3525 cancelPendingEventsAndCallbacks(); 3525 cancelPendingEventsAndCallbacks();
3526 3526
3527 m_asyncEventQueue->close(); 3527 m_asyncEventQueue->close();
3528 } 3528 }
3529 3529
3530 bool HTMLMediaElement::hasPendingActivity() const 3530 bool HTMLMediaElement::hasPendingActivity() const
3531 { 3531 {
3532 // After the document becomes inactive, no events can ever be fired. 3532 // After stop() the element is inactive and no events can ever be fired.
3533 if (!document().isActive()) 3533 if (!m_active) {
fs 2014/09/19 12:40:50 Isn't the element also inactive after being remove
philipj_slow 2014/09/19 12:48:47 Yes, both the comment and the code (m_active) is t
philipj_slow 2014/09/19 12:56:33 Oh, you meant the bit in HTMLMediaElement::removed
3534 ASSERT(!m_asyncEventQueue->hasPendingEvents());
3534 return false; 3535 return false;
3536 }
3535 3537
3536 // The delaying-the-load-event flag is set by resource selection algorithm w hen looking for a 3538 // The delaying-the-load-event flag is set by resource selection algorithm w hen looking for a
3537 // resource to load, before networkState has reached to NETWORK_LOADING. 3539 // resource to load, before networkState has reached to NETWORK_LOADING.
3538 if (m_shouldDelayLoadEvent) 3540 if (m_shouldDelayLoadEvent)
3539 return true; 3541 return true;
3540 3542
3541 // When networkState is NETWORK_LOADING, progress and stalled events may be fired. 3543 // When networkState is NETWORK_LOADING, progress and stalled events may be fired.
3542 if (m_networkState == NETWORK_LOADING) 3544 if (m_networkState == NETWORK_LOADING)
3543 return true; 3545 return true;
3544 3546
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
4045 4047
4046 #if ENABLE(WEB_AUDIO) 4048 #if ENABLE(WEB_AUDIO)
4047 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 4049 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
4048 { 4050 {
4049 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) 4051 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
4050 audioSourceProvider()->setClient(0); 4052 audioSourceProvider()->setClient(0);
4051 } 4053 }
4052 #endif 4054 #endif
4053 4055
4054 } 4056 }
OLDNEW
« no previous file with comments | « LayoutTests/media/gc-pending-event-inactive-document.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698