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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 return false; | 131 return false; |
132 | 132 |
133 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value); | 133 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value); |
134 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount); | 134 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount); |
135 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex))
; | 135 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex))
; |
136 | 136 |
137 WrapperTypeInfo* typeInfo = static_cast<WrapperTypeInfo*>(wrapper->GetAligne
dPointerFromInternalField(v8DOMWrapperTypeIndex)); | 137 WrapperTypeInfo* typeInfo = static_cast<WrapperTypeInfo*>(wrapper->GetAligne
dPointerFromInternalField(v8DOMWrapperTypeIndex)); |
138 return typeInfo == type; | 138 return typeInfo == type; |
139 } | 139 } |
140 | 140 |
141 #if ENABLE(CUSTOM_ELEMENTS) | |
142 | |
143 v8::Handle<v8::Function> V8DOMWrapper::toFunction(v8::Handle<v8::Value> object) | 141 v8::Handle<v8::Function> V8DOMWrapper::toFunction(v8::Handle<v8::Value> object) |
144 { | 142 { |
145 return V8AdaptorFunction::get(v8::Handle<v8::Object>::Cast(object)); | 143 return V8AdaptorFunction::get(v8::Handle<v8::Object>::Cast(object)); |
146 } | 144 } |
147 | 145 |
148 v8::Handle<v8::Function> V8DOMWrapper::toFunction(v8::Handle<v8::Object> object,
const AtomicString& name, v8::Isolate* isolate) | 146 v8::Handle<v8::Function> V8DOMWrapper::toFunction(v8::Handle<v8::Object> object,
const AtomicString& name, v8::Isolate* isolate) |
149 { | 147 { |
150 return V8AdaptorFunction::wrap(object, name, isolate); | 148 return V8AdaptorFunction::wrap(object, name, isolate); |
151 } | 149 } |
152 | 150 |
153 v8::Handle<v8::Object> V8DOMWrapper::fromFunction(v8::Handle<v8::Object> object) | 151 v8::Handle<v8::Object> V8DOMWrapper::fromFunction(v8::Handle<v8::Object> object) |
154 { | 152 { |
155 if (!object->IsFunction()) | 153 if (!object->IsFunction()) |
156 return object; | 154 return object; |
157 return V8AdaptorFunction::unwrap(v8::Handle<v8::Function>::Cast(object)); | 155 return V8AdaptorFunction::unwrap(v8::Handle<v8::Function>::Cast(object)); |
158 } | 156 } |
159 | 157 |
160 #endif // ENABLE(CUSTOM_ELEMENTS) | |
161 | |
162 } // namespace WebCore | 158 } // namespace WebCore |
OLD | NEW |