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

Side by Side Diff: Source/WebCore/html/ValidationMessage.cpp

Issue 10694124: Merge 122082 - Heap-use-after-free in WebCore::RenderObject::destroyAndCleanupAnonymousWrappers (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « Source/WebCore/html/ValidationMessage.h ('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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // FIXME: Use transition to show the bubble. 175 // FIXME: Use transition to show the bubble.
176 } 176 }
177 177
178 void ValidationMessage::requestToHideMessage() 178 void ValidationMessage::requestToHideMessage()
179 { 179 {
180 // We must not modify the DOM tree in this context by the same reason as set Message(). 180 // We must not modify the DOM tree in this context by the same reason as set Message().
181 m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::de leteBubbleTree)); 181 m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::de leteBubbleTree));
182 m_timer->startOneShot(0); 182 m_timer->startOneShot(0);
183 } 183 }
184 184
185 bool ValidationMessage::shadowTreeContains(Node* node) const
186 {
187 if (!m_bubble)
188 return false;
189 return m_bubble->treeScope() == node->treeScope();
190 }
191
185 void ValidationMessage::deleteBubbleTree(Timer<ValidationMessage>*) 192 void ValidationMessage::deleteBubbleTree(Timer<ValidationMessage>*)
186 { 193 {
187 if (m_bubble) { 194 if (m_bubble) {
188 m_messageHeading = 0; 195 m_messageHeading = 0;
189 m_messageBody = 0; 196 m_messageBody = 0;
190 HTMLElement* host = toHTMLElement(m_element); 197 HTMLElement* host = toHTMLElement(m_element);
191 ExceptionCode ec; 198 ExceptionCode ec;
192 host->shadow()->oldestShadowRoot()->removeChild(m_bubble.get(), ec); 199 host->shadow()->oldestShadowRoot()->removeChild(m_bubble.get(), ec);
193 m_bubble = 0; 200 m_bubble = 0;
194 } 201 }
195 m_message = String(); 202 m_message = String();
196 } 203 }
197 204
198 } // namespace WebCore 205 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/html/ValidationMessage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698