| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 220 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 221 return handleScope.Escape(templ); | 221 return handleScope.Escape(templ); |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate
) | 224 bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate
) |
| 225 { | 225 { |
| 226 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) | 226 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 227 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); | 227 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 228 } | 228 } |
| 229 | 229 |
| 230 TestNode* V8TestNode::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8:
:Value> value) |
| 231 { |
| 232 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
| 233 } |
| 234 |
| 230 EventTarget* V8TestNode::toEventTarget(v8::Handle<v8::Object> object) | 235 EventTarget* V8TestNode::toEventTarget(v8::Handle<v8::Object> object) |
| 231 { | 236 { |
| 232 return toNative(object); | 237 return toNative(object); |
| 233 } | 238 } |
| 234 | 239 |
| 235 v8::Handle<v8::Object> V8TestNode::createWrapper(PassRefPtr<TestNode> impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | 240 v8::Handle<v8::Object> V8TestNode::createWrapper(PassRefPtr<TestNode> impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 236 { | 241 { |
| 237 ASSERT(impl); | 242 ASSERT(impl); |
| 238 ASSERT(!DOMDataStore::containsWrapper<V8TestNode>(impl.get(), isolate)); | 243 ASSERT(!DOMDataStore::containsWrapper<V8TestNode>(impl.get(), isolate)); |
| 239 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 244 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 257 fromInternalPointer(object)->deref(); | 262 fromInternalPointer(object)->deref(); |
| 258 } | 263 } |
| 259 | 264 |
| 260 template<> | 265 template<> |
| 261 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | 266 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) |
| 262 { | 267 { |
| 263 return toV8(impl, creationContext, isolate); | 268 return toV8(impl, creationContext, isolate); |
| 264 } | 269 } |
| 265 | 270 |
| 266 } // namespace WebCore | 271 } // namespace WebCore |
| OLD | NEW |