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

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: Rebased + add WillBeGarbageCollected FIXME. 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentFragment.idl » ('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 * (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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 } 856 }
857 857
858 LocalFrame* Document::executingFrame() 858 LocalFrame* Document::executingFrame()
859 { 859 {
860 DOMWindow* window = executingWindow(); 860 DOMWindow* window = executingWindow();
861 if (!window) 861 if (!window)
862 return 0; 862 return 0;
863 return window->frame(); 863 return window->frame();
864 } 864 }
865 865
866 PassRefPtr<DocumentFragment> Document::createDocumentFragment() 866 PassRefPtrWillBeRawPtr<DocumentFragment> Document::createDocumentFragment()
867 { 867 {
868 return DocumentFragment::create(*this); 868 return DocumentFragment::create(*this);
869 } 869 }
870 870
871 PassRefPtrWillBeRawPtr<Text> Document::createTextNode(const String& data) 871 PassRefPtrWillBeRawPtr<Text> Document::createTextNode(const String& data)
872 { 872 {
873 return Text::create(*this, data); 873 return Text::create(*this, data);
874 } 874 }
875 875
876 PassRefPtrWillBeRawPtr<Comment> Document::createComment(const String& data) 876 PassRefPtrWillBeRawPtr<Comment> Document::createComment(const String& data)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 case ATTRIBUTE_NODE: 974 case ATTRIBUTE_NODE:
975 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value()); 975 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value());
976 case DOCUMENT_FRAGMENT_NODE: { 976 case DOCUMENT_FRAGMENT_NODE: {
977 if (importedNode->isShadowRoot()) { 977 if (importedNode->isShadowRoot()) {
978 // ShadowRoot nodes should not be explicitly importable. 978 // ShadowRoot nodes should not be explicitly importable.
979 // Either they are imported along with their host node, or created i mplicitly. 979 // Either they are imported along with their host node, or created i mplicitly.
980 exceptionState.throwDOMException(NotSupportedError, "The node provid ed is a shadow root, which may not be imported."); 980 exceptionState.throwDOMException(NotSupportedError, "The node provid ed is a shadow root, which may not be imported.");
981 return nullptr; 981 return nullptr;
982 } 982 }
983 DocumentFragment* oldFragment = toDocumentFragment(importedNode); 983 DocumentFragment* oldFragment = toDocumentFragment(importedNode);
984 RefPtr<DocumentFragment> newFragment = createDocumentFragment(); 984 RefPtrWillBeRawPtr<DocumentFragment> newFragment = createDocumentFragmen t();
985 if (deep && !importContainerNodeChildren(oldFragment, newFragment, excep tionState)) 985 if (deep && !importContainerNodeChildren(oldFragment, newFragment, excep tionState))
986 return nullptr; 986 return nullptr;
987 987
988 return newFragment.release(); 988 return newFragment.release();
989 } 989 }
990 case DOCUMENT_NODE: 990 case DOCUMENT_NODE:
991 exceptionState.throwDOMException(NotSupportedError, "The node provided i s a document, which may not be imported."); 991 exceptionState.throwDOMException(NotSupportedError, "The node provided i s a document, which may not be imported.");
992 return nullptr; 992 return nullptr;
993 } 993 }
994 994
(...skipping 4728 matching lines...) Expand 10 before | Expand all | Expand 10 after
5723 visitor->trace(m_timeline); 5723 visitor->trace(m_timeline);
5724 visitor->trace(m_compositorPendingAnimations); 5724 visitor->trace(m_compositorPendingAnimations);
5725 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5725 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5726 DocumentSupplementable::trace(visitor); 5726 DocumentSupplementable::trace(visitor);
5727 TreeScope::trace(visitor); 5727 TreeScope::trace(visitor);
5728 ContainerNode::trace(visitor); 5728 ContainerNode::trace(visitor);
5729 ExecutionContext::trace(visitor); 5729 ExecutionContext::trace(visitor);
5730 } 5730 }
5731 5731
5732 } // namespace WebCore 5732 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentFragment.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698