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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp

Issue 340443004: IDL: reuse more code between CG for methods and constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename scriptContext -> executionContext Created 6 years, 6 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/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp b/Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp
index a55c5494d0cd47f52b7a0285a5e9596129449265..c59b5a8a4aa68848dc091d6d22b555d1cef8a765 100644
--- a/Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp
@@ -139,12 +139,13 @@ static void V8TestInterfaceWillBeGarbageCollectedConstructorCallback(const v8::F
return;
}
- Document* document = currentDOMWindow(isolate)->document();
- ASSERT(document);
+ Document* documentPtr = currentDOMWindow(isolate)->document();
+ ASSERT(documentPtr);
+ Document& document = *documentPtr;
// Make sure the document is added to the DOM Node map. Otherwise, the TestInterfaceWillBeGarbageCollected instance
// may end up being the only node in the map and get garbage-collected prematurely.
- toV8(document, info.Holder(), isolate);
+ toV8(documentPtr, info.Holder(), isolate);
if (UNLIKELY(info.Length() < 1)) {
throwMinimumArityTypeErrorForConstructor("TestInterfaceWillBeGarbageCollected", 1, info.Length(), info.GetIsolate());
@@ -154,7 +155,7 @@ static void V8TestInterfaceWillBeGarbageCollectedConstructorCallback(const v8::F
{
TOSTRING_VOID_INTERNAL(str, info[0]);
}
- RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterfaceWillBeGarbageCollected::createForJSConstructor(*document, str);
+ RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterfaceWillBeGarbageCollected::createForJSConstructor(str);
v8::Handle<v8::Object> wrapper = info.Holder();
V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceWillBeGarbageCollected>(impl.release(), &V8TestInterfaceWillBeGarbageCollectedConstructor::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceNamedConstructor2.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698