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

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

Issue 20231002: Replace RenderArena with PartitionAlloc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Text.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 * (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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 #include "core/platform/DateComponents.h" 146 #include "core/platform/DateComponents.h"
147 #include "core/platform/HistogramSupport.h" 147 #include "core/platform/HistogramSupport.h"
148 #include "core/platform/Language.h" 148 #include "core/platform/Language.h"
149 #include "core/platform/Timer.h" 149 #include "core/platform/Timer.h"
150 #include "core/platform/chromium/TraceEvent.h" 150 #include "core/platform/chromium/TraceEvent.h"
151 #include "core/platform/network/HTTPParsers.h" 151 #include "core/platform/network/HTTPParsers.h"
152 #include "core/platform/text/PlatformLocale.h" 152 #include "core/platform/text/PlatformLocale.h"
153 #include "core/platform/text/SegmentedString.h" 153 #include "core/platform/text/SegmentedString.h"
154 #include "core/rendering/HitTestRequest.h" 154 #include "core/rendering/HitTestRequest.h"
155 #include "core/rendering/HitTestResult.h" 155 #include "core/rendering/HitTestResult.h"
156 #include "core/rendering/RenderArena.h"
157 #include "core/rendering/RenderView.h" 156 #include "core/rendering/RenderView.h"
158 #include "core/rendering/RenderWidget.h" 157 #include "core/rendering/RenderWidget.h"
159 #include "core/rendering/TextAutosizer.h" 158 #include "core/rendering/TextAutosizer.h"
160 #include "core/svg/SVGDocumentExtensions.h" 159 #include "core/svg/SVGDocumentExtensions.h"
161 #include "core/svg/SVGStyleElement.h" 160 #include "core/svg/SVGStyleElement.h"
162 #include "core/workers/SharedWorkerRepository.h" 161 #include "core/workers/SharedWorkerRepository.h"
163 #include "core/xml/XSLTProcessor.h" 162 #include "core/xml/XSLTProcessor.h"
164 #include "core/xml/parser/XMLDocumentParser.h" 163 #include "core/xml/parser/XMLDocumentParser.h"
165 #include "weborigin/SchemeRegistry.h" 164 #include "weborigin/SchemeRegistry.h"
166 #include "weborigin/SecurityOrigin.h" 165 #include "weborigin/SecurityOrigin.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 520
522 // Currently we believe that Document can never outlive the parser. 521 // Currently we believe that Document can never outlive the parser.
523 // Although the Document may be replaced synchronously, DocumentParsers 522 // Although the Document may be replaced synchronously, DocumentParsers
524 // generally keep at least one reference to an Element which would in turn 523 // generally keep at least one reference to an Element which would in turn
525 // has a reference to the Document. If you hit this ASSERT, then that 524 // has a reference to the Document. If you hit this ASSERT, then that
526 // assumption is wrong. DocumentParser::detach() should ensure that even 525 // assumption is wrong. DocumentParser::detach() should ensure that even
527 // if the DocumentParser outlives the Document it won't cause badness. 526 // if the DocumentParser outlives the Document it won't cause badness.
528 ASSERT(!m_parser || m_parser->refCount() == 1); 527 ASSERT(!m_parser || m_parser->refCount() == 1);
529 detachParser(); 528 detachParser();
530 529
531 m_renderArena.clear();
532
533 if (this == topDocument()) 530 if (this == topDocument())
534 clearAXObjectCache(); 531 clearAXObjectCache();
535 532
536 m_decoder = 0; 533 m_decoder = 0;
537 534
538 if (m_styleSheetList) 535 if (m_styleSheetList)
539 m_styleSheetList->detachFromDocument(); 536 m_styleSheetList->detachFromDocument();
540 537
541 if (m_import) { 538 if (m_import) {
542 m_import->wasDetachedFromDocument(); 539 m_import->wasDetachedFromDocument();
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 { 1596 {
1600 PostAttachCallbackDisabler disabler(this); 1597 PostAttachCallbackDisabler disabler(this);
1601 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; 1598 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
1602 1599
1603 RefPtr<FrameView> frameView = view(); 1600 RefPtr<FrameView> frameView = view();
1604 if (frameView) { 1601 if (frameView) {
1605 frameView->pauseScheduledEvents(); 1602 frameView->pauseScheduledEvents();
1606 frameView->beginDeferredRepaints(); 1603 frameView->beginDeferredRepaints();
1607 } 1604 }
1608 1605
1609 ASSERT(!renderer() || renderArena()); 1606 if (!renderer())
1610 if (!renderer() || !renderArena())
1611 goto bailOut; 1607 goto bailOut;
1612 1608
1613 if (styleChangeType() == SubtreeStyleChange) 1609 if (styleChangeType() == SubtreeStyleChange)
1614 change = Force; 1610 change = Force;
1615 1611
1616 // Recalculating the root style (on the document) is not needed in the c ommon case. 1612 // Recalculating the root style (on the document) is not needed in the c ommon case.
1617 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) { 1613 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change >= Inherit))) {
1618 // style selector may set this again during recalc 1614 // style selector may set this again during recalc
1619 m_hasNodesWithPlaceholderStyle = false; 1615 m_hasNodesWithPlaceholderStyle = false;
1620 1616
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 void Document::clearStyleResolver() 1836 void Document::clearStyleResolver()
1841 { 1837 {
1842 m_styleResolver.clear(); 1838 m_styleResolver.clear();
1843 } 1839 }
1844 1840
1845 void Document::attach(const AttachContext& context) 1841 void Document::attach(const AttachContext& context)
1846 { 1842 {
1847 ASSERT(!attached()); 1843 ASSERT(!attached());
1848 ASSERT(!m_axObjectCache || this != topDocument()); 1844 ASSERT(!m_axObjectCache || this != topDocument());
1849 1845
1850 if (!m_renderArena)
1851 m_renderArena = RenderArena::create();
1852
1853 // Create the rendering tree 1846 // Create the rendering tree
1854 setRenderer(new (m_renderArena.get()) RenderView(this)); 1847 setRenderer(new RenderView(this));
1855 renderView()->setIsInWindow(true); 1848 renderView()->setIsInWindow(true);
1856 1849
1857 recalcStyle(Force); 1850 recalcStyle(Force);
1858 1851
1859 ContainerNode::attach(context); 1852 ContainerNode::attach(context);
1860 } 1853 }
1861 1854
1862 void Document::detach(const AttachContext& context) 1855 void Document::detach(const AttachContext& context)
1863 { 1856 {
1864 ASSERT(attached()); 1857 ASSERT(attached());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1904
1912 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument()) 1905 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument())
1913 parentDocument()->didRemoveEventTargetNode(this); 1906 parentDocument()->didRemoveEventTargetNode(this);
1914 1907
1915 // This is required, as our Frame might delete itself as soon as it detaches 1908 // This is required, as our Frame might delete itself as soon as it detaches
1916 // us. However, this violates Node::detach() semantics, as it's never 1909 // us. However, this violates Node::detach() semantics, as it's never
1917 // possible to re-attach. Eventually Document::detach() should be renamed, 1910 // possible to re-attach. Eventually Document::detach() should be renamed,
1918 // or this setting of the frame to 0 could be made explicit in each of the 1911 // or this setting of the frame to 0 could be made explicit in each of the
1919 // callers of Document::detach(). 1912 // callers of Document::detach().
1920 m_frame = 0; 1913 m_frame = 0;
1921 m_renderArena.clear();
1922 1914
1923 if (m_mediaQueryMatcher) 1915 if (m_mediaQueryMatcher)
1924 m_mediaQueryMatcher->documentDestroyed(); 1916 m_mediaQueryMatcher->documentDestroyed();
1925 1917
1926 lifecycleNotifier()->notifyDocumentWasDetached(); 1918 lifecycleNotifier()->notifyDocumentWasDetached();
1927 } 1919 }
1928 1920
1929 void Document::prepareForDestruction() 1921 void Document::prepareForDestruction()
1930 { 1922 {
1931 disconnectDescendantFrames(); 1923 disconnectDescendantFrames();
(...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after
5087 { 5079 {
5088 return DocumentLifecycleNotifier::create(this); 5080 return DocumentLifecycleNotifier::create(this);
5089 } 5081 }
5090 5082
5091 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5083 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5092 { 5084 {
5093 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5085 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5094 } 5086 }
5095 5087
5096 } // namespace WebCore 5088 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698