| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 167 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 168 { | 168 { |
| 169 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 169 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 170 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info); | 170 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info); |
| 171 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 171 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 172 } | 172 } |
| 173 | 173 |
| 174 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 174 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
| 175 { | 175 { |
| 176 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 176 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 177 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 177 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 178 TestImplements::setImplementsNodeAttribute(imp, WTF::getPtr(cppValue)); | 178 TestImplements::setImplementsNodeAttribute(imp, WTF::getPtr(cppValue)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 181 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 182 { | 182 { |
| 183 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 183 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 184 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(jsValue, inf
o); | 184 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(jsValue, inf
o); |
| 185 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 185 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 186 } | 186 } |
| 187 | 187 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 222 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 223 { | 223 { |
| 224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 225 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette
r(info); | 225 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette
r(info); |
| 226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 227 } | 227 } |
| 228 | 228 |
| 229 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 229 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 230 { | 230 { |
| 231 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 231 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 232 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 232 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 233 TestImplements::setImplementsRuntimeEnabledNodeAttribute(imp, WTF::getPtr(cp
pValue)); | 233 TestImplements::setImplementsRuntimeEnabledNodeAttribute(imp, WTF::getPtr(cp
pValue)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) | 236 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc
al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi
d>& info) |
| 237 { | 237 { |
| 238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 239 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette
r(jsValue, info); | 239 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette
r(jsValue, info); |
| 240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 241 } | 241 } |
| 242 | 242 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 355 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 356 TestInterfaceV8Internal::supplementalNodeAttributeGetter(info); | 356 TestInterfaceV8Internal::supplementalNodeAttributeGetter(info); |
| 357 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 357 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 358 } | 358 } |
| 359 #endif // ENABLE(CONDITION_PARTIAL) | 359 #endif // ENABLE(CONDITION_PARTIAL) |
| 360 | 360 |
| 361 #if ENABLE(CONDITION_PARTIAL) | 361 #if ENABLE(CONDITION_PARTIAL) |
| 362 static void supplementalNodeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 362 static void supplementalNodeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
| 363 { | 363 { |
| 364 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 364 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 365 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 365 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 366 TestPartialInterface::setSupplementalNode(imp, WTF::getPtr(cppValue)); | 366 TestPartialInterface::setSupplementalNode(imp, WTF::getPtr(cppValue)); |
| 367 } | 367 } |
| 368 #endif // ENABLE(CONDITION_PARTIAL) | 368 #endif // ENABLE(CONDITION_PARTIAL) |
| 369 | 369 |
| 370 #if ENABLE(CONDITION_PARTIAL) | 370 #if ENABLE(CONDITION_PARTIAL) |
| 371 static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 371 static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 372 { | 372 { |
| 373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 374 TestInterfaceV8Internal::supplementalNodeAttributeSetter(jsValue, info); | 374 TestInterfaceV8Internal::supplementalNodeAttributeSetter(jsValue, info); |
| 375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 391 TestInterfaceV8Internal::Node13AttributeGetter(info); | 391 TestInterfaceV8Internal::Node13AttributeGetter(info); |
| 392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 393 } | 393 } |
| 394 #endif // ENABLE(CONDITION_PARTIAL) | 394 #endif // ENABLE(CONDITION_PARTIAL) |
| 395 | 395 |
| 396 #if ENABLE(CONDITION_PARTIAL) | 396 #if ENABLE(CONDITION_PARTIAL) |
| 397 static void Node13AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | 397 static void Node13AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) |
| 398 { | 398 { |
| 399 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 399 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 400 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 400 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 401 TestPartialInterface::setNode13(imp, WTF::getPtr(cppValue)); | 401 TestPartialInterface::setNode13(imp, WTF::getPtr(cppValue)); |
| 402 } | 402 } |
| 403 #endif // ENABLE(CONDITION_PARTIAL) | 403 #endif // ENABLE(CONDITION_PARTIAL) |
| 404 | 404 |
| 405 #if ENABLE(CONDITION_PARTIAL) | 405 #if ENABLE(CONDITION_PARTIAL) |
| 406 static void Node13AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 406 static void Node13AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 407 { | 407 { |
| 408 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 408 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 409 TestInterfaceV8Internal::Node13AttributeSetter(jsValue, info); | 409 TestInterfaceV8Internal::Node13AttributeSetter(jsValue, info); |
| 410 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 410 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 425 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 425 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 426 TestInterfaceV8Internal::Node14AttributeGetter(info); | 426 TestInterfaceV8Internal::Node14AttributeGetter(info); |
| 427 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 427 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 428 } | 428 } |
| 429 #endif // ENABLE(CONDITION_PARTIAL) | 429 #endif // ENABLE(CONDITION_PARTIAL) |
| 430 | 430 |
| 431 #if ENABLE(CONDITION_PARTIAL) | 431 #if ENABLE(CONDITION_PARTIAL) |
| 432 static void Node14AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | 432 static void Node14AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) |
| 433 { | 433 { |
| 434 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 434 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 435 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 435 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 436 TestPartialInterface::setNode14(imp, WTF::getPtr(cppValue)); | 436 TestPartialInterface::setNode14(imp, WTF::getPtr(cppValue)); |
| 437 } | 437 } |
| 438 #endif // ENABLE(CONDITION_PARTIAL) | 438 #endif // ENABLE(CONDITION_PARTIAL) |
| 439 | 439 |
| 440 #if ENABLE(CONDITION_PARTIAL) | 440 #if ENABLE(CONDITION_PARTIAL) |
| 441 static void Node14AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 441 static void Node14AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 442 { | 442 { |
| 443 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 443 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 444 TestInterfaceV8Internal::Node14AttributeSetter(jsValue, info); | 444 TestInterfaceV8Internal::Node14AttributeSetter(jsValue, info); |
| 445 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 445 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 460 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 460 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 461 TestInterfaceV8Internal::Node15AttributeGetter(info); | 461 TestInterfaceV8Internal::Node15AttributeGetter(info); |
| 462 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 462 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 463 } | 463 } |
| 464 #endif // ENABLE(CONDITION_PARTIAL) | 464 #endif // ENABLE(CONDITION_PARTIAL) |
| 465 | 465 |
| 466 #if ENABLE(CONDITION_PARTIAL) | 466 #if ENABLE(CONDITION_PARTIAL) |
| 467 static void Node15AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) | 467 static void Node15AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper
tyCallbackInfo<void>& info) |
| 468 { | 468 { |
| 469 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 469 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 470 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Ca
st(jsValue)) : 0); | 470 V8TRYCATCH_VOID(Node*, cppValue, V8Node::hasInstance(jsValue, info.GetIsolat
e()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 471 TestPartialInterface::setNode15(imp, WTF::getPtr(cppValue)); | 471 TestPartialInterface::setNode15(imp, WTF::getPtr(cppValue)); |
| 472 } | 472 } |
| 473 #endif // ENABLE(CONDITION_PARTIAL) | 473 #endif // ENABLE(CONDITION_PARTIAL) |
| 474 | 474 |
| 475 #if ENABLE(CONDITION_PARTIAL) | 475 #if ENABLE(CONDITION_PARTIAL) |
| 476 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 476 static void Node15AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 477 { | 477 { |
| 478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 479 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); | 479 TestInterfaceV8Internal::Node15AttributeSetter(jsValue, info); |
| 480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 497 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 497 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 498 { | 498 { |
| 499 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); | 499 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); |
| 500 if (UNLIKELY(info.Length() < 2)) { | 500 if (UNLIKELY(info.Length() < 2)) { |
| 501 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 501 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 502 exceptionState.throwIfNeeded(); | 502 exceptionState.throwIfNeeded(); |
| 503 return; | 503 return; |
| 504 } | 504 } |
| 505 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 505 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 506 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 506 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 507 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8
TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0); | 507 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::hasInstance(info[1], info.GetIsolate()) ? V8TestInterfaceEmpty::toNative(v
8::Handle<v8::Object>::Cast(info[1])) : 0); |
| 508 ExecutionContext* scriptContext = getExecutionContext(); | 508 ExecutionContext* scriptContext = getExecutionContext(); |
| 509 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(
scriptContext, imp, strArg, testInterfaceEmptyArg, exceptionState); | 509 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(
scriptContext, imp, strArg, testInterfaceEmptyArg, exceptionState); |
| 510 if (exceptionState.throwIfNeeded()) | 510 if (exceptionState.throwIfNeeded()) |
| 511 return; | 511 return; |
| 512 v8SetReturnValue(info, result.release()); | 512 v8SetReturnValue(info, result.release()); |
| 513 } | 513 } |
| 514 | 514 |
| 515 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 515 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 516 { | 516 { |
| 517 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 517 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 559 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 560 { | 560 { |
| 561 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); | 561 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
| 562 if (UNLIKELY(info.Length() < 2)) { | 562 if (UNLIKELY(info.Length() < 2)) { |
| 563 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 563 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 564 exceptionState.throwIfNeeded(); | 564 exceptionState.throwIfNeeded(); |
| 565 return; | 565 return; |
| 566 } | 566 } |
| 567 TestInterface* imp = V8TestInterface::toNative(info.Holder()); | 567 TestInterface* imp = V8TestInterface::toNative(info.Holder()); |
| 568 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 568 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 569 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 569 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0)
; |
| 570 ExecutionContext* scriptContext = getExecutionContext(); | 570 ExecutionContext* scriptContext = getExecutionContext(); |
| 571 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); | 571 RefPtr<TestObj> result = TestPartialInterface::supplementalMethod2(scriptCon
text, imp, strArg, objArg, exceptionState); |
| 572 if (exceptionState.throwIfNeeded()) | 572 if (exceptionState.throwIfNeeded()) |
| 573 return; | 573 return; |
| 574 v8SetReturnValue(info, result.release()); | 574 v8SetReturnValue(info, result.release()); |
| 575 } | 575 } |
| 576 #endif // ENABLE(CONDITION_PARTIAL) | 576 #endif // ENABLE(CONDITION_PARTIAL) |
| 577 | 577 |
| 578 #if ENABLE(CONDITION_PARTIAL) | 578 #if ENABLE(CONDITION_PARTIAL) |
| 579 static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 579 static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 return result->value.newLocal(isolate); | 840 return result->value.newLocal(isolate); |
| 841 | 841 |
| 842 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 842 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 843 v8::EscapableHandleScope handleScope(isolate); | 843 v8::EscapableHandleScope handleScope(isolate); |
| 844 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 844 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 845 configureV8TestInterfaceTemplate(templ, isolate, currentWorldType); | 845 configureV8TestInterfaceTemplate(templ, isolate, currentWorldType); |
| 846 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 846 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 847 return handleScope.Escape(templ); | 847 return handleScope.Escape(templ); |
| 848 } | 848 } |
| 849 | 849 |
| 850 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate, WrapperWorldType currentWorldType) | 850 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate) |
| 851 { | 851 { |
| 852 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 852 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 853 } | 853 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 854 | |
| 855 bool V8TestInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) | |
| 856 { | |
| 857 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 858 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 859 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 860 } | 854 } |
| 861 | 855 |
| 862 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterface* impl, v8::Isolate* isolate) | 856 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterface* impl, v8::Isolate* isolate) |
| 863 { | 857 { |
| 864 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 858 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
| 865 if (ContextFeatures::condition14Enabled(impl->document())) { | 859 if (ContextFeatures::condition14Enabled(impl->document())) { |
| 866 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 860 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 867 {"Node14", TestInterfaceV8Internal::Node14AttributeGetterCallback, TestI
nterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 861 {"Node14", TestInterfaceV8Internal::Node14AttributeGetterCallback, TestI
nterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
| 868 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 862 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
| 869 } | 863 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 } | 899 } |
| 906 | 900 |
| 907 template<> | 901 template<> |
| 908 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 902 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 909 { | 903 { |
| 910 return toV8(impl, creationContext, isolate); | 904 return toV8(impl, creationContext, isolate); |
| 911 } | 905 } |
| 912 | 906 |
| 913 } // namespace WebCore | 907 } // namespace WebCore |
| 914 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 908 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| OLD | NEW |