Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: Source/bindings/dart/DartDOMWrapper.h

Issue 54833003: Fixing another case of multiple upgrades of a custom element (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartDOMWrapper.h
diff --git a/Source/bindings/dart/DartDOMWrapper.h b/Source/bindings/dart/DartDOMWrapper.h
index ce7b9dd0877ad4ffd0c6cca14afc54deffe9326e..e6503db9a47164af933b928765823bdd5c41d336 100644
--- a/Source/bindings/dart/DartDOMWrapper.h
+++ b/Source/bindings/dart/DartDOMWrapper.h
@@ -272,11 +272,18 @@ private:
}
template <class BindingsClass>
- static void wrapperWeakCallback(Dart_WeakPersistentHandle, void* peer)
+ static void wrapperWeakCallback(Dart_WeakPersistentHandle wrapper, void* peer)
{
typedef DartDOMWrapperTraits<BindingsClass> Traits;
DartDOMData* domData = DartDOMData::current();
typename BindingsClass::NativeType* domObject = static_cast<typename BindingsClass::NativeType*>(peer);
+ Dart_WeakPersistentHandle currentWrapper = Traits::MapTraits::domMap(domData)->get(domObject);
vsm 2013/10/31 23:19:43 Looking the IDB failures - if they are from this -
+ // This could be an old wrapper which has been replaced with a custom element.
+ if (currentWrapper != wrapper) {
+ ASSERT(!Dart_IdentityEquals(Dart_HandleFromWeakPersistent(currentWrapper), Dart_HandleFromWeakPersistent(wrapper)));
+ return;
+ }
+
if (DartDOMWrapperTraits<BindingsClass>::MapTraits::domMap(domData)->contains(domObject)) {
Traits::MapTraits::domMap(domData)->remove(domObject);
Traits::ActiveTraits::removeWrapper(domData, domObject);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698