OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 TestInterfaceDocument* impl = V8TestInterfaceDocument::toImpl(holder); | 63 TestInterfaceDocument* impl = V8TestInterfaceDocument::toImpl(holder); |
64 | 64 |
65 V8SetReturnValueFast(info, WTF::GetPtr(impl->location()), impl); | 65 V8SetReturnValueFast(info, WTF::GetPtr(impl->location()), impl); |
66 } | 66 } |
67 | 67 |
68 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func
tionCallbackInfo<v8::Value>& info) { | 68 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func
tionCallbackInfo<v8::Value>& info) { |
69 v8::Isolate* isolate = info.GetIsolate(); | 69 v8::Isolate* isolate = info.GetIsolate(); |
70 ALLOW_UNUSED_LOCAL(isolate); | 70 ALLOW_UNUSED_LOCAL(isolate); |
71 | 71 |
72 v8::Local<v8::Object> holder = info.Holder(); | 72 ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestIn
terfaceDocument", "location"); |
73 TestInterfaceDocument* proxyImpl = V8TestInterfaceDocument::toImpl(holder); | 73 v8::Local<v8::Value> target; |
74 Location* impl = WTF::GetPtr(proxyImpl->location()); | 74 if (!info.Holder()->Get(info.GetIsolate()->GetCurrentContext(), V8String(info.
GetIsolate(), "location")).ToLocal(&target)) |
75 if (!impl) | |
76 return; | 75 return; |
77 | 76 if (!target->IsObject()) { |
78 ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestIn
terfaceDocument", "location"); | 77 exceptionState.ThrowTypeError("The attribute value is not an object"); |
79 | |
80 // Prepare the value to be set. | |
81 V8StringResource<> cppValue = v8Value; | |
82 if (!cppValue.Prepare()) | |
83 return; | 78 return; |
84 | 79 } |
85 impl->setHref(CurrentDOMWindow(info.GetIsolate()), EnteredDOMWindow(info.GetIs
olate()), cppValue, exceptionState); | 80 target.As<v8::Object>()->Set(info.GetIsolate()->GetCurrentContext(), V8String(
info.GetIsolate(), "href"), v8Value).IsNothing(); |
86 } | 81 } |
87 | 82 |
88 } // namespace TestInterfaceDocumentV8Internal | 83 } // namespace TestInterfaceDocumentV8Internal |
89 | 84 |
90 void V8TestInterfaceDocument::locationAttributeGetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { | 85 void V8TestInterfaceDocument::locationAttributeGetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { |
91 TestInterfaceDocumentV8Internal::locationAttributeGetter(info); | 86 TestInterfaceDocumentV8Internal::locationAttributeGetter(info); |
92 } | 87 } |
93 | 88 |
94 void V8TestInterfaceDocument::locationAttributeSetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { | 89 void V8TestInterfaceDocument::locationAttributeSetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { |
95 v8::Local<v8::Value> v8Value = info[0]; | 90 v8::Local<v8::Value> v8Value = info[0]; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 TestInterfaceDocument* NativeValueTraits<TestInterfaceDocument>::NativeValue(v8:
:Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { | 130 TestInterfaceDocument* NativeValueTraits<TestInterfaceDocument>::NativeValue(v8:
:Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
136 TestInterfaceDocument* nativeValue = V8TestInterfaceDocument::toImplWithTypeCh
eck(isolate, value); | 131 TestInterfaceDocument* nativeValue = V8TestInterfaceDocument::toImplWithTypeCh
eck(isolate, value); |
137 if (!nativeValue) { | 132 if (!nativeValue) { |
138 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( | 133 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( |
139 "TestInterfaceDocument")); | 134 "TestInterfaceDocument")); |
140 } | 135 } |
141 return nativeValue; | 136 return nativeValue; |
142 } | 137 } |
143 | 138 |
144 } // namespace blink | 139 } // namespace blink |
OLD | NEW |