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

Side by Side Diff: Source/core/css/parser/SizesCalcParser.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 SizesCalcParser_h 5 #ifndef SizesCalcParser_h
6 #define SizesCalcParser_h 6 #define SizesCalcParser_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/css/MediaValues.h" 9 #include "core/css/MediaValues.h"
10 #include "core/css/parser/CSSParserToken.h" 10 #include "core/css/parser/CSSParserToken.h"
(...skipping 13 matching lines...) Expand all
24 , operation(0) 24 , operation(0)
25 { 25 {
26 } 26 }
27 27
28 SizesCalcValue(double numericValue, bool length) 28 SizesCalcValue(double numericValue, bool length)
29 : value(numericValue) 29 : value(numericValue)
30 , isLength(length) 30 , isLength(length)
31 , operation(0) 31 , operation(0)
32 { 32 {
33 } 33 }
34 ALLOW_ONLY_INLINE_ALLOCATION();
34 }; 35 };
35 36
36 class CORE_EXPORT SizesCalcParser { 37 class CORE_EXPORT SizesCalcParser {
37 STACK_ALLOCATED(); 38 STACK_ALLOCATED();
38 public: 39 public:
39 SizesCalcParser(CSSParserTokenRange, PassRefPtrWillBeRawPtr<MediaValues>); 40 SizesCalcParser(CSSParserTokenRange, PassRefPtrWillBeRawPtr<MediaValues>);
40 41
41 float result() const; 42 float result() const;
42 bool isValid() const { return m_isValid; } 43 bool isValid() const { return m_isValid; }
43 44
44 private: 45 private:
45 bool calcToReversePolishNotation(CSSParserTokenRange); 46 bool calcToReversePolishNotation(CSSParserTokenRange);
46 bool calculate(); 47 bool calculate();
47 void appendNumber(const CSSParserToken&); 48 void appendNumber(const CSSParserToken&);
48 bool appendLength(const CSSParserToken&); 49 bool appendLength(const CSSParserToken&);
49 bool handleOperator(Vector<CSSParserToken>& stack, const CSSParserToken&); 50 bool handleOperator(Vector<CSSParserToken>& stack, const CSSParserToken&);
50 void appendOperator(const CSSParserToken&); 51 void appendOperator(const CSSParserToken&);
51 52
52 Vector<SizesCalcValue> m_valueList; 53 Vector<SizesCalcValue> m_valueList;
53 RefPtrWillBeMember<MediaValues> m_mediaValues; 54 RefPtrWillBeMember<MediaValues> m_mediaValues;
54 bool m_isValid; 55 bool m_isValid;
55 float m_result; 56 float m_result;
56 }; 57 };
57 58
58 } // namespace blink 59 } // namespace blink
59 60
60 #endif // SizesCalcParser_h 61 #endif // SizesCalcParser_h
61 62
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698