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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 functionDescriptor->SetNativeDataProperty(constantName, getter, 0, v8::Handl
e<v8::Value>(), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete
)); | 116 functionDescriptor->SetNativeDataProperty(constantName, getter, 0, v8::Handl
e<v8::Value>(), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete
)); |
117 prototype->SetNativeDataProperty(constantName, getter, 0, v8::Handle<v8::Val
ue>(), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); | 117 prototype->SetNativeDataProperty(constantName, getter, 0, v8::Handle<v8::Val
ue>(), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); |
118 } | 118 } |
119 | 119 |
120 void V8DOMConfiguration::installMethods(v8::Handle<v8::ObjectTemplate> prototype
, v8::Handle<v8::Signature> signature, v8::PropertyAttribute attributes, const M
ethodConfiguration* callbacks, size_t callbackCount, v8::Isolate* isolate) | 120 void V8DOMConfiguration::installMethods(v8::Handle<v8::ObjectTemplate> prototype
, v8::Handle<v8::Signature> signature, v8::PropertyAttribute attributes, const M
ethodConfiguration* callbacks, size_t callbackCount, v8::Isolate* isolate) |
121 { | 121 { |
122 for (size_t i = 0; i < callbackCount; ++i) | 122 for (size_t i = 0; i < callbackCount; ++i) |
123 installMethod(prototype, signature, attributes, callbacks[i], isolate); | 123 installMethod(prototype, signature, attributes, callbacks[i], isolate); |
124 } | 124 } |
125 | 125 |
126 v8::Handle<v8::FunctionTemplate> V8DOMConfiguration::functionTemplateForCallback
(v8::Handle<v8::Signature> signature, v8::FunctionCallback callback, int length,
v8::Isolate* isolate) | 126 v8::Handle<v8::FunctionTemplate> V8DOMConfiguration::functionTemplateForCallback
(v8::Isolate* isolate, v8::Handle<v8::Signature> signature, v8::FunctionCallback
callback, int length) |
127 { | 127 { |
128 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New
(isolate, callback, v8Undefined(), signature, length); | 128 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New
(isolate, callback, v8Undefined(), signature, length); |
129 functionTemplate->RemovePrototype(); | 129 functionTemplate->RemovePrototype(); |
130 return functionTemplate; | 130 return functionTemplate; |
131 } | 131 } |
132 | 132 |
133 v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Handle<
v8::FunctionTemplate> functionDescriptor, const char* interfaceName, v8::Handle<
v8::FunctionTemplate> parentClass, size_t fieldCount, | 133 v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Handle<
v8::FunctionTemplate> functionDescriptor, const char* interfaceName, v8::Handle<
v8::FunctionTemplate> parentClass, size_t fieldCount, |
134 const AttributeConfiguration* attributes, size_t attributeCount, | 134 const AttributeConfiguration* attributes, size_t attributeCount, |
135 const AccessorConfiguration* accessors, size_t accessorCount, | 135 const AccessorConfiguration* accessors, size_t accessorCount, |
136 const MethodConfiguration* callbacks, size_t callbackCount, | 136 const MethodConfiguration* callbacks, size_t callbackCount, |
(...skipping 29 matching lines...) Expand all Loading... |
166 return result; | 166 return result; |
167 | 167 |
168 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | 168 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); |
169 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 169 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
170 configureDOMClassTemplate(result, isolate); | 170 configureDOMClassTemplate(result, isolate); |
171 data->setDOMTemplate(wrapperTypeInfo, result); | 171 data->setDOMTemplate(wrapperTypeInfo, result); |
172 return result; | 172 return result; |
173 } | 173 } |
174 | 174 |
175 } // namespace blink | 175 } // namespace blink |
OLD | NEW |