| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return createUpgradeCandidateWrapper(element.get(), createSpecificWrappe
r); | 90 return createUpgradeCandidateWrapper(element.get(), createSpecificWrappe
r); |
| 91 | 91 |
| 92 return upgradeDartWrapper(element.get()); | 92 return upgradeDartWrapper(element.get()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 template<> | 95 template<> |
| 96 Dart_Handle DartCustomElementWrapper<HTMLElement>::upgradeDartWrapper(HTMLElemen
t* element) | 96 Dart_Handle DartCustomElementWrapper<HTMLElement>::upgradeDartWrapper(HTMLElemen
t* element) |
| 97 { | 97 { |
| 98 DartDOMData* domData = DartDOMData::current(); | 98 DartDOMData* domData = DartDOMData::current(); |
| 99 DartCustomElementBinding* binding = domData->customElementBinding(CustomElem
ent::definitionFor(element)); | 99 DartCustomElementBinding* binding = domData->customElementBinding(CustomElem
ent::definitionFor(element)); |
| 100 Dart_Handle customType = binding->customType(); | 100 Dart_Handle customType = Dart_HandleFromPersistent(binding->customType()); |
| 101 ASSERT(!Dart_IsError(customType)); | 101 ASSERT(!Dart_IsError(customType)); |
| 102 | 102 |
| 103 Dart_WeakPersistentHandle oldInstance = DartDOMWrapper::lookupWrapper(DartHT
MLElement::isNode, reinterpret_cast<HTMLElement*>(element)); | 103 Dart_WeakPersistentHandle oldInstance = DartDOMWrapper::lookupWrapper(DartHT
MLElement::isNode, reinterpret_cast<HTMLElement*>(element)); |
| 104 if (oldInstance) | 104 if (oldInstance) |
| 105 DartDOMWrapper::disassociateWrapper<DartHTMLElement>(reinterpret_cast<HT
MLElement*>(element), Dart_HandleFromWeakPersistent(oldInstance)); | 105 DartDOMWrapper::disassociateWrapper<DartHTMLElement>(reinterpret_cast<HT
MLElement*>(element), Dart_HandleFromWeakPersistent(oldInstance)); |
| 106 | 106 |
| 107 Dart_Handle newInstance = Dart_Allocate(customType); | 107 Dart_Handle newInstance = Dart_Allocate(customType); |
| 108 ASSERT(!Dart_IsError(newInstance)); | 108 ASSERT(!Dart_IsError(newInstance)); |
| 109 | 109 |
| 110 Dart_Handle result = Dart_SetNativeInstanceField(newInstance, 0, reinterpret
_cast<intptr_t>(element)); | 110 Dart_Handle result = Dart_SetNativeInstanceField(newInstance, 0, reinterpret
_cast<intptr_t>(element)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 124 return Dart_Handle(); | 124 return Dart_Handle(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 template | 127 template |
| 128 class DartCustomElementWrapper<HTMLElement>; | 128 class DartCustomElementWrapper<HTMLElement>; |
| 129 | 129 |
| 130 template | 130 template |
| 131 class DartCustomElementWrapper<SVGElement>; | 131 class DartCustomElementWrapper<SVGElement>; |
| 132 | 132 |
| 133 } // namespace WebCore | 133 } // namespace WebCore |
| OLD | NEW |