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

Side by Side Diff: third_party/WebKit/Source/core/style/CounterDirectives.h

Issue 2751653003: Replace ASSERT and ASSERT_NOT_REACHED in core/style/ (Closed)
Patch Set: Replace ASSERT and ASSERT_NOT_REACHED in core/style/ Created 3 years, 9 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 m_isIncrementSet = false; 74 m_isIncrementSet = false;
75 } 75 }
76 void inheritIncrement(const CounterDirectives& parent) { 76 void inheritIncrement(const CounterDirectives& parent) {
77 m_incrementValue = parent.m_incrementValue; 77 m_incrementValue = parent.m_incrementValue;
78 m_isIncrementSet = parent.m_isIncrementSet; 78 m_isIncrementSet = parent.m_isIncrementSet;
79 } 79 }
80 80
81 bool isDefined() const { return isReset() || isIncrement(); } 81 bool isDefined() const { return isReset() || isIncrement(); }
82 82
83 int combinedValue() const { 83 int combinedValue() const {
84 ASSERT(m_isResetSet || !m_resetValue); 84 DCHECK(m_isResetSet || !m_resetValue);
85 ASSERT(m_isIncrementSet || !m_incrementValue); 85 DCHECK(m_isIncrementSet || !m_incrementValue);
86 // FIXME: Shouldn't allow overflow here. 86 // FIXME: Shouldn't allow overflow here.
87 return m_resetValue + m_incrementValue; 87 return m_resetValue + m_incrementValue;
88 } 88 }
89 89
90 private: 90 private:
91 bool m_isResetSet; 91 bool m_isResetSet;
92 bool m_isIncrementSet; 92 bool m_isIncrementSet;
93 int m_resetValue; 93 int m_resetValue;
94 int m_incrementValue; 94 int m_incrementValue;
95 }; 95 };
96 96
97 bool operator==(const CounterDirectives&, const CounterDirectives&); 97 bool operator==(const CounterDirectives&, const CounterDirectives&);
98 inline bool operator!=(const CounterDirectives& a, const CounterDirectives& b) { 98 inline bool operator!=(const CounterDirectives& a, const CounterDirectives& b) {
99 return !(a == b); 99 return !(a == b);
100 } 100 }
101 101
102 typedef HashMap<AtomicString, CounterDirectives> CounterDirectiveMap; 102 typedef HashMap<AtomicString, CounterDirectives> CounterDirectiveMap;
103 103
104 std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap&); 104 std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap&);
105 105
106 } // namespace blink 106 } // namespace blink
107 107
108 #endif // CounterDirectives_h 108 #endif // CounterDirectives_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ContentData.h ('k') | third_party/WebKit/Source/core/style/DataPersistent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698