| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/LayoutAnalyzer.h" | 6 #include "core/layout/LayoutAnalyzer.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.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" |
| 11 #include "platform/TracedValue.h" | 11 #include "platform/TracedValue.h" |
| 12 #include "public/platform/Platform.h" | 12 #include "public/platform/Platform.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 LayoutAnalyzer::Scope::Scope(const LayoutObject& o) | 16 LayoutAnalyzer::Scope::Scope(const LayoutObject& o) |
| 17 : m_layoutObject(o) | 17 : m_layoutObject(o) |
| 18 , m_analyzer(o.frameView()->layoutAnalyzer()) | 18 , m_analyzer(o.frameView()->layoutAnalyzer()) |
| 19 { | 19 { |
| 20 if (m_analyzer) | 20 m_analyzer.push(o); |
| 21 m_analyzer->push(o); | |
| 22 } | 21 } |
| 23 | 22 |
| 24 LayoutAnalyzer::Scope::~Scope() | 23 LayoutAnalyzer::Scope::~Scope() |
| 25 { | 24 { |
| 26 if (m_analyzer) | 25 m_analyzer.pop(m_layoutObject); |
| 27 m_analyzer->pop(m_layoutObject); | |
| 28 } | 26 } |
| 29 | 27 |
| 30 void LayoutAnalyzer::reset() | 28 void LayoutAnalyzer::reset() |
| 31 { | 29 { |
| 32 m_startMs = currentTimeMS(); | 30 m_startMs = currentTimeMS(); |
| 33 m_depth = 0; | 31 m_depth = 0; |
| 34 for (size_t i = 0; i < NumCounters; ++i) { | 32 for (size_t i = 0; i < NumCounters; ++i) { |
| 35 m_counters[i] = 0; | 33 m_counters[i] = 0; |
| 36 } | 34 } |
| 37 } | 35 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 case CharactersInLayoutObjectsThatAreTextAndCanNotUseTheSimpleFontCodePath:
return "CharactersInLayoutObjectsThatAreTextAndCanNotUseTheSimpleFontCodePath"; | 134 case CharactersInLayoutObjectsThatAreTextAndCanNotUseTheSimpleFontCodePath:
return "CharactersInLayoutObjectsThatAreTextAndCanNotUseTheSimpleFontCodePath"; |
| 137 case LayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath: return "LayoutO
bjectsThatAreTextAndCanUseTheSimpleFontCodePath"; | 135 case LayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath: return "LayoutO
bjectsThatAreTextAndCanUseTheSimpleFontCodePath"; |
| 138 case CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath: ret
urn "CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath"; | 136 case CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath: ret
urn "CharactersInLayoutObjectsThatAreTextAndCanUseTheSimpleFontCodePath"; |
| 139 case TotalLayoutObjectsThatWereLaidOut: return "TotalLayoutObjectsThatWereLa
idOut"; | 137 case TotalLayoutObjectsThatWereLaidOut: return "TotalLayoutObjectsThatWereLa
idOut"; |
| 140 } | 138 } |
| 141 ASSERT_NOT_REACHED(); | 139 ASSERT_NOT_REACHED(); |
| 142 return ""; | 140 return ""; |
| 143 } | 141 } |
| 144 | 142 |
| 145 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |