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

Side by Side Diff: Source/core/dom/GenericEventQueue.cpp

Issue 15739014: Avoid referencing an HTMLMediaElement if is currently being deleted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed build error again 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org)
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 GenericEventQueue::~GenericEventQueue() 46 GenericEventQueue::~GenericEventQueue()
47 { 47 {
48 } 48 }
49 49
50 bool GenericEventQueue::enqueueEvent(PassRefPtr<Event> event) 50 bool GenericEventQueue::enqueueEvent(PassRefPtr<Event> event)
51 { 51 {
52 if (m_isClosed) 52 if (m_isClosed)
53 return false; 53 return false;
54 54
55 ASSERT(event->target());
56 if (event->target() == m_owner) 55 if (event->target() == m_owner)
57 event->setTarget(0); 56 event->setTarget(0);
58 57
59 m_pendingEvents.append(event); 58 m_pendingEvents.append(event);
60 59
61 if (!m_timer.isActive()) 60 if (!m_timer.isActive())
62 m_timer.startOneShot(0); 61 m_timer.startOneShot(0);
63 62
64 return true; 63 return true;
65 } 64 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 m_timer.stop(); 104 m_timer.stop();
106 m_pendingEvents.clear(); 105 m_pendingEvents.clear();
107 } 106 }
108 107
109 bool GenericEventQueue::hasPendingEvents() const 108 bool GenericEventQueue::hasPendingEvents() const
110 { 109 {
111 return m_pendingEvents.size(); 110 return m_pendingEvents.size();
112 } 111 }
113 112
114 } 113 }
OLDNEW
« no previous file with comments | « LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698