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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/methods.cpp

Issue 1423513005: Reland of: Make Imagebitmap Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix vector pre-allocation issue Created 5 years, 1 month 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
OLDNEW
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v 8::FunctionCallbackInfo<v8::Value>& info) 451 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v 8::FunctionCallbackInfo<v8::Value>& info)
452 { 452 {
453 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage ", interfaceName, info.Holder(), info.GetIsolate()); 453 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage ", interfaceName, info.Holder(), info.GetIsolate());
454 if (UNLIKELY(info.Length() < 1)) { 454 if (UNLIKELY(info.Length() < 1)) {
455 setMinimumArityTypeError(exceptionState, 1, info.Length()); 455 setMinimumArityTypeError(exceptionState, 1, info.Length());
456 exceptionState.throwIfNeeded(); 456 exceptionState.throwIfNeeded();
457 return; 457 return;
458 } 458 }
459 OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessageP ortArray); 459 OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessageP ortArray);
460 ArrayBufferArray arrayBuffers; 460 ArrayBufferArray arrayBuffers;
461 ImageBitmapArray imageBitmaps;
461 if (info.Length() > 1) { 462 if (info.Length() > 1) {
462 const int transferablesArgIndex = 1; 463 const int transferablesArgIndex = 1;
463 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info [transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, exceptionS tate)) { 464 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info [transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, imageBitma ps, exceptionState)) {
464 exceptionState.throwIfNeeded(); 465 exceptionState.throwIfNeeded();
465 return; 466 return;
466 } 467 }
467 } 468 }
468 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, exceptionSta te); 469 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, &imageBitmap s, exceptionState);
469 if (exceptionState.throwIfNeeded()) 470 if (exceptionState.throwIfNeeded())
470 return; 471 return;
471 // FIXME: Only pass context/exceptionState if instance really requires it. 472 // FIXME: Only pass context/exceptionState if instance really requires it.
472 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); 473 ExecutionContext* context = currentExecutionContext(info.GetIsolate());
473 instance->postMessage(context, message.release(), ports.get(), exceptionStat e); 474 instance->postMessage(context, message.release(), ports.get(), exceptionStat e);
474 exceptionState.throwIfNeeded(); 475 exceptionState.throwIfNeeded();
475 } 476 }
476 {% endmacro %} 477 {% endmacro %}
477 478
478 {##############################################################################} 479 {##############################################################################}
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 685 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
685 if method.overloads else 686 if method.overloads else
686 method.runtime_enabled_function) %} 687 method.runtime_enabled_function) %}
687 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 688 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
688 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); 689 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration);
689 {% endfilter %}{# runtime_enabled() #} 690 {% endfilter %}{# runtime_enabled() #}
690 {% endfilter %}{# exposed() #} 691 {% endfilter %}{# exposed() #}
691 {% endfor %} 692 {% endfor %}
692 {% endif %} 693 {% endif %}
693 {%- endmacro %} 694 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698