OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 v8::PropertyAttribute attribute; | 69 v8::PropertyAttribute attribute; |
70 }; | 70 }; |
71 | 71 |
72 static void installAttributes(v8::Handle<v8::ObjectTemplate>, v8::Handle<v8:
:ObjectTemplate>, const AttributeConfiguration*, size_t attributeCount, v8::Isol
ate*); | 72 static void installAttributes(v8::Handle<v8::ObjectTemplate>, v8::Handle<v8:
:ObjectTemplate>, const AttributeConfiguration*, size_t attributeCount, v8::Isol
ate*); |
73 | 73 |
74 template<class ObjectOrTemplate> | 74 template<class ObjectOrTemplate> |
75 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem
plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att
ribute, v8::Isolate* isolate) | 75 static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTem
plate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& att
ribute, v8::Isolate* isolate) |
76 { | 76 { |
77 v8::AccessorGetterCallback getter = attribute.getter; | 77 v8::AccessorGetterCallback getter = attribute.getter; |
78 v8::AccessorSetterCallback setter = attribute.setter; | 78 v8::AccessorSetterCallback setter = attribute.setter; |
79 if (DOMWrapperWorld::current(isolate)->isMainWorld()) { | 79 if (DOMWrapperWorld::current(isolate).isMainWorld()) { |
80 if (attribute.getterForMainWorld) | 80 if (attribute.getterForMainWorld) |
81 getter = attribute.getterForMainWorld; | 81 getter = attribute.getterForMainWorld; |
82 if (attribute.setterForMainWorld) | 82 if (attribute.setterForMainWorld) |
83 setter = attribute.setterForMainWorld; | 83 setter = attribute.setterForMainWorld; |
84 } | 84 } |
85 (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::
String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString), | 85 (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::
String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString), |
86 getter, | 86 getter, |
87 setter, | 87 setter, |
88 v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.da
ta)), | 88 v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.da
ta)), |
89 attribute.settings, | 89 attribute.settings, |
(...skipping 26 matching lines...) Expand all Loading... |
116 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Handle<v8::Funct
ionTemplate>, const char* interfaceName, v8::Handle<v8::FunctionTemplate> parent
Class, size_t fieldCount, | 116 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Handle<v8::Funct
ionTemplate>, const char* interfaceName, v8::Handle<v8::FunctionTemplate> parent
Class, size_t fieldCount, |
117 const AttributeConfiguration*, size_t attributeCount, | 117 const AttributeConfiguration*, size_t attributeCount, |
118 const AccessorConfiguration*, size_t accessorCount, | 118 const AccessorConfiguration*, size_t accessorCount, |
119 const MethodConfiguration*, size_t callbackCount, | 119 const MethodConfiguration*, size_t callbackCount, |
120 v8::Isolate*); | 120 v8::Isolate*); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace WebCore | 123 } // namespace WebCore |
124 | 124 |
125 #endif // V8DOMConfiguration_h | 125 #endif // V8DOMConfiguration_h |
OLD | NEW |