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

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

Issue 1594813002: Oilpan: Fix weak processing for IntersectionObserver::m_root (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « third_party/WebKit/Source/core/dom/IntersectionObserver.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/IntersectionObserver.h" 5 #include "core/dom/IntersectionObserver.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/css/parser/CSSParserTokenRange.h" 8 #include "core/css/parser/CSSParserTokenRange.h"
9 #include "core/css/parser/CSSTokenizer.h" 9 #include "core/css/parser/CSSTokenizer.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 bool IntersectionObserver::hasPercentMargin() const 312 bool IntersectionObserver::hasPercentMargin() const
313 { 313 {
314 return (m_topMargin.type() == Percent 314 return (m_topMargin.type() == Percent
315 || m_rightMargin.type() == Percent 315 || m_rightMargin.type() == Percent
316 || m_bottomMargin.type() == Percent 316 || m_bottomMargin.type() == Percent
317 || m_leftMargin.type() == Percent); 317 || m_leftMargin.type() == Percent);
318 } 318 }
319 319
320 void IntersectionObserver::rootDisappearedCallback(Visitor* visitor, void* self) 320 #if ENABLE(OILPAN)
321 void IntersectionObserver::clearWeakMembers(Visitor* visitor)
321 { 322 {
322 IntersectionObserver* observer = static_cast<IntersectionObserver*>(self); 323 if (Heap::isHeapObjectAlive(m_root))
323 observer->disconnect(); 324 return;
325 disconnect();
326 m_root = nullptr;
324 } 327 }
328 #endif
325 329
326 DEFINE_TRACE(IntersectionObserver) 330 DEFINE_TRACE(IntersectionObserver)
327 { 331 {
328 #if ENABLE(OILPAN) 332 #if ENABLE(OILPAN)
329 visitor->registerWeakMembers(this, m_root.get(), IntersectionObserver::rootD isappearedCallback); 333 visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObs erver::clearWeakMembers>(this);
330 #endif 334 #endif
331 visitor->trace(m_callback); 335 visitor->trace(m_callback);
332 visitor->trace(m_root);
333 visitor->trace(m_observations); 336 visitor->trace(m_observations);
334 visitor->trace(m_entries); 337 visitor->trace(m_entries);
335 } 338 }
336 339
337 } // namespace blink 340 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698