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

Side by Side Diff: Source/bindings/v8/V8GCController.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 | « Source/bindings/v8/RetainedDOMInfo.cpp ('k') | Source/core/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 gcTree(m_isolate, node); 150 gcTree(m_isolate, node);
151 } 151 }
152 } 152 }
153 153
154 private: 154 private:
155 bool traverseTree(Node* rootNode, Vector<Node*, initialNodeVectorSize>* newS paceNodes) 155 bool traverseTree(Node* rootNode, Vector<Node*, initialNodeVectorSize>* newS paceNodes)
156 { 156 {
157 // To make each minor GC time bounded, we might need to give up 157 // To make each minor GC time bounded, we might need to give up
158 // traversing at some point for a large DOM tree. That being said, 158 // traversing at some point for a large DOM tree. That being said,
159 // I could not observe the need even in pathological test cases. 159 // I could not observe the need even in pathological test cases.
160 for (Node* node = rootNode; node; node = NodeTraversal::next(node)) { 160 for (Node* node = rootNode; node; node = NodeTraversal::next(*node)) {
161 if (node->containsWrapper()) { 161 if (node->containsWrapper()) {
162 // FIXME: Remove the special handling for image elements. 162 // FIXME: Remove the special handling for image elements.
163 // The same special handling is in V8GCController::opaqueRootFor GC(). 163 // The same special handling is in V8GCController::opaqueRootFor GC().
164 // Maybe should image elements be active DOM nodes? 164 // Maybe should image elements be active DOM nodes?
165 // See https://code.google.com/p/chromium/issues/detail?id=16488 2 165 // See https://code.google.com/p/chromium/issues/detail?id=16488 2
166 if (!node->isV8CollectableDuringMinorGC() || (node->hasTagName(H TMLNames::imgTag) && toHTMLImageElement(node)->hasPendingActivity())) { 166 if (!node->isV8CollectableDuringMinorGC() || (node->hasTagName(H TMLNames::imgTag) && toHTMLImageElement(node)->hasPendingActivity())) {
167 // This node is not in the new space of V8. This indicates t hat 167 // This node is not in the new space of V8. This indicates t hat
168 // the minor GC cannot anyway judge reachability of this DOM tree. 168 // the minor GC cannot anyway judge reachability of this DOM tree.
169 // Thus we give up traversing the DOM tree. 169 // Thus we give up traversing the DOM tree.
170 return false; 170 return false;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 { 422 {
423 v8::HandleScope handleScope(isolate); 423 v8::HandleScope handleScope(isolate);
424 v8::Local<v8::Context> context = v8::Context::New(isolate); 424 v8::Local<v8::Context> context = v8::Context::New(isolate);
425 if (context.IsEmpty()) 425 if (context.IsEmpty())
426 return; 426 return;
427 v8::Context::Scope contextScope(context); 427 v8::Context::Scope contextScope(context);
428 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat e), isolate); 428 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat e), isolate);
429 } 429 }
430 430
431 } // namespace WebCore 431 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/RetainedDOMInfo.cpp ('k') | Source/core/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698