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

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

Issue 292503006: Oilpan: add [WillBeGarbageCollected] for Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 7 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
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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 if (exceptionState.hadException()) 918 if (exceptionState.hadException())
919 return false; 919 return false;
920 newContainerNode->appendChild(newChild.release(), exceptionState); 920 newContainerNode->appendChild(newChild.release(), exceptionState);
921 if (exceptionState.hadException()) 921 if (exceptionState.hadException())
922 return false; 922 return false;
923 } 923 }
924 924
925 return true; 925 return true;
926 } 926 }
927 927
928 PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec) 928 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionS tate& ec)
929 { 929 {
930 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg ument); 930 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg ument);
931 return importNode(importedNode, true, ec); 931 return importNode(importedNode, true, ec);
932 } 932 }
933 933
934 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt ate& exceptionState) 934 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState)
935 { 935 {
936 if (!importedNode) { 936 if (!importedNode) {
937 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a rgumentNullOrIncorrectType(1, "Node")); 937 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a rgumentNullOrIncorrectType(1, "Node"));
938 return nullptr; 938 return nullptr;
939 } 939 }
940 940
941 switch (importedNode->nodeType()) { 941 switch (importedNode->nodeType()) {
942 case TEXT_NODE: 942 case TEXT_NODE:
943 return createTextNode(importedNode->nodeValue()); 943 return createTextNode(importedNode->nodeValue());
944 case CDATA_SECTION_NODE: 944 case CDATA_SECTION_NODE:
(...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after
5738 // FIXME: Oilpan: Use a weak counted set instead. 5738 // FIXME: Oilpan: Use a weak counted set instead.
5739 if (m_touchEventTargets) { 5739 if (m_touchEventTargets) {
5740 Vector<Node*> deadNodes; 5740 Vector<Node*> deadNodes;
5741 for (TouchEventTargetSet::iterator it = m_touchEventTargets->begin(); it != m_touchEventTargets->end(); ++it) { 5741 for (TouchEventTargetSet::iterator it = m_touchEventTargets->begin(); it != m_touchEventTargets->end(); ++it) {
5742 if (!visitor->isAlive(it->key)) 5742 if (!visitor->isAlive(it->key))
5743 deadNodes.append(it->key); 5743 deadNodes.append(it->key);
5744 } 5744 }
5745 for (unsigned i = 0; i < deadNodes.size(); ++i) 5745 for (unsigned i = 0; i < deadNodes.size(); ++i)
5746 didClearTouchEventHandlers(deadNodes[i]); 5746 didClearTouchEventHandlers(deadNodes[i]);
5747 } 5747 }
5748 if (m_domWindow && !visitor->isAlive(m_domWindow)) {
5749 ASSERT(isDisposed());
Mads Ager (chromium) 2014/05/26 06:15:20 This seems fishy to me. If the Document is dead an
5750 // Oilpan: this mirrors the clearing of the document object's touch
5751 // handlers that happen when the DOMWindow is destructed in a non-Oilpan
5752 // setting (done via DOMWindow::removeAllEventListeners().)
5753 didClearTouchEventHandlers(this);
5754 m_domWindow.clear();
5755 }
5748 } 5756 }
5749 5757
5750 void Document::trace(Visitor* visitor) 5758 void Document::trace(Visitor* visitor)
5751 { 5759 {
5752 visitor->trace(m_docType); 5760 visitor->trace(m_docType);
5753 visitor->trace(m_implementation); 5761 visitor->trace(m_implementation);
5754 visitor->trace(m_autofocusElement); 5762 visitor->trace(m_autofocusElement);
5755 visitor->trace(m_focusedElement); 5763 visitor->trace(m_focusedElement);
5756 visitor->trace(m_hoverNode); 5764 visitor->trace(m_hoverNode);
5757 visitor->trace(m_activeHoverElement); 5765 visitor->trace(m_activeHoverElement);
(...skipping 27 matching lines...) Expand all
5785 visitor->trace(m_timeline); 5793 visitor->trace(m_timeline);
5786 visitor->trace(m_compositorPendingAnimations); 5794 visitor->trace(m_compositorPendingAnimations);
5787 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5795 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5788 DocumentSupplementable::trace(visitor); 5796 DocumentSupplementable::trace(visitor);
5789 TreeScope::trace(visitor); 5797 TreeScope::trace(visitor);
5790 ContainerNode::trace(visitor); 5798 ContainerNode::trace(visitor);
5791 ExecutionContext::trace(visitor); 5799 ExecutionContext::trace(visitor);
5792 } 5800 }
5793 5801
5794 } // namespace WebCore 5802 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698