OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (node->containsWrapper()) { | 164 if (node->containsWrapper()) { |
165 if (!node->isV8CollectableDuringMinorGC()) { | 165 if (!node->isV8CollectableDuringMinorGC()) { |
166 // This node is not in the new space of V8. This indicates t
hat | 166 // This node is not in the new space of V8. This indicates t
hat |
167 // the minor GC cannot anyway judge reachability of this DOM
tree. | 167 // the minor GC cannot anyway judge reachability of this DOM
tree. |
168 // Thus we give up traversing the DOM tree. | 168 // Thus we give up traversing the DOM tree. |
169 return false; | 169 return false; |
170 } | 170 } |
171 node->clearV8CollectableDuringMinorGC(); | 171 node->clearV8CollectableDuringMinorGC(); |
172 partiallyDependentNodes->append(node); | 172 partiallyDependentNodes->append(node); |
173 } | 173 } |
174 if (ShadowRoot* shadowRoot = node->youngestShadowRoot()) { | 174 if (ShadowRoot* shadowRoot = node->shadowRoot()) { |
175 if (!traverseTree(shadowRoot, partiallyDependentNodes)) | 175 if (!traverseTree(shadowRoot, partiallyDependentNodes)) |
176 return false; | 176 return false; |
177 } else if (node->isShadowRoot()) { | |
178 if (ShadowRoot* shadowRoot = toShadowRoot(node)->olderShadowRoot
()) { | |
179 if (!traverseTree(shadowRoot, partiallyDependentNodes)) | |
180 return false; | |
181 } | |
182 } | 177 } |
183 // <template> has a |content| property holding a DOM fragment which
we must traverse, | 178 // <template> has a |content| property holding a DOM fragment which
we must traverse, |
184 // just like we do for the shadow trees above. | 179 // just like we do for the shadow trees above. |
185 if (isHTMLTemplateElement(*node)) { | 180 if (isHTMLTemplateElement(*node)) { |
186 if (!traverseTree(toHTMLTemplateElement(*node).content(), partia
llyDependentNodes)) | 181 if (!traverseTree(toHTMLTemplateElement(*node).content(), partia
llyDependentNodes)) |
187 return false; | 182 return false; |
188 } | 183 } |
189 | 184 |
190 // Document maintains the list of imported documents through HTMLImp
ortsController. | 185 // Document maintains the list of imported documents through HTMLImp
ortsController. |
191 if (node->isDocumentNode()) { | 186 if (node->isDocumentNode()) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 static size_t lastUsageReportedToV8 = 0; | 406 static size_t lastUsageReportedToV8 = 0; |
412 | 407 |
413 size_t currentUsage = Partitions::currentDOMMemoryUsage(); | 408 size_t currentUsage = Partitions::currentDOMMemoryUsage(); |
414 int64_t diff = static_cast<int64_t>(currentUsage) - static_cast<int64_t>(las
tUsageReportedToV8); | 409 int64_t diff = static_cast<int64_t>(currentUsage) - static_cast<int64_t>(las
tUsageReportedToV8); |
415 isolate->AdjustAmountOfExternalAllocatedMemory(diff); | 410 isolate->AdjustAmountOfExternalAllocatedMemory(diff); |
416 | 411 |
417 lastUsageReportedToV8 = currentUsage; | 412 lastUsageReportedToV8 = currentUsage; |
418 } | 413 } |
419 | 414 |
420 } // namespace blink | 415 } // namespace blink |
OLD | NEW |