Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {# http://www.chromium.org/blink/coding-style#TOC-License #} | 1 {# http://www.chromium.org/blink/coding-style#TOC-License #} |
| 2 /* | 2 /* |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 static const WrapperTypeInfo wrapperTypeInfo; | 65 static const WrapperTypeInfo wrapperTypeInfo; |
| 66 {% if has_visit_dom_wrapper %} | 66 {% if has_visit_dom_wrapper %} |
| 67 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*); | 67 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is olate*); |
| 68 {% endif %} | 68 {% endif %} |
| 69 {% if is_active_dom_object %} | 69 {% if is_active_dom_object %} |
| 70 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); | 70 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 71 {% endif %} | 71 {% endif %} |
| 72 {% if is_event_target %} | 72 {% if is_event_target %} |
| 73 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 73 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
| 74 {% endif %} | 74 {% endif %} |
| 75 {% if interface_name == 'Window' %} | |
| 76 static v8::Handle<v8::ObjectTemplate> GetShadowObjectTemplate(v8::Isolate*, WrapperWorldType); | |
|
haraken
2014/02/04 02:56:15
GetShadowObjectTemplate => getShadowObjectTemplate
Nils Barth (inactive)
2014/02/04 04:09:44
IDL compiler: rename GetShadowObjectTemplate => ge
| |
| 77 {% endif %} | |
| 75 {% for method in methods if method.is_custom %} | 78 {% for method in methods if method.is_custom %} |
| 76 {% filter conditional(method.conditional_string) %} | 79 {% filter conditional(method.conditional_string) %} |
| 77 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V alue>&); | 80 static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::V alue>&); |
| 78 {% endfilter %} | 81 {% endfilter %} |
| 79 {% endfor %} | 82 {% endfor %} |
| 80 {% if constructors or has_custom_constructor or has_event_constructor %} | 83 {% if constructors or has_custom_constructor or has_event_constructor %} |
| 81 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 84 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 82 {% endif %} | 85 {% endif %} |
| 83 {% if has_custom_constructor %} | 86 {% if has_custom_constructor %} |
| 84 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); | 87 static void constructorCustom(const v8::FunctionCallbackInfo<v8::Value>&); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 } | 146 } |
| 144 | 147 |
| 145 static inline {{cpp_class}}* fromInternalPointer(void* object) | 148 static inline {{cpp_class}}* fromInternalPointer(void* object) |
| 146 { | 149 { |
| 147 {% if parent_interface %} | 150 {% if parent_interface %} |
| 148 return static_cast<{{cpp_class}}*>(V8{{parent_interface}}::fromInternalP ointer(object)); | 151 return static_cast<{{cpp_class}}*>(V8{{parent_interface}}::fromInternalP ointer(object)); |
| 149 {% else %} | 152 {% else %} |
| 150 return static_cast<{{cpp_class}}*>(object); | 153 return static_cast<{{cpp_class}}*>(object); |
| 151 {% endif %} | 154 {% endif %} |
| 152 } | 155 } |
| 156 {% if interface_name == 'Window' %} | |
| 157 static bool namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v 8::Value> key, v8::AccessType, v8::Local<v8::Value> data); | |
| 158 static bool indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data); | |
| 159 {% endif %} | |
| 153 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, {{cpp _class}}*, v8::Isolate*){% if has_per_context_enabled_attributes %}; | 160 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, {{cpp _class}}*, v8::Isolate*){% if has_per_context_enabled_attributes %}; |
| 154 {% else %} { } | 161 {% else %} { } |
| 155 {% endif %} | 162 {% endif %} |
| 156 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*){% if has_per_context_enabled_attributes %}; | 163 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol ate*){% if has_per_context_enabled_methods %}; |
| 157 {% else %} { } | 164 {% else %} { } |
| 158 {% endif %} | 165 {% endif %} |
| 166 {# Element wrappers #} | |
| 167 {% if interface_name == 'HTMLElement' %} | |
| 168 friend v8::Handle<v8::Object> createV8HTMLWrapper(HTMLElement*, v8::Handle<v 8::Object> creationContext, v8::Isolate*); | |
| 169 friend v8::Handle<v8::Object> createV8HTMLDirectWrapper(HTMLElement*, v8::Ha ndle<v8::Object> creationContext, v8::Isolate*); | |
| 170 {% elif interface_name == 'HTMLUnknownElement' %} | |
| 171 friend v8::Handle<v8::Object> createV8HTMLFallbackWrapper(HTMLUnknownElement *, v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
| 172 {% elif interface_name == 'Element' %} | |
| 173 // This is a performance optimization hack. See V8Element::wrap. | |
| 174 friend v8::Handle<v8::Object> wrap(Node*, v8::Handle<v8::Object> creationCon text, v8::Isolate*); | |
|
haraken
2014/02/04 02:56:15
Is this still needed?
Nils Barth (inactive)
2014/02/04 04:09:44
Looks like it; it's used by V8NodeCustom.cpp.
| |
| 175 {% endif %} | |
| 159 | 176 |
| 160 private: | 177 private: |
| 161 {% if not has_custom_to_v8 %} | 178 {% if not has_custom_to_v8 %} |
| 162 friend v8::Handle<v8::Object> wrap({{cpp_class}}*, v8::Handle<v8::Object> cr eationContext, v8::Isolate*); | 179 friend v8::Handle<v8::Object> wrap({{cpp_class}}*, v8::Handle<v8::Object> cr eationContext, v8::Isolate*); |
| 163 static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class}}>, v8::H andle<v8::Object> creationContext, v8::Isolate*); | 180 static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class}}>, v8::H andle<v8::Object> creationContext, v8::Isolate*); |
| 164 {% endif %} | 181 {% endif %} |
| 165 }; | 182 }; |
| 166 | 183 |
| 167 template<> | 184 template<> |
| 168 class WrapperTypeTraits<{{cpp_class}} > { | 185 class WrapperTypeTraits<{{cpp_class}} > { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 294 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 278 } | 295 } |
| 279 | 296 |
| 280 {% if has_event_constructor %} | 297 {% if has_event_constructor %} |
| 281 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); | 298 bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionSta te&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = ""); |
| 282 | 299 |
| 283 {% endif %} | 300 {% endif %} |
| 284 } | 301 } |
| 285 {% endfilter %} | 302 {% endfilter %} |
| 286 #endif // {{v8_class}}_h | 303 #endif // {{v8_class}}_h |
| OLD | NEW |