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

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

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tweaks to avoid conflicts with ongoing ShadowRoot CLs 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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 861
862 LocalFrame* Document::executingFrame() 862 LocalFrame* Document::executingFrame()
863 { 863 {
864 DOMWindow* window = executingWindow(); 864 DOMWindow* window = executingWindow();
865 if (!window) 865 if (!window)
866 return 0; 866 return 0;
867 return window->frame(); 867 return window->frame();
868 } 868 }
869 869
870 PassRefPtr<DocumentFragment> Document::createDocumentFragment() 870 PassRefPtrWillBeRawPtr<DocumentFragment> Document::createDocumentFragment()
871 { 871 {
872 return DocumentFragment::create(*this); 872 return DocumentFragment::create(*this);
873 } 873 }
874 874
875 PassRefPtrWillBeRawPtr<Text> Document::createTextNode(const String& data) 875 PassRefPtrWillBeRawPtr<Text> Document::createTextNode(const String& data)
876 { 876 {
877 return Text::create(*this, data); 877 return Text::create(*this, data);
878 } 878 }
879 879
880 PassRefPtrWillBeRawPtr<Comment> Document::createComment(const String& data) 880 PassRefPtrWillBeRawPtr<Comment> Document::createComment(const String& data)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 case ATTRIBUTE_NODE: 978 case ATTRIBUTE_NODE:
979 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value()); 979 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value());
980 case DOCUMENT_FRAGMENT_NODE: { 980 case DOCUMENT_FRAGMENT_NODE: {
981 if (importedNode->isShadowRoot()) { 981 if (importedNode->isShadowRoot()) {
982 // ShadowRoot nodes should not be explicitly importable. 982 // ShadowRoot nodes should not be explicitly importable.
983 // Either they are imported along with their host node, or created i mplicitly. 983 // Either they are imported along with their host node, or created i mplicitly.
984 exceptionState.throwDOMException(NotSupportedError, "The node provid ed is a shadow root, which may not be imported."); 984 exceptionState.throwDOMException(NotSupportedError, "The node provid ed is a shadow root, which may not be imported.");
985 return nullptr; 985 return nullptr;
986 } 986 }
987 DocumentFragment* oldFragment = toDocumentFragment(importedNode); 987 DocumentFragment* oldFragment = toDocumentFragment(importedNode);
988 RefPtr<DocumentFragment> newFragment = createDocumentFragment(); 988 RefPtrWillBeRawPtr<DocumentFragment> newFragment = createDocumentFragmen t();
989 if (deep && !importContainerNodeChildren(oldFragment, newFragment, excep tionState)) 989 if (deep && !importContainerNodeChildren(oldFragment, newFragment, excep tionState))
990 return nullptr; 990 return nullptr;
991 991
992 return newFragment.release(); 992 return newFragment.release();
993 } 993 }
994 case DOCUMENT_NODE: 994 case DOCUMENT_NODE:
995 exceptionState.throwDOMException(NotSupportedError, "The node provided i s a document, which may not be imported."); 995 exceptionState.throwDOMException(NotSupportedError, "The node provided i s a document, which may not be imported.");
996 return nullptr; 996 return nullptr;
997 } 997 }
998 998
(...skipping 4732 matching lines...) Expand 10 before | Expand all | Expand 10 after
5731 visitor->trace(m_transitionTimeline); 5731 visitor->trace(m_transitionTimeline);
5732 visitor->trace(m_compositorPendingAnimations); 5732 visitor->trace(m_compositorPendingAnimations);
5733 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5733 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5734 DocumentSupplementable::trace(visitor); 5734 DocumentSupplementable::trace(visitor);
5735 TreeScope::trace(visitor); 5735 TreeScope::trace(visitor);
5736 ContainerNode::trace(visitor); 5736 ContainerNode::trace(visitor);
5737 ExecutionContext::trace(visitor); 5737 ExecutionContext::trace(visitor);
5738 } 5738 }
5739 5739
5740 } // namespace WebCore 5740 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698