| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 Vector<OwnPtr<MutationObserverRegistration> >* registry = mutationObserverRe
gistry(); | 2271 Vector<OwnPtr<MutationObserverRegistration> >* registry = mutationObserverRe
gistry(); |
| 2272 ASSERT(registry); | 2272 ASSERT(registry); |
| 2273 if (!registry) | 2273 if (!registry) |
| 2274 return; | 2274 return; |
| 2275 | 2275 |
| 2276 size_t index = registry->find(registration); | 2276 size_t index = registry->find(registration); |
| 2277 ASSERT(index != notFound); | 2277 ASSERT(index != notFound); |
| 2278 if (index == notFound) | 2278 if (index == notFound) |
| 2279 return; | 2279 return; |
| 2280 | 2280 |
| 2281 // Deleting the registration may cause this node to be derefed, so we must m
ake sure the Vector operation completes |
| 2282 // before that, in case |this| is destroyed (see MutationObserverRegistratio
n::m_registrationNodeKeepAlive). |
| 2283 // FIXME: Simplify the registration/transient registration logic to make thi
s understandable by humans. |
| 2284 RefPtr<Node> protect(this); |
| 2281 registry->remove(index); | 2285 registry->remove(index); |
| 2282 } | 2286 } |
| 2283 | 2287 |
| 2284 void Node::registerTransientMutationObserver(MutationObserverRegistration* regis
tration) | 2288 void Node::registerTransientMutationObserver(MutationObserverRegistration* regis
tration) |
| 2285 { | 2289 { |
| 2286 ensureRareData()->ensureMutationObserverData()->transientRegistry.add(regist
ration); | 2290 ensureRareData()->ensureMutationObserverData()->transientRegistry.add(regist
ration); |
| 2287 } | 2291 } |
| 2288 | 2292 |
| 2289 void Node::unregisterTransientMutationObserver(MutationObserverRegistration* reg
istration) | 2293 void Node::unregisterTransientMutationObserver(MutationObserverRegistration* reg
istration) |
| 2290 { | 2294 { |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2722 node->showTreeForThis(); | 2726 node->showTreeForThis(); |
| 2723 } | 2727 } |
| 2724 | 2728 |
| 2725 void showNodePath(const WebCore::Node* node) | 2729 void showNodePath(const WebCore::Node* node) |
| 2726 { | 2730 { |
| 2727 if (node) | 2731 if (node) |
| 2728 node->showNodePathForThis(); | 2732 node->showNodePathForThis(); |
| 2729 } | 2733 } |
| 2730 | 2734 |
| 2731 #endif | 2735 #endif |
| OLD | NEW |