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

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 301233010: Oilpan: use transition types for remaining RefPtr<Document>s in dom/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have Document weakly track its attached Ranges Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/bindings/v8/custom/V8DocumentCustom.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 return selectorQuery->queryAll(*this); 1021 return selectorQuery->queryAll(*this);
1022 } 1022 }
1023 1023
1024 static void dispatchChildInsertionEvents(Node& child) 1024 static void dispatchChildInsertionEvents(Node& child)
1025 { 1025 {
1026 if (child.isInShadowTree()) 1026 if (child.isInShadowTree())
1027 return; 1027 return;
1028 1028
1029 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 1029 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
1030 1030
1031 RefPtr<Node> c(child); 1031 RefPtrWillBeRawPtr<Node> c(child);
1032 RefPtr<Document> document(child.document()); 1032 RefPtrWillBeRawPtr<Document> document(child.document());
1033 1033
1034 if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_L ISTENER)) 1034 if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_L ISTENER))
1035 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInse rted, true, c->parentNode())); 1035 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInse rted, true, c->parentNode()));
1036 1036
1037 // dispatch the DOMNodeInsertedIntoDocument event to all descendants 1037 // dispatch the DOMNodeInsertedIntoDocument event to all descendants
1038 if (c->inDocument() && document->hasListenerType(Document::DOMNODEINSERTEDIN TODOCUMENT_LISTENER)) { 1038 if (c->inDocument() && document->hasListenerType(Document::DOMNODEINSERTEDIN TODOCUMENT_LISTENER)) {
1039 for (; c; c = NodeTraversal::next(*c, &child)) 1039 for (; c; c = NodeTraversal::next(*c, &child))
1040 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNode InsertedIntoDocument, false)); 1040 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNode InsertedIntoDocument, false));
1041 } 1041 }
1042 } 1042 }
1043 1043
1044 static void dispatchChildRemovalEvents(Node& child) 1044 static void dispatchChildRemovalEvents(Node& child)
1045 { 1045 {
1046 if (child.isInShadowTree()) { 1046 if (child.isInShadowTree()) {
1047 InspectorInstrumentation::willRemoveDOMNode(&child); 1047 InspectorInstrumentation::willRemoveDOMNode(&child);
1048 return; 1048 return;
1049 } 1049 }
1050 1050
1051 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 1051 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
1052 1052
1053 InspectorInstrumentation::willRemoveDOMNode(&child); 1053 InspectorInstrumentation::willRemoveDOMNode(&child);
1054 1054
1055 RefPtr<Node> c(child); 1055 RefPtrWillBeRawPtr<Node> c(child);
1056 RefPtr<Document> document(child.document()); 1056 RefPtrWillBeRawPtr<Document> document(child.document());
1057 1057
1058 // dispatch pre-removal mutation events 1058 // dispatch pre-removal mutation events
1059 if (c->parentNode() && document->hasListenerType(Document::DOMNODEREMOVED_LI STENER)) { 1059 if (c->parentNode() && document->hasListenerType(Document::DOMNODEREMOVED_LI STENER)) {
1060 NodeChildRemovalTracker scope(child); 1060 NodeChildRemovalTracker scope(child);
1061 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeRemo ved, true, c->parentNode())); 1061 c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeRemo ved, true, c->parentNode()));
1062 } 1062 }
1063 1063
1064 // dispatch the DOMNodeRemovedFromDocument event to all descendants 1064 // dispatch the DOMNodeRemovedFromDocument event to all descendants
1065 if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFRO MDOCUMENT_LISTENER)) { 1065 if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFRO MDOCUMENT_LISTENER)) {
1066 NodeChildRemovalTracker scope(child); 1066 NodeChildRemovalTracker scope(child);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 return true; 1275 return true;
1276 1276
1277 if (node->isElementNode() && toElement(node)->shadow()) 1277 if (node->isElementNode() && toElement(node)->shadow())
1278 return true; 1278 return true;
1279 1279
1280 return false; 1280 return false;
1281 } 1281 }
1282 #endif 1282 #endif
1283 1283
1284 } // namespace WebCore 1284 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8DocumentCustom.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698