OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> | 2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> |
3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "wtf/text/AtomicString.h" | 31 #include "wtf/text/AtomicString.h" |
32 #include "wtf/text/CString.h" | 32 #include "wtf/text/CString.h" |
33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
34 #include <unicode/rbbi.h> | 34 #include <unicode/rbbi.h> |
35 #include <unicode/ubrk.h> | 35 #include <unicode/ubrk.h> |
36 | 36 |
37 using namespace WTF; | 37 using namespace WTF; |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class LineBreakIteratorPool { | 41 class LineBreakIteratorPool final { |
| 42 USING_FAST_MALLOC(LineBreakIteratorPool); |
42 WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool); | 43 WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool); |
43 public: | 44 public: |
44 static LineBreakIteratorPool& sharedPool() | 45 static LineBreakIteratorPool& sharedPool() |
45 { | 46 { |
46 static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::Threa
dSpecific<LineBreakIteratorPool>; | 47 static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::Threa
dSpecific<LineBreakIteratorPool>; |
47 return **pool; | 48 return **pool; |
48 } | 49 } |
49 | 50 |
50 static PassOwnPtr<LineBreakIteratorPool> create() { return adoptPtr(new Line
BreakIteratorPool); } | 51 static PassOwnPtr<LineBreakIteratorPool> create() { return adoptPtr(new Line
BreakIteratorPool); } |
51 | 52 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators; | 106 HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators; |
106 | 107 |
107 friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIterato
rPool*(); | 108 friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIterato
rPool*(); |
108 }; | 109 }; |
109 | 110 |
110 enum TextContext { NoContext, PriorContext, PrimaryContext }; | 111 enum TextContext { NoContext, PriorContext, PrimaryContext }; |
111 | 112 |
112 const int textBufferCapacity = 16; | 113 const int textBufferCapacity = 16; |
113 | 114 |
114 typedef struct { | 115 typedef struct { |
| 116 DISALLOW_NEW(); |
115 UText text; | 117 UText text; |
116 UChar buffer[textBufferCapacity]; | 118 UChar buffer[textBufferCapacity]; |
117 } UTextWithBuffer; | 119 } UTextWithBuffer; |
118 | 120 |
119 static inline int64_t textPinIndex(int64_t& index, int64_t limit) | 121 static inline int64_t textPinIndex(int64_t& index, int64_t limit) |
120 { | 122 { |
121 if (index < 0) | 123 if (index < 0) |
122 index = 0; | 124 index = 0; |
123 else if (index > limit) | 125 else if (index > limit) |
124 index = limit; | 126 index = limit; |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) | 839 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) |
838 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) | 840 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) |
839 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) | 841 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) |
840 "!!safe_reverse;" | 842 "!!safe_reverse;" |
841 "!!safe_forward;"; | 843 "!!safe_forward;"; |
842 | 844 |
843 return setUpIteratorWithRules(kRules, string, length); | 845 return setUpIteratorWithRules(kRules, string, length); |
844 } | 846 } |
845 | 847 |
846 } | 848 } |
OLD | NEW |