| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 v8::Local<v8::ObjectTemplate> instanceTemplate, | 95 v8::Local<v8::ObjectTemplate> instanceTemplate, |
| 96 v8::Local<v8::ObjectTemplate> prototypeTemplate, | 96 v8::Local<v8::ObjectTemplate> prototypeTemplate, |
| 97 const AttributeConfiguration&); | 97 const AttributeConfiguration&); |
| 98 | 98 |
| 99 static void installAttribute(v8::Isolate*, | 99 static void installAttribute(v8::Isolate*, |
| 100 const DOMWrapperWorld&, | 100 const DOMWrapperWorld&, |
| 101 v8::Local<v8::Object> instance, | 101 v8::Local<v8::Object> instance, |
| 102 v8::Local<v8::Object> prototype, | 102 v8::Local<v8::Object> prototype, |
| 103 const AttributeConfiguration&); | 103 const AttributeConfiguration&); |
| 104 | 104 |
| 105 // A lazy data attribute is like one of the attributes added via |
| 106 // installAttributes(), however, V8 will attempt to replace it with the value |
| 107 // returned by the getter callback, turning it into a real data value. |
| 108 // |
| 109 // This also means that the AttributeConfiguration must not specify a setter, |
| 110 // nor any non-default attributes or access control settings. |
| 111 static void installLazyDataAttributes( |
| 112 v8::Isolate*, |
| 113 const DOMWrapperWorld&, |
| 114 v8::Local<v8::ObjectTemplate> instanceTemplate, |
| 115 v8::Local<v8::ObjectTemplate> prototypeTemplate, |
| 116 const AttributeConfiguration*, |
| 117 size_t attributeCount); |
| 118 |
| 105 // AccessorConfiguration translates into calls to SetAccessorProperty() | 119 // AccessorConfiguration translates into calls to SetAccessorProperty() |
| 106 // on prototype ObjectTemplate. | 120 // on prototype ObjectTemplate. |
| 107 struct AccessorConfiguration { | 121 struct AccessorConfiguration { |
| 108 AccessorConfiguration& operator=(const AccessorConfiguration&) = delete; | 122 AccessorConfiguration& operator=(const AccessorConfiguration&) = delete; |
| 109 DISALLOW_NEW(); | 123 DISALLOW_NEW(); |
| 110 const char* const name; | 124 const char* const name; |
| 111 v8::FunctionCallback getter; | 125 v8::FunctionCallback getter; |
| 112 v8::FunctionCallback setter; | 126 v8::FunctionCallback setter; |
| 113 v8::FunctionCallback getterForMainWorld; | 127 v8::FunctionCallback getterForMainWorld; |
| 114 v8::FunctionCallback setterForMainWorld; | 128 v8::FunctionCallback setterForMainWorld; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 // Sets the class string of platform objects, interface prototype objects, | 306 // Sets the class string of platform objects, interface prototype objects, |
| 293 // etc. See also http://heycam.github.io/webidl/#dfn-class-string | 307 // etc. See also http://heycam.github.io/webidl/#dfn-class-string |
| 294 static void setClassString(v8::Isolate*, | 308 static void setClassString(v8::Isolate*, |
| 295 v8::Local<v8::ObjectTemplate>, | 309 v8::Local<v8::ObjectTemplate>, |
| 296 const char* classString); | 310 const char* classString); |
| 297 }; | 311 }; |
| 298 | 312 |
| 299 } // namespace blink | 313 } // namespace blink |
| 300 | 314 |
| 301 #endif // V8DOMConfiguration_h | 315 #endif // V8DOMConfiguration_h |
| OLD | NEW |