| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 static v8::Local<v8::Object> createWrapper(v8::Handle<v8::Object> creati
onContext, WrapperTypeInfo*, void*, v8::Isolate*); | 50 static v8::Local<v8::Object> createWrapper(v8::Handle<v8::Object> creati
onContext, WrapperTypeInfo*, void*, v8::Isolate*); |
| 51 | 51 |
| 52 template<typename T> | 52 template<typename T> |
| 53 static inline v8::Handle<v8::Object> associateObjectWithWrapper(PassRefP
tr<T>, WrapperTypeInfo*, v8::Handle<v8::Object>, v8::Isolate*, WrapperConfigurat
ion::Lifetime); | 53 static inline v8::Handle<v8::Object> associateObjectWithWrapper(PassRefP
tr<T>, WrapperTypeInfo*, v8::Handle<v8::Object>, v8::Isolate*, WrapperConfigurat
ion::Lifetime); |
| 54 static inline void setNativeInfo(v8::Handle<v8::Object>, WrapperTypeInfo
*, void*); | 54 static inline void setNativeInfo(v8::Handle<v8::Object>, WrapperTypeInfo
*, void*); |
| 55 static inline void clearNativeInfo(v8::Handle<v8::Object>, WrapperTypeIn
fo*); | 55 static inline void clearNativeInfo(v8::Handle<v8::Object>, WrapperTypeIn
fo*); |
| 56 | 56 |
| 57 static bool isDOMWrapper(v8::Handle<v8::Value>); | 57 static bool isDOMWrapper(v8::Handle<v8::Value>); |
| 58 static bool isWrapperOfType(v8::Handle<v8::Value>, WrapperTypeInfo*); | 58 static bool isWrapperOfType(v8::Handle<v8::Value>, WrapperTypeInfo*); |
| 59 | |
| 60 // Used for V8WrapAsFunction, which is used only by CUSTOM_ELEMENTS | |
| 61 static v8::Handle<v8::Function> toFunction(v8::Handle<v8::Value>); | |
| 62 static v8::Handle<v8::Function> toFunction(v8::Handle<v8::Object>, const
AtomicString& name, v8::Isolate*); | |
| 63 static v8::Handle<v8::Object> fromFunction(v8::Handle<v8::Object>); | |
| 64 }; | 59 }; |
| 65 | 60 |
| 66 inline void V8DOMWrapper::setNativeInfo(v8::Handle<v8::Object> wrapper, Wrap
perTypeInfo* type, void* object) | 61 inline void V8DOMWrapper::setNativeInfo(v8::Handle<v8::Object> wrapper, Wrap
perTypeInfo* type, void* object) |
| 67 { | 62 { |
| 68 ASSERT(wrapper->InternalFieldCount() >= 2); | 63 ASSERT(wrapper->InternalFieldCount() >= 2); |
| 69 ASSERT(object); | 64 ASSERT(object); |
| 70 ASSERT(type); | 65 ASSERT(type); |
| 71 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, objec
t); | 66 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, objec
t); |
| 72 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, type); | 67 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, type); |
| 73 } | 68 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 86 setNativeInfo(wrapper, type, object.get()); | 81 setNativeInfo(wrapper, type, object.get()); |
| 87 ASSERT(maybeDOMWrapper(wrapper)); | 82 ASSERT(maybeDOMWrapper(wrapper)); |
| 88 WrapperConfiguration configuration = buildWrapperConfiguration(object.ge
t(), lifetime); | 83 WrapperConfiguration configuration = buildWrapperConfiguration(object.ge
t(), lifetime); |
| 89 DOMDataStore::setWrapper(object.leakRef(), wrapper, isolate, configurati
on); | 84 DOMDataStore::setWrapper(object.leakRef(), wrapper, isolate, configurati
on); |
| 90 return wrapper; | 85 return wrapper; |
| 91 } | 86 } |
| 92 | 87 |
| 93 } | 88 } |
| 94 | 89 |
| 95 #endif // V8DOMWrapper_h | 90 #endif // V8DOMWrapper_h |
| OLD | NEW |