Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %} | 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %} |
| 2 | 2 |
| 3 {##############################################################################} | 3 {##############################################################################} |
| 4 {% macro generate_method(method, world_suffix) %} | 4 {% macro generate_method(method, world_suffix) %} |
| 5 {% if method.returns_promise and method.has_exception_state %} | 5 {% if method.returns_promise and method.has_exception_state %} |
| 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) | 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) |
| 7 {% else %} | 7 {% else %} |
| 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) | 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 9 {% endif %} | 9 {% endif %} |
| 10 { | 10 { |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 {##############################################################################} | 468 {##############################################################################} |
| 469 {% macro generate_post_message_impl() %} | 469 {% macro generate_post_message_impl() %} |
| 470 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v 8::FunctionCallbackInfo<v8::Value>& info) | 470 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v 8::FunctionCallbackInfo<v8::Value>& info) |
| 471 { | 471 { |
| 472 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage ", interfaceName, info.Holder(), info.GetIsolate()); | 472 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage ", interfaceName, info.Holder(), info.GetIsolate()); |
| 473 if (UNLIKELY(info.Length() < 1)) { | 473 if (UNLIKELY(info.Length() < 1)) { |
| 474 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 474 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| 475 exceptionState.throwIfNeeded(); | 475 exceptionState.throwIfNeeded(); |
| 476 return; | 476 return; |
| 477 } | 477 } |
| 478 RawPtr<MessagePortArray> ports = new MessagePortArray; | 478 MessagePortArray* ports = new MessagePortArray; |
|
sof
2016/04/12 07:29:54
This might conflict with https://codereview.chromi
| |
| 479 ArrayBufferArray arrayBuffers; | 479 ArrayBufferArray arrayBuffers; |
| 480 ImageBitmapArray imageBitmaps; | 480 ImageBitmapArray imageBitmaps; |
| 481 if (info.Length() > 1) { | 481 if (info.Length() > 1) { |
| 482 const int transferablesArgIndex = 1; | 482 const int transferablesArgIndex = 1; |
| 483 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info [transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, imageBitma ps, exceptionState)) { | 483 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info [transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, imageBitma ps, exceptionState)) { |
| 484 exceptionState.throwIfNeeded(); | 484 exceptionState.throwIfNeeded(); |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, &imageBitmap s, exceptionState); | 488 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan ce().create(info.GetIsolate(), info[0], ports, &arrayBuffers, &imageBitmaps, exc eptionState); |
| 489 if (exceptionState.throwIfNeeded()) | 489 if (exceptionState.throwIfNeeded()) |
| 490 return; | 490 return; |
| 491 // FIXME: Only pass context/exceptionState if instance really requires it. | 491 // FIXME: Only pass context/exceptionState if instance really requires it. |
| 492 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 492 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
| 493 instance->postMessage(context, message.release(), ports.get(), exceptionStat e); | 493 instance->postMessage(context, message.release(), ports, exceptionState); |
| 494 exceptionState.throwIfNeeded(); | 494 exceptionState.throwIfNeeded(); |
| 495 } | 495 } |
| 496 {% endmacro %} | 496 {% endmacro %} |
| 497 | 497 |
| 498 {##############################################################################} | 498 {##############################################################################} |
| 499 {% macro method_callback(method, world_suffix) %} | 499 {% macro method_callback(method, world_suffix) %} |
| 500 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info) | 500 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info) |
| 501 { | 501 { |
| 502 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #} | 502 {% if not method.overloads %}{# Overloaded methods are measured in overload_ resolution_method() #} |
| 503 {% if method.measure_as %} | 503 {% if method.measure_as %} |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 698 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
| 699 if method.overloads else | 699 if method.overloads else |
| 700 method.runtime_enabled_function) %} | 700 method.runtime_enabled_function) %} |
| 701 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; | 701 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; |
| 702 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, signature, {{method.name}}MethodConfiguration); | 702 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, signature, {{method.name}}MethodConfiguration); |
| 703 {% endfilter %}{# runtime_enabled() #} | 703 {% endfilter %}{# runtime_enabled() #} |
| 704 {% endfilter %}{# exposed() #} | 704 {% endfilter %}{# exposed() #} |
| 705 {% endfor %} | 705 {% endfor %} |
| 706 {% endif %} | 706 {% endif %} |
| 707 {%- endmacro %} | 707 {%- endmacro %} |
| OLD | NEW |