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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 } 69 }
70 70
71 Node* V8GCController::opaqueRootForGC(Node* node, v8::Isolate*) 71 Node* V8GCController::opaqueRootForGC(Node* node, v8::Isolate*)
72 { 72 {
73 // FIXME: Remove the special handling for image elements. 73 // FIXME: Remove the special handling for image elements.
74 // The same special handling is in V8GCController::gcTree(). 74 // The same special handling is in V8GCController::gcTree().
75 // Maybe should image elements be active DOM nodes? 75 // Maybe should image elements be active DOM nodes?
76 // See https://code.google.com/p/chromium/issues/detail?id=164882 76 // See https://code.google.com/p/chromium/issues/detail?id=164882
77 if (node->inDocument() || (node->hasTagName(HTMLNames::imgTag) && toHTMLImag eElement(node)->hasPendingActivity())) 77 if (node->inDocument() || (node->hasTagName(HTMLNames::imgTag) && toHTMLImag eElement(node)->hasPendingActivity()))
78 return node->document(); 78 return &node->document();
79 79
80 if (node->isAttributeNode()) { 80 if (node->isAttributeNode()) {
81 Node* ownerElement = toAttr(node)->ownerElement(); 81 Node* ownerElement = toAttr(node)->ownerElement();
82 if (!ownerElement) 82 if (!ownerElement)
83 return node; 83 return node;
84 node = ownerElement; 84 node = ownerElement;
85 } 85 }
86 86
87 while (Node* parent = node->parentOrShadowHostNode()) 87 while (Node* parent = node->parentOrShadowHostNode())
88 node = parent; 88 node = parent;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 { 414 {
415 v8::HandleScope handleScope(isolate); 415 v8::HandleScope handleScope(isolate);
416 v8::Local<v8::Context> context = v8::Context::New(isolate); 416 v8::Local<v8::Context> context = v8::Context::New(isolate);
417 if (context.IsEmpty()) 417 if (context.IsEmpty())
418 return; 418 return;
419 v8::Context::Scope contextScope(context); 419 v8::Context::Scope contextScope(context);
420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat e), isolate); 420 V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolat e), isolate);
421 } 421 }
422 422
423 } // namespace WebCore 423 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptEventListener.cpp ('k') | Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698