| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 OnInstance = 1 << 0, | 56 OnInstance = 1 << 0, |
| 57 OnPrototype = 1 << 1, | 57 OnPrototype = 1 << 1, |
| 58 OnInterface = 1 << 2, | 58 OnInterface = 1 << 2, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 enum HolderCheckConfiguration { | 61 enum HolderCheckConfiguration { |
| 62 CheckHolder, | 62 CheckHolder, |
| 63 DoNotCheckHolder, | 63 DoNotCheckHolder, |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 typedef v8::Local<v8::Private> (*CachedAccessorCallback)(v8::Isolate*); |
| 67 |
| 66 // AttributeConfiguration translates into calls to SetNativeDataProperty() on | 68 // AttributeConfiguration translates into calls to SetNativeDataProperty() on |
| 67 // either the instance or the prototype ObjectTemplate, based on | 69 // either the instance or the prototype ObjectTemplate, based on |
| 68 // |instanceOrPrototypeConfiguration|. | 70 // |instanceOrPrototypeConfiguration|. |
| 69 struct AttributeConfiguration { | 71 struct AttributeConfiguration { |
| 70 AttributeConfiguration& operator=(const AttributeConfiguration&) = delete; | 72 AttributeConfiguration& operator=(const AttributeConfiguration&) = delete; |
| 71 DISALLOW_NEW(); | 73 DISALLOW_NEW(); |
| 72 const char* const name; | 74 const char* const name; |
| 73 v8::AccessorNameGetterCallback getter; | 75 v8::AccessorNameGetterCallback getter; |
| 74 v8::AccessorNameSetterCallback setter; | 76 v8::AccessorNameSetterCallback setter; |
| 75 v8::AccessorNameGetterCallback getterForMainWorld; | 77 v8::AccessorNameGetterCallback getterForMainWorld; |
| 76 v8::AccessorNameSetterCallback setterForMainWorld; | 78 v8::AccessorNameSetterCallback setterForMainWorld; |
| 79 // TODO(vogelheim): This has to be removed too since it's only used in |
| 80 // accessors. |
| 81 // The accessor's 'result' is stored in a private property. |
| 82 CachedAccessorCallback cachedAccessorCallback; |
| 77 const WrapperTypeInfo* data; | 83 const WrapperTypeInfo* data; |
| 78 unsigned settings : 8; // v8::AccessControl | 84 unsigned settings : 8; // v8::AccessControl |
| 79 unsigned attribute : 8; // v8::PropertyAttribute | 85 unsigned attribute : 8; // v8::PropertyAttribute |
| 80 unsigned exposeConfiguration : 1; // ExposeConfiguration | 86 unsigned exposeConfiguration : 1; // ExposeConfiguration |
| 81 unsigned | 87 unsigned |
| 82 propertyLocationConfiguration : 3; // PropertyLocationConfiguration | 88 propertyLocationConfiguration : 3; // PropertyLocationConfiguration |
| 83 unsigned holderCheckConfiguration : 1; // HolderCheckConfiguration | 89 unsigned holderCheckConfiguration : 1; // HolderCheckConfiguration |
| 84 }; | 90 }; |
| 85 | 91 |
| 86 static void installAttributes(v8::Isolate*, | 92 static void installAttributes(v8::Isolate*, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // AccessorConfiguration translates into calls to SetAccessorProperty() | 125 // AccessorConfiguration translates into calls to SetAccessorProperty() |
| 120 // on prototype ObjectTemplate. | 126 // on prototype ObjectTemplate. |
| 121 struct AccessorConfiguration { | 127 struct AccessorConfiguration { |
| 122 AccessorConfiguration& operator=(const AccessorConfiguration&) = delete; | 128 AccessorConfiguration& operator=(const AccessorConfiguration&) = delete; |
| 123 DISALLOW_NEW(); | 129 DISALLOW_NEW(); |
| 124 const char* const name; | 130 const char* const name; |
| 125 v8::FunctionCallback getter; | 131 v8::FunctionCallback getter; |
| 126 v8::FunctionCallback setter; | 132 v8::FunctionCallback setter; |
| 127 v8::FunctionCallback getterForMainWorld; | 133 v8::FunctionCallback getterForMainWorld; |
| 128 v8::FunctionCallback setterForMainWorld; | 134 v8::FunctionCallback setterForMainWorld; |
| 135 // The accessor's 'result' is stored in a private property. |
| 136 CachedAccessorCallback cachedAccessorCallback; |
| 129 const WrapperTypeInfo* data; | 137 const WrapperTypeInfo* data; |
| 130 unsigned settings : 8; // v8::AccessControl | 138 unsigned settings : 8; // v8::AccessControl |
| 131 unsigned attribute : 8; // v8::PropertyAttribute | 139 unsigned attribute : 8; // v8::PropertyAttribute |
| 132 unsigned exposeConfiguration : 1; // ExposeConfiguration | 140 unsigned exposeConfiguration : 1; // ExposeConfiguration |
| 133 unsigned | 141 unsigned |
| 134 propertyLocationConfiguration : 3; // PropertyLocationConfiguration | 142 propertyLocationConfiguration : 3; // PropertyLocationConfiguration |
| 135 unsigned holderCheckConfiguration : 1; // HolderCheckConfiguration | 143 unsigned holderCheckConfiguration : 1; // HolderCheckConfiguration |
| 136 }; | 144 }; |
| 137 | 145 |
| 138 static void installAccessors( | 146 static void installAccessors( |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Sets the class string of platform objects, interface prototype objects, | 314 // Sets the class string of platform objects, interface prototype objects, |
| 307 // etc. See also http://heycam.github.io/webidl/#dfn-class-string | 315 // etc. See also http://heycam.github.io/webidl/#dfn-class-string |
| 308 static void setClassString(v8::Isolate*, | 316 static void setClassString(v8::Isolate*, |
| 309 v8::Local<v8::ObjectTemplate>, | 317 v8::Local<v8::ObjectTemplate>, |
| 310 const char* classString); | 318 const char* classString); |
| 311 }; | 319 }; |
| 312 | 320 |
| 313 } // namespace blink | 321 } // namespace blink |
| 314 | 322 |
| 315 #endif // V8DOMConfiguration_h | 323 #endif // V8DOMConfiguration_h |
| OLD | NEW |