OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 }; | 1119 }; |
1120 | 1120 |
1121 | 1121 |
1122 enum PropertyAttribute { | 1122 enum PropertyAttribute { |
1123 None = 0, | 1123 None = 0, |
1124 ReadOnly = 1 << 0, | 1124 ReadOnly = 1 << 0, |
1125 DontEnum = 1 << 1, | 1125 DontEnum = 1 << 1, |
1126 DontDelete = 1 << 2 | 1126 DontDelete = 1 << 2 |
1127 }; | 1127 }; |
1128 | 1128 |
| 1129 enum ExternalArrayType { |
| 1130 kExternalByteArray = 1, |
| 1131 kExternalUnsignedByteArray, |
| 1132 kExternalShortArray, |
| 1133 kExternalUnsignedShortArray, |
| 1134 kExternalIntArray, |
| 1135 kExternalUnsignedIntArray, |
| 1136 kExternalFloatArray |
| 1137 }; |
| 1138 |
1129 /** | 1139 /** |
1130 * A JavaScript object (ECMA-262, 4.3.3) | 1140 * A JavaScript object (ECMA-262, 4.3.3) |
1131 */ | 1141 */ |
1132 class V8EXPORT Object : public Value { | 1142 class V8EXPORT Object : public Value { |
1133 public: | 1143 public: |
1134 bool Set(Handle<Value> key, | 1144 bool Set(Handle<Value> key, |
1135 Handle<Value> value, | 1145 Handle<Value> value, |
1136 PropertyAttribute attribs = None); | 1146 PropertyAttribute attribs = None); |
1137 | 1147 |
1138 // Sets a local property on this object bypassing interceptors and | 1148 // Sets a local property on this object bypassing interceptors and |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 | 1281 |
1272 /** | 1282 /** |
1273 * Set the backing store of the indexed properties to be managed by the | 1283 * Set the backing store of the indexed properties to be managed by the |
1274 * embedding layer. Access to the indexed properties will follow the rules | 1284 * embedding layer. Access to the indexed properties will follow the rules |
1275 * spelled out in CanvasPixelArray. | 1285 * spelled out in CanvasPixelArray. |
1276 * Note: The embedding program still owns the data and needs to ensure that | 1286 * Note: The embedding program still owns the data and needs to ensure that |
1277 * the backing store is preserved while V8 has a reference. | 1287 * the backing store is preserved while V8 has a reference. |
1278 */ | 1288 */ |
1279 void SetIndexedPropertiesToPixelData(uint8_t* data, int length); | 1289 void SetIndexedPropertiesToPixelData(uint8_t* data, int length); |
1280 | 1290 |
| 1291 /** |
| 1292 * Set the backing store of the indexed properties to be managed by the |
| 1293 * embedding layer. Access to the indexed properties will follow the rules |
| 1294 * spelled out for the CanvasArray subtypes in the WebGL specification. |
| 1295 * Note: The embedding program still owns the data and needs to ensure that |
| 1296 * the backing store is preserved while V8 has a reference. |
| 1297 */ |
| 1298 void SetIndexedPropertiesToExternalArrayData(void* data, |
| 1299 ExternalArrayType array_type, |
| 1300 int number_of_elements); |
| 1301 |
1281 static Local<Object> New(); | 1302 static Local<Object> New(); |
1282 static inline Object* Cast(Value* obj); | 1303 static inline Object* Cast(Value* obj); |
1283 private: | 1304 private: |
1284 Object(); | 1305 Object(); |
1285 static void CheckCast(Value* obj); | 1306 static void CheckCast(Value* obj); |
1286 Local<Value> CheckedGetInternalField(int index); | 1307 Local<Value> CheckedGetInternalField(int index); |
1287 void* SlowGetPointerFromInternalField(int index); | 1308 void* SlowGetPointerFromInternalField(int index); |
1288 | 1309 |
1289 /** | 1310 /** |
1290 * If quick access to the internal field is possible this method | 1311 * If quick access to the internal field is possible this method |
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 | 3194 |
3174 } // namespace v8 | 3195 } // namespace v8 |
3175 | 3196 |
3176 | 3197 |
3177 #undef V8EXPORT | 3198 #undef V8EXPORT |
3178 #undef V8EXPORT_INLINE | 3199 #undef V8EXPORT_INLINE |
3179 #undef TYPE_CHECK | 3200 #undef TYPE_CHECK |
3180 | 3201 |
3181 | 3202 |
3182 #endif // V8_H_ | 3203 #endif // V8_H_ |
OLD | NEW |