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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 v8::Local<v8::Object> holder = info.Holder(); |
73 TestInterfaceDocument* proxyImpl = V8TestInterfaceDocument::toImpl(holder); | 73 ALLOW_UNUSED_LOCAL(holder); |
74 Location* impl = WTF::GetPtr(proxyImpl->location()); | 74 |
75 if (!impl) | 75 // [PutForwards] => location.href |
| 76 ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestIn
terfaceDocument", "location"); |
| 77 v8::Local<v8::Value> target; |
| 78 if (!holder->Get(isolate->GetCurrentContext(), V8String(isolate, "location")).
ToLocal(&target)) |
76 return; | 79 return; |
77 | 80 if (!target->IsObject()) { |
78 ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestIn
terfaceDocument", "location"); | 81 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; | 82 return; |
84 | 83 } |
85 impl->setHref(CurrentDOMWindow(info.GetIsolate()), EnteredDOMWindow(info.GetIs
olate()), cppValue, exceptionState); | 84 bool result; |
| 85 if (!target.As<v8::Object>()->Set(isolate->GetCurrentContext(), V8String(isola
te, "href"), v8Value).To(&result)) |
| 86 return; |
| 87 if (!result) |
| 88 return; |
86 } | 89 } |
87 | 90 |
88 } // namespace TestInterfaceDocumentV8Internal | 91 } // namespace TestInterfaceDocumentV8Internal |
89 | 92 |
90 void V8TestInterfaceDocument::locationAttributeGetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { | 93 void V8TestInterfaceDocument::locationAttributeGetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { |
91 TestInterfaceDocumentV8Internal::locationAttributeGetter(info); | 94 TestInterfaceDocumentV8Internal::locationAttributeGetter(info); |
92 } | 95 } |
93 | 96 |
94 void V8TestInterfaceDocument::locationAttributeSetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { | 97 void V8TestInterfaceDocument::locationAttributeSetterCallback(const v8::Function
CallbackInfo<v8::Value>& info) { |
95 v8::Local<v8::Value> v8Value = info[0]; | 98 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) { | 138 TestInterfaceDocument* NativeValueTraits<TestInterfaceDocument>::NativeValue(v8:
:Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
136 TestInterfaceDocument* nativeValue = V8TestInterfaceDocument::toImplWithTypeCh
eck(isolate, value); | 139 TestInterfaceDocument* nativeValue = V8TestInterfaceDocument::toImplWithTypeCh
eck(isolate, value); |
137 if (!nativeValue) { | 140 if (!nativeValue) { |
138 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( | 141 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( |
139 "TestInterfaceDocument")); | 142 "TestInterfaceDocument")); |
140 } | 143 } |
141 return nativeValue; | 144 return nativeValue; |
142 } | 145 } |
143 | 146 |
144 } // namespace blink | 147 } // namespace blink |
OLD | NEW |