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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObjectInlines.h

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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef LayoutObjectInlines_h 5 #ifndef LayoutObjectInlines_h
6 #define LayoutObjectInlines_h 6 #define LayoutObjectInlines_h
7 7
8 #include "core/dom/StyleEngine.h" 8 #include "core/dom/StyleEngine.h"
9 #include "core/layout/LayoutObject.h" 9 #include "core/layout/LayoutObject.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // The following methods are inlined for performance but not put in 13 // The following methods are inlined for performance but not put in
14 // LayoutObject.h because that would unnecessarily tie LayoutObject.h 14 // LayoutObject.h because that would unnecessarily tie LayoutObject.h
15 // to StyleEngine.h for all users of LayoutObject.h that don't use 15 // to StyleEngine.h for all users of LayoutObject.h that don't use
16 // these methods. 16 // these methods.
17 17
18 inline const ComputedStyle* LayoutObject::firstLineStyle() const { 18 inline const ComputedStyle* LayoutObject::firstLineStyle() const {
19 return document().styleEngine().usesFirstLineRules() ? cachedFirstLineStyle() 19 return document().styleEngine().usesFirstLineRules() ? cachedFirstLineStyle()
20 : style(); 20 : style();
21 } 21 }
22 22
23 inline const ComputedStyle& LayoutObject::firstLineStyleRef() const { 23 inline const ComputedStyle& LayoutObject::firstLineStyleRef() const {
24 const ComputedStyle* style = firstLineStyle(); 24 const ComputedStyle* style = firstLineStyle();
25 ASSERT(style); 25 DCHECK(style);
26 return *style; 26 return *style;
27 } 27 }
28 28
29 inline const ComputedStyle* LayoutObject::style(bool firstLine) const { 29 inline const ComputedStyle* LayoutObject::style(bool firstLine) const {
30 return firstLine ? firstLineStyle() : style(); 30 return firstLine ? firstLineStyle() : style();
31 } 31 }
32 32
33 inline const ComputedStyle& LayoutObject::styleRef(bool firstLine) const { 33 inline const ComputedStyle& LayoutObject::styleRef(bool firstLine) const {
34 const ComputedStyle* style = this->style(firstLine); 34 const ComputedStyle* style = this->style(firstLine);
35 ASSERT(style); 35 DCHECK(style);
36 return *style; 36 return *style;
37 } 37 }
38 38
39 } // namespace blink 39 } // namespace blink
40 40
41 #endif 41 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698