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

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

Issue 1382353002: Oilpan: promptly dispose style resolvers upon clearing. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 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 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 ScopedStyleResolver& TreeScope::ensureScopedStyleResolver() 149 ScopedStyleResolver& TreeScope::ensureScopedStyleResolver()
150 { 150 {
151 RELEASE_ASSERT(this); 151 RELEASE_ASSERT(this);
152 if (!m_scopedStyleResolver) 152 if (!m_scopedStyleResolver)
153 m_scopedStyleResolver = ScopedStyleResolver::create(*this); 153 m_scopedStyleResolver = ScopedStyleResolver::create(*this);
154 return *m_scopedStyleResolver; 154 return *m_scopedStyleResolver;
155 } 155 }
156 156
157 void TreeScope::clearScopedStyleResolver() 157 void TreeScope::clearScopedStyleResolver()
158 { 158 {
159 #if ENABLE(OILPAN)
160 if (m_scopedStyleResolver)
161 m_scopedStyleResolver->dispose();
162 #endif
159 m_scopedStyleResolver.clear(); 163 m_scopedStyleResolver.clear();
160 } 164 }
161 165
162 Element* TreeScope::getElementById(const AtomicString& elementId) const 166 Element* TreeScope::getElementById(const AtomicString& elementId) const
163 { 167 {
164 if (elementId.isEmpty()) 168 if (elementId.isEmpty())
165 return 0; 169 return 0;
166 if (!m_elementsById) 170 if (!m_elementsById)
167 return 0; 171 return 0;
168 return m_elementsById->getElementById(elementId, this); 172 return m_elementsById->getElementById(elementId, this);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 visitor->trace(m_parentTreeScope); 584 visitor->trace(m_parentTreeScope);
581 visitor->trace(m_idTargetObserverRegistry); 585 visitor->trace(m_idTargetObserverRegistry);
582 visitor->trace(m_selection); 586 visitor->trace(m_selection);
583 visitor->trace(m_elementsById); 587 visitor->trace(m_elementsById);
584 visitor->trace(m_imageMapsByName); 588 visitor->trace(m_imageMapsByName);
585 visitor->trace(m_labelsByForAttribute); 589 visitor->trace(m_labelsByForAttribute);
586 visitor->trace(m_scopedStyleResolver); 590 visitor->trace(m_scopedStyleResolver);
587 } 591 }
588 592
589 } // namespace blink 593 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698