| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (world.isMainWorld()) { | 47 if (world.isMainWorld()) { |
| 48 if (attribute.getterForMainWorld) | 48 if (attribute.getterForMainWorld) |
| 49 getter = attribute.getterForMainWorld; | 49 getter = attribute.getterForMainWorld; |
| 50 if (attribute.setterForMainWorld) | 50 if (attribute.setterForMainWorld) |
| 51 setter = attribute.setterForMainWorld; | 51 setter = attribute.setterForMainWorld; |
| 52 } | 52 } |
| 53 v8::Local<v8::Value> data = v8::External::New(isolate, const_cast<WrapperTyp
eInfo*>(attribute.data)); | 53 v8::Local<v8::Value> data = v8::External::New(isolate, const_cast<WrapperTyp
eInfo*>(attribute.data)); |
| 54 | 54 |
| 55 ASSERT(attribute.propertyLocationConfiguration); | 55 ASSERT(attribute.propertyLocationConfiguration); |
| 56 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInstance
) | 56 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInstance
) |
| 57 instanceTemplate->SetAccessor(name, getter, setter, data, static_cast<v8
::AccessControl>(attribute.settings), static_cast<v8::PropertyAttribute>(attribu
te.attribute)); | 57 instanceTemplate->SetNativeDataProperty(name, getter, setter, data, stat
ic_cast<v8::PropertyAttribute>(attribute.attribute), v8::Local<v8::AccessorSigna
ture>(), static_cast<v8::AccessControl>(attribute.settings)); |
| 58 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnPrototyp
e) | 58 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnPrototyp
e) |
| 59 prototypeTemplate->SetAccessor(name, getter, setter, data, static_cast<v
8::AccessControl>(attribute.settings), static_cast<v8::PropertyAttribute>(attrib
ute.attribute)); | 59 prototypeTemplate->SetNativeDataProperty(name, getter, setter, data, sta
tic_cast<v8::PropertyAttribute>(attribute.attribute), v8::Local<v8::AccessorSign
ature>(), static_cast<v8::AccessControl>(attribute.settings)); |
| 60 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInterfac
e) | 60 if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInterfac
e) |
| 61 ASSERT_NOT_REACHED(); | 61 ASSERT_NOT_REACHED(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 template<class FunctionOrTemplate> | 64 template<class FunctionOrTemplate> |
| 65 v8::Local<FunctionOrTemplate> createAccessorFunctionOrTemplate(v8::Isolate*, v8:
:FunctionCallback, v8::Local<v8::Value> data, v8::Local<v8::Signature>, int leng
th); | 65 v8::Local<FunctionOrTemplate> createAccessorFunctionOrTemplate(v8::Isolate*, v8:
:FunctionCallback, v8::Local<v8::Value> data, v8::Local<v8::Signature>, int leng
th); |
| 66 | 66 |
| 67 template<> | 67 template<> |
| 68 v8::Local<v8::FunctionTemplate> createAccessorFunctionOrTemplate<v8::FunctionTem
plate>(v8::Isolate* isolate, v8::FunctionCallback callback, v8::Local<v8::Value>
data, v8::Local<v8::Signature> signature, int length) | 68 v8::Local<v8::FunctionTemplate> createAccessorFunctionOrTemplate<v8::FunctionTem
plate>(v8::Isolate* isolate, v8::FunctionCallback callback, v8::Local<v8::Value>
data, v8::Local<v8::Signature> signature, int length) |
| 69 { | 69 { |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 data->setDOMTemplate(wrapperTypeInfo, result); | 339 data->setDOMTemplate(wrapperTypeInfo, result); |
| 340 return result; | 340 return result; |
| 341 } | 341 } |
| 342 | 342 |
| 343 void V8DOMConfiguration::setClassString(v8::Isolate* isolate, v8::Local<v8::Obje
ctTemplate> objectTemplate, const char* classString) | 343 void V8DOMConfiguration::setClassString(v8::Isolate* isolate, v8::Local<v8::Obje
ctTemplate> objectTemplate, const char* classString) |
| 344 { | 344 { |
| 345 objectTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(isol
ate, classString), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnu
m)); | 345 objectTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(isol
ate, classString), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnu
m)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 } // namespace blink | 348 } // namespace blink |
| OLD | NEW |