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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutAnalyzer.cpp

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutAnalyzer.h" 5 #include "core/layout/LayoutAnalyzer.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/layout/LayoutBlock.h" 8 #include "core/layout/LayoutBlock.h"
9 #include "core/layout/LayoutObject.h" 9 #include "core/layout/LayoutObject.h"
10 #include "core/layout/LayoutText.h" 10 #include "core/layout/LayoutText.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 ++m_depth; 85 ++m_depth;
86 86
87 // This refers to LayoutAnalyzer depth, which is generally closer to C++ 87 // This refers to LayoutAnalyzer depth, which is generally closer to C++
88 // stack recursion depth, not layout tree depth or DOM tree depth. 88 // stack recursion depth, not layout tree depth or DOM tree depth.
89 m_counters[LayoutAnalyzerStackMaximumDepth] = 89 m_counters[LayoutAnalyzerStackMaximumDepth] =
90 max(m_counters[LayoutAnalyzerStackMaximumDepth], m_depth); 90 max(m_counters[LayoutAnalyzerStackMaximumDepth], m_depth);
91 } 91 }
92 92
93 void LayoutAnalyzer::pop(const LayoutObject& o) { 93 void LayoutAnalyzer::pop(const LayoutObject& o) {
94 ASSERT(m_depth > 0); 94 DCHECK_GT(m_depth, 0u);
95 --m_depth; 95 --m_depth;
96 } 96 }
97 97
98 std::unique_ptr<TracedValue> LayoutAnalyzer::toTracedValue() { 98 std::unique_ptr<TracedValue> LayoutAnalyzer::toTracedValue() {
99 std::unique_ptr<TracedValue> tracedValue(TracedValue::create()); 99 std::unique_ptr<TracedValue> tracedValue(TracedValue::create());
100 for (size_t i = 0; i < NumCounters; ++i) { 100 for (size_t i = 0; i < NumCounters; ++i) {
101 if (m_counters[i] > 0) 101 if (m_counters[i] > 0)
102 tracedValue->setInteger(nameForCounter(static_cast<Counter>(i)), 102 tracedValue->setInteger(nameForCounter(static_cast<Counter>(i)),
103 m_counters[i]); 103 m_counters[i]);
104 } 104 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return "CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePat" 150 return "CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePat"
151 "h"; 151 "h";
152 case TotalLayoutObjectsThatWereLaidOut: 152 case TotalLayoutObjectsThatWereLaidOut:
153 return "TotalLayoutObjectsThatWereLaidOut"; 153 return "TotalLayoutObjectsThatWereLaidOut";
154 } 154 }
155 NOTREACHED(); 155 NOTREACHED();
156 return ""; 156 return "";
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ImageQualityController.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698