| Index: third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp
|
| index dedef60a657e733ee26ca4b42f6df5827ba2d068..8a41794e5b9cef6eb79cfb47b2eb5ddba3e76da9 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp
|
| @@ -15,104 +15,91 @@
|
|
|
| namespace blink {
|
|
|
| -TestInterface2OrUint8Array::TestInterface2OrUint8Array()
|
| - : m_type(SpecificTypeNone)
|
| -{
|
| -}
|
| +TestInterface2OrUint8Array::TestInterface2OrUint8Array() : m_type(SpecificTypeNone) {}
|
|
|
| -TestInterface2* TestInterface2OrUint8Array::getAsTestInterface2() const
|
| -{
|
| - ASSERT(isTestInterface2());
|
| - return m_testInterface2;
|
| +TestInterface2* TestInterface2OrUint8Array::getAsTestInterface2() const {
|
| + DCHECK(isTestInterface2());
|
| + return m_testInterface2;
|
| }
|
|
|
| -void TestInterface2OrUint8Array::setTestInterface2(TestInterface2* value)
|
| -{
|
| - ASSERT(isNull());
|
| - m_testInterface2 = value;
|
| - m_type = SpecificTypeTestInterface2;
|
| +void TestInterface2OrUint8Array::setTestInterface2(TestInterface2* value) {
|
| + DCHECK(isNull());
|
| + m_testInterface2 = value;
|
| + m_type = SpecificTypeTestInterface2;
|
| }
|
|
|
| -TestInterface2OrUint8Array TestInterface2OrUint8Array::fromTestInterface2(TestInterface2* value)
|
| -{
|
| - TestInterface2OrUint8Array container;
|
| - container.setTestInterface2(value);
|
| - return container;
|
| +TestInterface2OrUint8Array TestInterface2OrUint8Array::fromTestInterface2(TestInterface2* value) {
|
| + TestInterface2OrUint8Array container;
|
| + container.setTestInterface2(value);
|
| + return container;
|
| }
|
|
|
| -DOMUint8Array* TestInterface2OrUint8Array::getAsUint8Array() const
|
| -{
|
| - ASSERT(isUint8Array());
|
| - return m_uint8Array;
|
| +DOMUint8Array* TestInterface2OrUint8Array::getAsUint8Array() const {
|
| + DCHECK(isUint8Array());
|
| + return m_uint8Array;
|
| }
|
|
|
| -void TestInterface2OrUint8Array::setUint8Array(DOMUint8Array* value)
|
| -{
|
| - ASSERT(isNull());
|
| - m_uint8Array = value;
|
| - m_type = SpecificTypeUint8Array;
|
| +void TestInterface2OrUint8Array::setUint8Array(DOMUint8Array* value) {
|
| + DCHECK(isNull());
|
| + m_uint8Array = value;
|
| + m_type = SpecificTypeUint8Array;
|
| }
|
|
|
| -TestInterface2OrUint8Array TestInterface2OrUint8Array::fromUint8Array(DOMUint8Array* value)
|
| -{
|
| - TestInterface2OrUint8Array container;
|
| - container.setUint8Array(value);
|
| - return container;
|
| +TestInterface2OrUint8Array TestInterface2OrUint8Array::fromUint8Array(DOMUint8Array* value) {
|
| + TestInterface2OrUint8Array container;
|
| + container.setUint8Array(value);
|
| + return container;
|
| }
|
|
|
| TestInterface2OrUint8Array::TestInterface2OrUint8Array(const TestInterface2OrUint8Array&) = default;
|
| TestInterface2OrUint8Array::~TestInterface2OrUint8Array() = default;
|
| TestInterface2OrUint8Array& TestInterface2OrUint8Array::operator=(const TestInterface2OrUint8Array&) = default;
|
|
|
| -DEFINE_TRACE(TestInterface2OrUint8Array)
|
| -{
|
| - visitor->trace(m_testInterface2);
|
| - visitor->trace(m_uint8Array);
|
| +DEFINE_TRACE(TestInterface2OrUint8Array) {
|
| + visitor->trace(m_testInterface2);
|
| + visitor->trace(m_uint8Array);
|
| }
|
|
|
| -void V8TestInterface2OrUint8Array::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, TestInterface2OrUint8Array& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState)
|
| -{
|
| - if (v8Value.IsEmpty())
|
| - return;
|
| +void V8TestInterface2OrUint8Array::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, TestInterface2OrUint8Array& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState) {
|
| + if (v8Value.IsEmpty())
|
| + return;
|
|
|
| - if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
|
| - return;
|
| + if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
|
| + return;
|
|
|
| - if (V8TestInterface2::hasInstance(v8Value, isolate)) {
|
| - TestInterface2* cppValue = V8TestInterface2::toImpl(v8::Local<v8::Object>::Cast(v8Value));
|
| - impl.setTestInterface2(cppValue);
|
| - return;
|
| - }
|
| + if (V8TestInterface2::hasInstance(v8Value, isolate)) {
|
| + TestInterface2* cppValue = V8TestInterface2::toImpl(v8::Local<v8::Object>::Cast(v8Value));
|
| + impl.setTestInterface2(cppValue);
|
| + return;
|
| + }
|
|
|
| - if (v8Value->IsUint8Array()) {
|
| - DOMUint8Array* cppValue = V8Uint8Array::toImpl(v8::Local<v8::Object>::Cast(v8Value));
|
| - impl.setUint8Array(cppValue);
|
| - return;
|
| - }
|
| + if (v8Value->IsUint8Array()) {
|
| + DOMUint8Array* cppValue = V8Uint8Array::toImpl(v8::Local<v8::Object>::Cast(v8Value));
|
| + impl.setUint8Array(cppValue);
|
| + return;
|
| + }
|
|
|
| - exceptionState.throwTypeError("The provided value is not of type '(TestInterface2 or Uint8Array)'");
|
| + exceptionState.throwTypeError("The provided value is not of type '(TestInterface2 or Uint8Array)'");
|
| }
|
|
|
| -v8::Local<v8::Value> toV8(const TestInterface2OrUint8Array& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
|
| -{
|
| - switch (impl.m_type) {
|
| +v8::Local<v8::Value> toV8(const TestInterface2OrUint8Array& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
|
| + switch (impl.m_type) {
|
| case TestInterface2OrUint8Array::SpecificTypeNone:
|
| - return v8::Null(isolate);
|
| + return v8::Null(isolate);
|
| case TestInterface2OrUint8Array::SpecificTypeTestInterface2:
|
| - return toV8(impl.getAsTestInterface2(), creationContext, isolate);
|
| + return toV8(impl.getAsTestInterface2(), creationContext, isolate);
|
| case TestInterface2OrUint8Array::SpecificTypeUint8Array:
|
| - return toV8(impl.getAsUint8Array(), creationContext, isolate);
|
| + return toV8(impl.getAsUint8Array(), creationContext, isolate);
|
| default:
|
| - ASSERT_NOT_REACHED();
|
| - }
|
| - return v8::Local<v8::Value>();
|
| + NOTREACHED();
|
| + }
|
| + return v8::Local<v8::Value>();
|
| }
|
|
|
| -TestInterface2OrUint8Array NativeValueTraits<TestInterface2OrUint8Array>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState)
|
| -{
|
| - TestInterface2OrUint8Array impl;
|
| - V8TestInterface2OrUint8Array::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
|
| - return impl;
|
| +TestInterface2OrUint8Array NativeValueTraits<TestInterface2OrUint8Array>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
|
| + TestInterface2OrUint8Array impl;
|
| + V8TestInterface2OrUint8Array::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
|
| + return impl;
|
| }
|
|
|
| -} // namespace blink
|
| +} // namespace blink
|
|
|