| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 return result->value.newLocal(isolate); | 469 return result->value.newLocal(isolate); |
| 470 | 470 |
| 471 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 471 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 472 v8::EscapableHandleScope handleScope(isolate); | 472 v8::EscapableHandleScope handleScope(isolate); |
| 473 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 473 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 474 configureV8TestTypedefsTemplate(templ, isolate, currentWorldType); | 474 configureV8TestTypedefsTemplate(templ, isolate, currentWorldType); |
| 475 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 475 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 476 return handleScope.Escape(templ); | 476 return handleScope.Escape(templ); |
| 477 } | 477 } |
| 478 | 478 |
| 479 bool V8TestTypedefs::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* iso
late, WrapperWorldType currentWorldType) | 479 bool V8TestTypedefs::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* iso
late) |
| 480 { | 480 { |
| 481 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 481 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 482 } | 482 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 483 | |
| 484 bool V8TestTypedefs::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Is
olate* isolate) | |
| 485 { | |
| 486 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 487 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 488 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 489 } | 483 } |
| 490 | 484 |
| 491 v8::Handle<v8::Object> V8TestTypedefs::createWrapper(PassRefPtr<TestTypedefs> im
pl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 485 v8::Handle<v8::Object> V8TestTypedefs::createWrapper(PassRefPtr<TestTypedefs> im
pl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 492 { | 486 { |
| 493 ASSERT(impl); | 487 ASSERT(impl); |
| 494 ASSERT(!DOMDataStore::containsWrapper<V8TestTypedefs>(impl.get(), isolate)); | 488 ASSERT(!DOMDataStore::containsWrapper<V8TestTypedefs>(impl.get(), isolate)); |
| 495 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 489 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 496 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 490 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 497 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 491 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 498 // the same object de-ref functions, though, so use that as the basis of
the check. | 492 // the same object de-ref functions, though, so use that as the basis of
the check. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 513 fromInternalPointer(object)->deref(); | 507 fromInternalPointer(object)->deref(); |
| 514 } | 508 } |
| 515 | 509 |
| 516 template<> | 510 template<> |
| 517 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 511 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
| 518 { | 512 { |
| 519 return toV8(impl, creationContext, isolate); | 513 return toV8(impl, creationContext, isolate); |
| 520 } | 514 } |
| 521 | 515 |
| 522 } // namespace WebCore | 516 } // namespace WebCore |
| OLD | NEW |