| 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 return; | 95 return; |
| 96 | 96 |
| 97 v8::FunctionCallback getterCallback = accessor.getter; | 97 v8::FunctionCallback getterCallback = accessor.getter; |
| 98 v8::FunctionCallback setterCallback = accessor.setter; | 98 v8::FunctionCallback setterCallback = accessor.setter; |
| 99 if (world.isMainWorld()) { | 99 if (world.isMainWorld()) { |
| 100 if (accessor.getterForMainWorld) | 100 if (accessor.getterForMainWorld) |
| 101 getterCallback = accessor.getterForMainWorld; | 101 getterCallback = accessor.getterForMainWorld; |
| 102 if (accessor.setterForMainWorld) | 102 if (accessor.setterForMainWorld) |
| 103 setterCallback = accessor.setterForMainWorld; | 103 setterCallback = accessor.setterForMainWorld; |
| 104 } | 104 } |
| 105 // Support [LenientThis] by not specifying the signature. V8 does not do |
| 106 // the type checking against holder if no signature is specified. Note that |
| 107 // info.Holder() passed to callbacks will be *unsafe*. |
| 108 if (accessor.holderCheckConfiguration == V8DOMConfiguration::DoNotCheckHolde
r) |
| 109 signature = v8::Local<v8::Signature>(); |
| 105 prototypeOrTemplate->SetAccessorProperty( | 110 prototypeOrTemplate->SetAccessorProperty( |
| 106 v8AtomicString(isolate, accessor.name), | 111 v8AtomicString(isolate, accessor.name), |
| 107 functionOrTemplate(isolate, getterCallback, accessor.data, signature, 0,
prototypeOrTemplate), | 112 functionOrTemplate(isolate, getterCallback, accessor.data, signature, 0,
prototypeOrTemplate), |
| 108 functionOrTemplate(isolate, setterCallback, accessor.data, signature, 1,
prototypeOrTemplate), | 113 functionOrTemplate(isolate, setterCallback, accessor.data, signature, 1,
prototypeOrTemplate), |
| 109 accessor.attribute, | 114 accessor.attribute, |
| 110 accessor.settings); | 115 accessor.settings); |
| 111 } | 116 } |
| 112 | 117 |
| 113 void installConstantInternal(v8::Isolate* isolate, v8::Local<v8::FunctionTemplat
e> functionDescriptor, v8::Local<v8::ObjectTemplate> prototypeTemplate, const V8
DOMConfiguration::ConstantConfiguration& constant) | 118 void installConstantInternal(v8::Isolate* isolate, v8::Local<v8::FunctionTemplat
e> functionDescriptor, v8::Local<v8::ObjectTemplate> prototypeTemplate, const V8
DOMConfiguration::ConstantConfiguration& constant) |
| 114 { | 119 { |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return result; | 286 return result; |
| 282 | 287 |
| 283 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | 288 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); |
| 284 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 289 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
| 285 configureDOMClassTemplate(result, isolate); | 290 configureDOMClassTemplate(result, isolate); |
| 286 data->setDOMTemplate(wrapperTypeInfo, result); | 291 data->setDOMTemplate(wrapperTypeInfo, result); |
| 287 return result; | 292 return result; |
| 288 } | 293 } |
| 289 | 294 |
| 290 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |