| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 instanceTemplate->SetInternalFieldCount(v8InternalFieldCount); | 567 instanceTemplate->SetInternalFieldCount(v8InternalFieldCount); |
| 568 // TODO(yukishiino): We should set the class string to the platform object | 568 // TODO(yukishiino): We should set the class string to the platform object |
| 569 // (|instanceTemplate|), too. The reason that we don't set it is that | 569 // (|instanceTemplate|), too. The reason that we don't set it is that |
| 570 // it prevents minor GC to collect unreachable DOM objects (a layout test | 570 // it prevents minor GC to collect unreachable DOM objects (a layout test |
| 571 // fast/dom/minor-dom-gc.html fails if we set the class string). | 571 // fast/dom/minor-dom-gc.html fails if we set the class string). |
| 572 // See also http://heycam.github.io/webidl/#es-platform-objects | 572 // See also http://heycam.github.io/webidl/#es-platform-objects |
| 573 setClassString(isolate, prototypeTemplate, interfaceName); | 573 setClassString(isolate, prototypeTemplate, interfaceName); |
| 574 if (!parentInterfaceTemplate.IsEmpty()) { | 574 if (!parentInterfaceTemplate.IsEmpty()) { |
| 575 interfaceTemplate->Inherit(parentInterfaceTemplate); | 575 interfaceTemplate->Inherit(parentInterfaceTemplate); |
| 576 // Marks the prototype object as one of native-backed objects. | 576 // Marks the prototype object as one of native-backed objects. |
| 577 // This is needed since bug 110436 asks WebKit to tell native-initiated prot
otypes from pure-JS ones. | 577 // This is needed since bug 110436 asks WebKit to tell native-initiated |
| 578 // This doesn't mark kinds "root" classes like Node, where setting this chan
ges prototype chain structure. | 578 // prototypes from pure-JS ones. This doesn't mark kinds "root" classes |
| 579 // like Node, where setting this changes prototype chain structure. |
| 579 prototypeTemplate->SetInternalFieldCount(v8PrototypeInternalFieldcount); | 580 prototypeTemplate->SetInternalFieldCount(v8PrototypeInternalFieldcount); |
| 580 } | 581 } |
| 581 } | 582 } |
| 582 | 583 |
| 583 v8::Local<v8::FunctionTemplate> V8DOMConfiguration::domClassTemplate( | 584 v8::Local<v8::FunctionTemplate> V8DOMConfiguration::domClassTemplate( |
| 584 v8::Isolate* isolate, | 585 v8::Isolate* isolate, |
| 585 const DOMWrapperWorld& world, | 586 const DOMWrapperWorld& world, |
| 586 WrapperTypeInfo* wrapperTypeInfo, | 587 WrapperTypeInfo* wrapperTypeInfo, |
| 587 InstallTemplateFunction configureDOMClassTemplate) { | 588 InstallTemplateFunction configureDOMClassTemplate) { |
| 588 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 589 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 602 void V8DOMConfiguration::setClassString( | 603 void V8DOMConfiguration::setClassString( |
| 603 v8::Isolate* isolate, | 604 v8::Isolate* isolate, |
| 604 v8::Local<v8::ObjectTemplate> objectTemplate, | 605 v8::Local<v8::ObjectTemplate> objectTemplate, |
| 605 const char* classString) { | 606 const char* classString) { |
| 606 objectTemplate->Set( | 607 objectTemplate->Set( |
| 607 v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, classString), | 608 v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, classString), |
| 608 static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); | 609 static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); |
| 609 } | 610 } |
| 610 | 611 |
| 611 } // namespace blink | 612 } // namespace blink |
| OLD | NEW |