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

Side by Side Diff: Source/WebCore/dom/MutationObserverRegistration.cpp

Issue 9999033: Merge 113378 - Crash in MutationObservers due to an invalid HashSet iterator (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 * 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 m_options = options; 64 m_options = options;
65 m_attributeFilter = attributeFilter; 65 m_attributeFilter = attributeFilter;
66 } 66 }
67 67
68 void MutationObserverRegistration::observedSubtreeNodeWillDetach(PassRefPtr<Node > node) 68 void MutationObserverRegistration::observedSubtreeNodeWillDetach(PassRefPtr<Node > node)
69 { 69 {
70 if (!isSubtree()) 70 if (!isSubtree())
71 return; 71 return;
72 72
73 node->registerTransientMutationObserver(this); 73 node->registerTransientMutationObserver(this);
74 m_observer->setHasTransientRegistration();
74 75
75 if (!m_transientRegistrationNodes) { 76 if (!m_transientRegistrationNodes) {
76 m_transientRegistrationNodes = adoptPtr(new NodeHashSet); 77 m_transientRegistrationNodes = adoptPtr(new NodeHashSet);
77 78
78 ASSERT(!m_registrationNodeKeepAlive); 79 ASSERT(!m_registrationNodeKeepAlive);
79 m_registrationNodeKeepAlive = m_registrationNode; // Balanced in clearTr ansientRegistrations. 80 m_registrationNodeKeepAlive = m_registrationNode; // Balanced in clearTr ansientRegistrations.
80 } 81 }
81 m_transientRegistrationNodes->add(node); 82 m_transientRegistrationNodes->add(node);
82 } 83 }
83 84
(...skipping 29 matching lines...) Expand all
113 114
114 if (type != WebKitMutationObserver::Attributes || !(m_options & WebKitMutati onObserver::AttributeFilter)) 115 if (type != WebKitMutationObserver::Attributes || !(m_options & WebKitMutati onObserver::AttributeFilter))
115 return true; 116 return true;
116 117
117 return m_attributeFilter.contains(attributeName); 118 return m_attributeFilter.contains(attributeName);
118 } 119 }
119 120
120 } // namespace WebCore 121 } // namespace WebCore
121 122
122 #endif // ENABLE(MUTATION_OBSERVERS) 123 #endif // ENABLE(MUTATION_OBSERVERS)
OLDNEW
« no previous file with comments | « Source/WebCore/dom/MutationObserverRegistration.h ('k') | Source/WebCore/dom/WebKitMutationObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698