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

Side by Side Diff: Source/WebCore/dom/Node.h

Issue 11196044: Merge 130266 - AX: Heap-use-after-free when deleting a ContainerNode with an AX object (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 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/WebCore/dom/ContainerNode.cpp ('k') | Source/WebCore/dom/Node.cpp » ('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, 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, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // of (1) a Document node or (2) a DocumentType node that is not used with a ny Document yet. 419 // of (1) a Document node or (2) a DocumentType node that is not used with a ny Document yet.
420 Document* ownerDocument() const; 420 Document* ownerDocument() const;
421 421
422 // Returns the document associated with this node. This method never returns NULL, except in the case 422 // Returns the document associated with this node. This method never returns NULL, except in the case
423 // of a DocumentType node that is not used with any Document yet. A Document node returns itself. 423 // of a DocumentType node that is not used with any Document yet. A Document node returns itself.
424 Document* document() const 424 Document* document() const
425 { 425 {
426 ASSERT(this); 426 ASSERT(this);
427 // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor 427 // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
428 // due to the virtual function call to nodeType(). 428 // due to the virtual function call to nodeType().
429 ASSERT(m_document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()) ); 429 ASSERT(documentInternal() || (nodeType() == DOCUMENT_TYPE_NODE && !inDoc ument()));
430 return m_document; 430 return documentInternal();
431 } 431 }
432 432
433 TreeScope* treeScope() const; 433 TreeScope* treeScope() const;
434 434
435 // Returns true if this node is associated with a document and is in its ass ociated document's 435 // Returns true if this node is associated with a document and is in its ass ociated document's
436 // node tree, false otherwise. 436 // node tree, false otherwise.
437 bool inDocument() const 437 bool inDocument() const
438 { 438 {
439 ASSERT(m_document || !getFlag(InDocumentFlag)); 439 ASSERT(m_document || !getFlag(InDocumentFlag));
440 return getFlag(InDocumentFlag); 440 return getFlag(InDocumentFlag);
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 void clearTabIndexExplicitly(); 742 void clearTabIndexExplicitly();
743 743
744 bool hasRareData() const { return getFlag(HasRareDataFlag); } 744 bool hasRareData() const { return getFlag(HasRareDataFlag); }
745 745
746 NodeRareData* rareData() const; 746 NodeRareData* rareData() const;
747 NodeRareData* ensureRareData(); 747 NodeRareData* ensureRareData();
748 void clearRareData(); 748 void clearRareData();
749 749
750 void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); } 750 void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); }
751 751
752 Document* documentInternal() const { return m_document; }
753
752 private: 754 private:
753 friend class TreeShared<Node, ContainerNode>; 755 friend class TreeShared<Node, ContainerNode>;
754 756
755 void removedLastRef(); 757 void removedLastRef();
756 758
757 // These API should be only used for a tree scope migration. 759 // These API should be only used for a tree scope migration.
758 // setTreeScope() returns NodeRareData to save extra nodeRareData() invocati ons on the caller site. 760 // setTreeScope() returns NodeRareData to save extra nodeRareData() invocati ons on the caller site.
759 NodeRareData* setTreeScope(TreeScope*); 761 NodeRareData* setTreeScope(TreeScope*);
760 void setDocument(Document*); 762 void setDocument(Document*);
761 763
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 888
887 } //namespace 889 } //namespace
888 890
889 #ifndef NDEBUG 891 #ifndef NDEBUG
890 // Outside the WebCore namespace for ease of invocation from gdb. 892 // Outside the WebCore namespace for ease of invocation from gdb.
891 void showTree(const WebCore::Node*); 893 void showTree(const WebCore::Node*);
892 void showNodePath(const WebCore::Node*); 894 void showNodePath(const WebCore::Node*);
893 #endif 895 #endif
894 896
895 #endif 897 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/dom/ContainerNode.cpp ('k') | Source/WebCore/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698