Chromium Code Reviews| Index: Source/bindings/templates/methods.cpp |
| diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
| index ae5bfbd527bd6b238a2662ce2f2303b54adba2ed..2890b9c16bb3a390e8031192f58910f6ba121ec1 100644 |
| --- a/Source/bindings/templates/methods.cpp |
| +++ b/Source/bindings/templates/methods.cpp |
| @@ -489,12 +489,12 @@ static void constructor{{constructor.overload_index}}(const v8::FunctionCallback |
| {{generate_arguments(constructor) | indent}} |
| {% endif %} |
| {% if is_constructor_call_with_execution_context %} |
| - ExecutionContext* context = currentExecutionContext(isolate); |
| + ExecutionContext* scriptContext = currentExecutionContext(isolate); |
|
Jens Widell
2014/06/17 10:40:20
Renamed to make [CallWith] handling more uniform;
haraken
2014/06/17 11:28:05
scriptContext sounds unnatural. Shall we rename it
haraken
2014/06/17 12:38:53
Let's use |executionContext| consistently.
Jens Widell
2014/06/17 12:53:16
Done.
|
| {% endif %} |
| {% if is_constructor_call_with_document %} |
| Document& document = *toDocument(currentExecutionContext(isolate)); |
| {% endif %} |
| - {{constructor.cpp_type}} impl = {{cpp_class}}::create({{constructor.argument_list | join(', ')}}); |
| + {{constructor.cpp_type}} impl = {{constructor.cpp_value}}; |
| {% if is_constructor_raises_exception %} |
| if (exceptionState.throwIfNeeded()) |
| return; |
| @@ -535,12 +535,13 @@ static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V |
| return; |
| } |
| - Document* document = currentDOMWindow(isolate)->document(); |
| - ASSERT(document); |
| + Document* documentPtr = currentDOMWindow(isolate)->document(); |
|
Jens Widell
2014/06/17 10:40:20
Since this code is here, unconditionally, CallWith
Jens Widell
2014/06/17 12:53:16
This code uses 'currentDOMWindow(isolate)->documen
haraken
2014/06/17 12:57:39
The issue I want to address is just that we have b
|
| + ASSERT(documentPtr); |
| + Document& document = *documentPtr; |
|
Jens Widell
2014/06/17 10:40:20
Introduced to make [CallWith] handling more unifor
haraken
2014/06/17 11:28:05
Given that we're planning to remove CallWith=Docum
Jens Widell
2014/06/17 12:29:41
Yeah, maybe. Would you prefer I upload a patch tha
haraken
2014/06/17 12:38:53
Yes. A follow-up CL is fine :)
Jens Widell
2014/06/17 13:31:02
Hmm. Replacing ConstructorCallWith=Document with E
|
| // Make sure the document is added to the DOM Node map. Otherwise, the {{cpp_class}} 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 constructor.has_exception_state %} |
| ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interface_name}}", info.Holder(), isolate); |
| @@ -554,7 +555,7 @@ static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V |
| {% if constructor.arguments %} |
| {{generate_arguments(constructor) | indent}} |
| {% endif %} |
| - {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{constructor.argument_list | join(', ')}}); |
| + {{constructor.cpp_type}} impl = {{constructor.cpp_value}}; |
| {% if is_constructor_raises_exception %} |
| if (exceptionState.throwIfNeeded()) |
| return; |