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 #ifndef SymbolsIterator_h | 5 #ifndef SymbolsIterator_h |
6 #define SymbolsIterator_h | 6 #define SymbolsIterator_h |
7 | 7 |
8 #include "platform/fonts/FontFallbackPriority.h" | 8 #include "platform/fonts/FontFallbackPriority.h" |
9 #include "platform/fonts/FontOrientation.h" | 9 #include "platform/fonts/FontOrientation.h" |
10 #include "platform/fonts/ScriptRunIterator.h" | 10 #include "platform/fonts/ScriptRunIterator.h" |
11 #include "platform/fonts/UTF16TextIterator.h" | 11 #include "platform/fonts/UTF16TextIterator.h" |
12 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 #include <memory> |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class PLATFORM_EXPORT SymbolsIterator { | 18 class PLATFORM_EXPORT SymbolsIterator { |
18 USING_FAST_MALLOC(SymbolsIterator); | 19 USING_FAST_MALLOC(SymbolsIterator); |
19 WTF_MAKE_NONCOPYABLE(SymbolsIterator); | 20 WTF_MAKE_NONCOPYABLE(SymbolsIterator); |
20 public: | 21 public: |
21 SymbolsIterator(const UChar* buffer, unsigned bufferSize); | 22 SymbolsIterator(const UChar* buffer, unsigned bufferSize); |
22 | 23 |
23 bool consume(unsigned* symbolsLimit, FontFallbackPriority*); | 24 bool consume(unsigned* symbolsLimit, FontFallbackPriority*); |
24 | 25 |
25 private: | 26 private: |
26 FontFallbackPriority fontFallbackPriorityForCharacter(UChar32); | 27 FontFallbackPriority fontFallbackPriorityForCharacter(UChar32); |
27 | 28 |
28 OwnPtr<UTF16TextIterator> m_utf16Iterator; | 29 std::unique_ptr<UTF16TextIterator> m_utf16Iterator; |
29 unsigned m_bufferSize; | 30 unsigned m_bufferSize; |
30 UChar32 m_nextChar; | 31 UChar32 m_nextChar; |
31 bool m_atEnd; | 32 bool m_atEnd; |
32 | 33 |
33 FontFallbackPriority m_currentFontFallbackPriority; | 34 FontFallbackPriority m_currentFontFallbackPriority; |
34 FontFallbackPriority m_previousFontFallbackPriority; | 35 FontFallbackPriority m_previousFontFallbackPriority; |
35 }; | 36 }; |
36 | 37 |
37 } // namespace blink | 38 } // namespace blink |
38 | 39 |
39 #endif | 40 #endif |
OLD | NEW |