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

Unified Diff: Source/bindings/v8/custom/V8InjectedScriptHostCustom.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, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
diff --git a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 73b8d6303a5a952481764c84dd5752d3d2d18c9e..58c198e7ebce1c77944646335b07d3479d55130b 100644
--- a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -273,9 +273,7 @@ void V8InjectedScriptHost::getEventListenersMethodCustom(const v8::FunctionCallb
if (!node)
return;
// This can only happen for orphan DocumentType nodes.
- Document* document = node->document();
- if (!node->document())
- return;
+ Document& document = node->document();
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
Vector<EventListenerInfo> listenersArray;
@@ -283,7 +281,7 @@ void V8InjectedScriptHost::getEventListenersMethodCustom(const v8::FunctionCallb
v8::Local<v8::Object> result = v8::Object::New();
for (size_t i = 0; i < listenersArray.size(); ++i) {
- v8::Handle<v8::Array> listeners = getJSListenerFunctions(document, listenersArray[i]);
+ v8::Handle<v8::Array> listeners = getJSListenerFunctions(&document, listenersArray[i]);
if (!listeners->Length())
continue;
AtomicString eventType = listenersArray[i].eventType;
« no previous file with comments | « Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp ('k') | Source/core/accessibility/AXObjectCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698