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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementCallbackQueue.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 CustomElementCallbackQueue::CustomElementCallbackQueue(RawPtr<Element> element) 42 CustomElementCallbackQueue::CustomElementCallbackQueue(RawPtr<Element> element)
43 : m_element(element) 43 : m_element(element)
44 , m_owner(-1) 44 , m_owner(-1)
45 , m_index(0) 45 , m_index(0)
46 , m_inCreatedCallback(false) 46 , m_inCreatedCallback(false)
47 { 47 {
48 } 48 }
49 49
50 bool CustomElementCallbackQueue::processInElementQueue(ElementQueueId caller) 50 bool CustomElementCallbackQueue::processInElementQueue(ElementQueueId caller)
51 { 51 {
52 ASSERT(!m_inCreatedCallback); 52 DCHECK(!m_inCreatedCallback);
53 bool didWork = false; 53 bool didWork = false;
54 54
55 // Never run custom element callbacks in UA shadow roots since that would 55 // Never run custom element callbacks in UA shadow roots since that would
56 // leak the UA root and it's elements into the page. 56 // leak the UA root and it's elements into the page.
57 ShadowRoot* shadowRoot = m_element->containingShadowRoot(); 57 ShadowRoot* shadowRoot = m_element->containingShadowRoot();
58 if (!shadowRoot || shadowRoot->type() != ShadowRootType::UserAgent) { 58 if (!shadowRoot || shadowRoot->type() != ShadowRootType::UserAgent) {
59 while (m_index < m_queue.size() && owner() == caller) { 59 while (m_index < m_queue.size() && owner() == caller) {
60 m_inCreatedCallback = m_queue[m_index]->isCreatedCallback(); 60 m_inCreatedCallback = m_queue[m_index]->isCreatedCallback();
61 61
62 // dispatch() may cause recursion which steals this callback 62 // dispatch() may cause recursion which steals this callback
(...skipping 15 matching lines...) Expand all
78 return didWork; 78 return didWork;
79 } 79 }
80 80
81 DEFINE_TRACE(CustomElementCallbackQueue) 81 DEFINE_TRACE(CustomElementCallbackQueue)
82 { 82 {
83 visitor->trace(m_element); 83 visitor->trace(m_element);
84 visitor->trace(m_queue); 84 visitor->trace(m_queue);
85 } 85 }
86 86
87 } // namespace blink 87 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698