| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 348 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 349 return handleScope.Escape(templ); | 349 return handleScope.Escape(templ); |
| 350 } | 350 } |
| 351 | 351 |
| 352 bool V8TestInterfaceNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate
* isolate) | 352 bool V8TestInterfaceNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate
* isolate) |
| 353 { | 353 { |
| 354 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) | 354 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 355 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); | 355 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 356 } | 356 } |
| 357 | 357 |
| 358 TestInterfaceNode* V8TestInterfaceNode::toNativeWithTypeCheck(v8::Isolate* isola
te, v8::Handle<v8::Value> value) |
| 359 { |
| 360 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
| 361 } |
| 362 |
| 358 EventTarget* V8TestInterfaceNode::toEventTarget(v8::Handle<v8::Object> object) | 363 EventTarget* V8TestInterfaceNode::toEventTarget(v8::Handle<v8::Object> object) |
| 359 { | 364 { |
| 360 return toNative(object); | 365 return toNative(object); |
| 361 } | 366 } |
| 362 | 367 |
| 363 v8::Handle<v8::Object> V8TestInterfaceNode::createWrapper(PassRefPtr<TestInterfa
ceNode> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 368 v8::Handle<v8::Object> V8TestInterfaceNode::createWrapper(PassRefPtr<TestInterfa
ceNode> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 364 { | 369 { |
| 365 ASSERT(impl); | 370 ASSERT(impl); |
| 366 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNode>(impl.get(), isola
te)); | 371 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNode>(impl.get(), isola
te)); |
| 367 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 372 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 385 fromInternalPointer(object)->deref(); | 390 fromInternalPointer(object)->deref(); |
| 386 } | 391 } |
| 387 | 392 |
| 388 template<> | 393 template<> |
| 389 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 394 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
| 390 { | 395 { |
| 391 return toV8(impl, creationContext, isolate); | 396 return toV8(impl, creationContext, isolate); |
| 392 } | 397 } |
| 393 | 398 |
| 394 } // namespace WebCore | 399 } // namespace WebCore |
| OLD | NEW |