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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.h

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 years, 8 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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 void setIsViewSource(bool); 372 void setIsViewSource(bool);
373 373
374 bool sawElementsInKnownNamespaces() const { return m_sawElementsInKnownNames paces; } 374 bool sawElementsInKnownNamespaces() const { return m_sawElementsInKnownNames paces; }
375 375
376 bool isRenderingReady() const { return haveImportsLoaded() && haveStylesheet sLoaded(); } 376 bool isRenderingReady() const { return haveImportsLoaded() && haveStylesheet sLoaded(); }
377 bool isScriptExecutionReady() const { return isRenderingReady(); } 377 bool isScriptExecutionReady() const { return isRenderingReady(); }
378 378
379 // This is a DOM function. 379 // This is a DOM function.
380 StyleSheetList* styleSheets(); 380 StyleSheetList* styleSheets();
381 381
382 StyleEngine& styleEngine() { ASSERT(m_styleEngine.get()); return *m_styleEng ine.get(); } 382 StyleEngine& styleEngine() { DCHECK(m_styleEngine.get()); return *m_styleEng ine.get(); }
383 383
384 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; } 384 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; }
385 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; } 385 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; }
386 386
387 void scheduleUseShadowTreeUpdate(SVGUseElement&); 387 void scheduleUseShadowTreeUpdate(SVGUseElement&);
388 void unscheduleUseShadowTreeUpdate(SVGUseElement&); 388 void unscheduleUseShadowTreeUpdate(SVGUseElement&);
389 389
390 // FIXME: SVG filters should change to store the filter on the ComputedStyle 390 // FIXME: SVG filters should change to store the filter on the ComputedStyle
391 // instead of the LayoutObject so we can get rid of this hack. 391 // instead of the LayoutObject so we can get rid of this hack.
392 void scheduleSVGFilterLayerUpdateHack(Element&); 392 void scheduleSVGFilterLayerUpdateHack(Element&);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); } 791 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); }
792 792
793 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : nullptr; } 793 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : nullptr; }
794 HTMLScriptElement* currentScriptForBinding() const; 794 HTMLScriptElement* currentScriptForBinding() const;
795 void pushCurrentScript(RawPtr<HTMLScriptElement>); 795 void pushCurrentScript(RawPtr<HTMLScriptElement>);
796 void popCurrentScript(); 796 void popCurrentScript();
797 797
798 void setTransformSource(PassOwnPtr<TransformSource>); 798 void setTransformSource(PassOwnPtr<TransformSource>);
799 TransformSource* transformSource() const { return m_transformSource.get(); } 799 TransformSource* transformSource() const { return m_transformSource.get(); }
800 800
801 void incDOMTreeVersion() { ASSERT(m_lifecycle.stateAllowsTreeMutations()); m _domTreeVersion = ++s_globalTreeVersion; } 801 void incDOMTreeVersion() { DCHECK(m_lifecycle.stateAllowsTreeMutations()); m _domTreeVersion = ++s_globalTreeVersion; }
802 uint64_t domTreeVersion() const { return m_domTreeVersion; } 802 uint64_t domTreeVersion() const { return m_domTreeVersion; }
803 803
804 uint64_t styleVersion() const { return m_styleVersion; } 804 uint64_t styleVersion() const { return m_styleVersion; }
805 805
806 enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingShe ets, IgnoreLayoutWithPendingSheets }; 806 enum PendingSheetLayout { NoLayoutWithPendingSheets, DidLayoutWithPendingShe ets, IgnoreLayoutWithPendingSheets };
807 807
808 bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout = = DidLayoutWithPendingSheets; } 808 bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout = = DidLayoutWithPendingSheets; }
809 bool ignoreLayoutWithPendingStylesheets() const { return m_pendingSheetLayou t == IgnoreLayoutWithPendingSheets; } 809 bool ignoreLayoutWithPendingStylesheets() const { return m_pendingSheetLayou t == IgnoreLayoutWithPendingSheets; }
810 810
811 bool hasNodesWithPlaceholderStyle() const { return m_hasNodesWithPlaceholder Style; } 811 bool hasNodesWithPlaceholderStyle() const { return m_hasNodesWithPlaceholder Style; }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 CanvasFontCache* canvasFontCache(); 1041 CanvasFontCache* canvasFontCache();
1042 1042
1043 // Used by unit tests so that all parsing will be main thread for 1043 // Used by unit tests so that all parsing will be main thread for
1044 // controlling parsing and chunking precisely. 1044 // controlling parsing and chunking precisely.
1045 static void setThreadedParsingEnabledForTesting(bool); 1045 static void setThreadedParsingEnabledForTesting(bool);
1046 static bool threadedParsingEnabledForTesting(); 1046 static bool threadedParsingEnabledForTesting();
1047 1047
1048 void incrementNodeCount() { m_nodeCount++; } 1048 void incrementNodeCount() { m_nodeCount++; }
1049 void decrementNodeCount() 1049 void decrementNodeCount()
1050 { 1050 {
1051 ASSERT(m_nodeCount > 0); 1051 DCHECK_GT(m_nodeCount, 0);
1052 m_nodeCount--; 1052 m_nodeCount--;
1053 } 1053 }
1054 int nodeCount() const { return m_nodeCount; } 1054 int nodeCount() const { return m_nodeCount; }
1055 1055
1056 using WeakDocumentSet = HeapHashSet<WeakMember<Document>>; 1056 using WeakDocumentSet = HeapHashSet<WeakMember<Document>>;
1057 static WeakDocumentSet& liveDocumentSet(); 1057 static WeakDocumentSet& liveDocumentSet();
1058 1058
1059 WebTaskRunner* loadingTaskRunner() const; 1059 WebTaskRunner* loadingTaskRunner() const;
1060 WebTaskRunner* timerTaskRunner() const; 1060 WebTaskRunner* timerTaskRunner() const;
1061 1061
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 void clearFocusedElementTimerFired(Timer<Document>*); 1150 void clearFocusedElementTimerFired(Timer<Document>*);
1151 1151
1152 bool haveStylesheetsLoaded() const; 1152 bool haveStylesheetsLoaded() const;
1153 void styleResolverMayHaveChanged(); 1153 void styleResolverMayHaveChanged();
1154 1154
1155 void setHoverNode(RawPtr<Node>); 1155 void setHoverNode(RawPtr<Node>);
1156 1156
1157 using EventFactorySet = HashSet<OwnPtr<EventFactoryBase>>; 1157 using EventFactorySet = HashSet<OwnPtr<EventFactoryBase>>;
1158 static EventFactorySet& eventFactories(); 1158 static EventFactorySet& eventFactories();
1159 1159
1160 void setNthIndexCache(NthIndexCache* nthIndexCache) { ASSERT(!m_nthIndexCach e || !nthIndexCache); m_nthIndexCache = nthIndexCache; } 1160 void setNthIndexCache(NthIndexCache* nthIndexCache) { DCHECK(!m_nthIndexCach e || !nthIndexCache); m_nthIndexCache = nthIndexCache; }
1161 1161
1162 const OriginAccessEntry& accessEntryFromURL(); 1162 const OriginAccessEntry& accessEntryFromURL();
1163 1163
1164 DocumentLifecycle m_lifecycle; 1164 DocumentLifecycle m_lifecycle;
1165 1165
1166 bool m_hasNodesWithPlaceholderStyle; 1166 bool m_hasNodesWithPlaceholderStyle;
1167 bool m_evaluateMediaQueriesOnStyleRecalc; 1167 bool m_evaluateMediaQueriesOnStyleRecalc;
1168 1168
1169 // If we do ignore the pending stylesheet count, then we need to add a boole an 1169 // If we do ignore the pending stylesheet count, then we need to add a boole an
1170 // to track that this happened so that we can do a full repaint when the sty lesheets 1170 // to track that this happened so that we can do a full repaint when the sty lesheets
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1443 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1444 1444
1445 } // namespace blink 1445 } // namespace blink
1446 1446
1447 #ifndef NDEBUG 1447 #ifndef NDEBUG
1448 // Outside the WebCore namespace for ease of invocation from gdb. 1448 // Outside the WebCore namespace for ease of invocation from gdb.
1449 CORE_EXPORT void showLiveDocumentInstances(); 1449 CORE_EXPORT void showLiveDocumentInstances();
1450 #endif 1450 #endif
1451 1451
1452 #endif // Document_h 1452 #endif // Document_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMURL.cpp ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698