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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.cpp

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ElementShadow* shadow = parentElementShadow(); 334 ElementShadow* shadow = parentElementShadow();
335 ASSERT(shadow); 335 ASSERT(shadow);
336 if (!shadow->needsDistributionRecalc() && distributionChanged()) 336 if (!shadow->needsDistributionRecalc() && distributionChanged())
337 shadow->setNeedsDistributionRecalc(); 337 shadow->setNeedsDistributionRecalc();
338 } 338 }
339 } 339 }
340 340
341 void HTMLSlotElement::fireSlotChangeEvent() 341 void HTMLSlotElement::fireSlotChangeEvent()
342 { 342 {
343 ASSERT(!m_slotchangeEventAdded); 343 ASSERT(!m_slotchangeEventAdded);
344 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChangeEv ent, this)); 344 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChangeEv ent, retainedRef(this)));
345 m_slotchangeEventAdded = true; 345 m_slotchangeEventAdded = true;
346 346
347 Element* shadowHost = isShadowHost(parentElement()) ? parentElement() : null ptr; 347 Element* shadowHost = isShadowHost(parentElement()) ? parentElement() : null ptr;
348 // If this slot is assigned to another slot, fire slot change event of that slot too. 348 // If this slot is assigned to another slot, fire slot change event of that slot too.
349 if (shadowHost && shadowHost->shadowRootIfV1()) { 349 if (shadowHost && shadowHost->shadowRootIfV1()) {
350 if (HTMLSlotElement* assigned = assignedSlot()) { 350 if (HTMLSlotElement* assigned = assignedSlot()) {
351 if (!assigned->m_slotchangeEventAdded) 351 if (!assigned->m_slotchangeEventAdded)
352 assigned->fireSlotChangeEvent(); 352 assigned->fireSlotChangeEvent();
353 } 353 }
354 } 354 }
(...skipping 16 matching lines...) Expand all
371 visitor->trace(m_distributedNodes); 371 visitor->trace(m_distributedNodes);
372 visitor->trace(m_fallbackNodes); 372 visitor->trace(m_fallbackNodes);
373 visitor->trace(m_distributedIndices); 373 visitor->trace(m_distributedIndices);
374 visitor->trace(m_oldAssignedNodes); 374 visitor->trace(m_oldAssignedNodes);
375 visitor->trace(m_oldDistributedNodes); 375 visitor->trace(m_oldDistributedNodes);
376 visitor->trace(m_oldFallbackNodes); 376 visitor->trace(m_oldFallbackNodes);
377 HTMLElement::trace(visitor); 377 HTMLElement::trace(visitor);
378 } 378 }
379 379
380 } // namespace blink 380 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698