| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 190 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 191 return handleScope.Escape(templ); | 191 return handleScope.Escape(templ); |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool V8TestInterfaceNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) | 194 bool V8TestInterfaceNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) |
| 195 { | 195 { |
| 196 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) | 196 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 197 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); | 197 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 198 } | 198 } |
| 199 | 199 |
| 200 TestInterfaceNamedConstructor* V8TestInterfaceNamedConstructor::toNativeWithType
Check(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
| 201 { |
| 202 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
| 203 } |
| 204 |
| 200 ActiveDOMObject* V8TestInterfaceNamedConstructor::toActiveDOMObject(v8::Handle<v
8::Object> wrapper) | 205 ActiveDOMObject* V8TestInterfaceNamedConstructor::toActiveDOMObject(v8::Handle<v
8::Object> wrapper) |
| 201 { | 206 { |
| 202 return toNative(wrapper); | 207 return toNative(wrapper); |
| 203 } | 208 } |
| 204 | 209 |
| 205 v8::Handle<v8::Object> V8TestInterfaceNamedConstructor::createWrapper(PassRefPtr
<TestInterfaceNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8
::Isolate* isolate) | 210 v8::Handle<v8::Object> V8TestInterfaceNamedConstructor::createWrapper(PassRefPtr
<TestInterfaceNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8
::Isolate* isolate) |
| 206 { | 211 { |
| 207 ASSERT(impl); | 212 ASSERT(impl); |
| 208 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNamedConstructor>(impl.
get(), isolate)); | 213 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNamedConstructor>(impl.
get(), isolate)); |
| 209 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 214 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 227 fromInternalPointer(object)->deref(); | 232 fromInternalPointer(object)->deref(); |
| 228 } | 233 } |
| 229 | 234 |
| 230 template<> | 235 template<> |
| 231 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 236 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) |
| 232 { | 237 { |
| 233 return toV8(impl, creationContext, isolate); | 238 return toV8(impl, creationContext, isolate); |
| 234 } | 239 } |
| 235 | 240 |
| 236 } // namespace WebCore | 241 } // namespace WebCore |
| OLD | NEW |