OLD | NEW |
1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
2 // All rights reserved. | 2 // 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 { | 305 { |
306 typedef DartDOMWrapperTraits<BindingsClass> Traits; | 306 typedef DartDOMWrapperTraits<BindingsClass> Traits; |
307 | 307 |
308 Dart_WeakPersistentHandle wrapper = Traits::MapTraits::domMap(domData)->
get(domObject); | 308 Dart_WeakPersistentHandle wrapper = Traits::MapTraits::domMap(domData)->
get(domObject); |
309 ASSERT(Dart_IdentityEquals(Dart_HandleFromWeakPersistent(wrapper), oldIn
stance)); | 309 ASSERT(Dart_IdentityEquals(Dart_HandleFromWeakPersistent(wrapper), oldIn
stance)); |
310 Traits::MapTraits::domMap(domData)->remove(domObject); | 310 Traits::MapTraits::domMap(domData)->remove(domObject); |
311 Traits::ActiveTraits::removeWrapper(domData, domObject); | 311 Traits::ActiveTraits::removeWrapper(domData, domObject); |
312 Traits::EventTargetTraits::removeWrapper(domData, domObject); | 312 Traits::EventTargetTraits::removeWrapper(domData, domObject); |
313 } | 313 } |
314 | 314 |
| 315 friend class DartCustomElementConstructorBuilder; |
315 friend class DartCustomElementWrapper<HTMLElement>; | 316 friend class DartCustomElementWrapper<HTMLElement>; |
316 friend class DartUtilities; | 317 friend class DartUtilities; |
317 }; | 318 }; |
318 | 319 |
319 template<bool isNode> | 320 template<bool isNode> |
320 struct DartDOMWrapperMapTraits { }; | 321 struct DartDOMWrapperMapTraits { }; |
321 | 322 |
322 template<> | 323 template<> |
323 struct DartDOMWrapperMapTraits<false> { | 324 struct DartDOMWrapperMapTraits<false> { |
324 static DartDOMObjectMap* domMap(DartDOMData* domData) { return domData->obje
ctMap(); } | 325 static DartDOMObjectMap* domMap(DartDOMData* domData) { return domData->obje
ctMap(); } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 static DartMessagePortMap* domMap(DartDOMData* domData) { return domData
->messagePortMap(); } | 391 static DartMessagePortMap* domMap(DartDOMData* domData) { return domData
->messagePortMap(); } |
391 }; | 392 }; |
392 typedef MessagePortMapTraits MapTraits; | 393 typedef MessagePortMapTraits MapTraits; |
393 typedef DartDOMWrapperActiveTraits<DartMessagePort, false> ActiveTraits; | 394 typedef DartDOMWrapperActiveTraits<DartMessagePort, false> ActiveTraits; |
394 typedef DartDOMWrapperEventTargetTraits<DartMessagePort, true> EventTargetTr
aits; | 395 typedef DartDOMWrapperEventTargetTraits<DartMessagePort, true> EventTargetTr
aits; |
395 }; | 396 }; |
396 | 397 |
397 } | 398 } |
398 | 399 |
399 #endif // DartDOMWrapper_h | 400 #endif // DartDOMWrapper_h |
OLD | NEW |