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/platform/fonts/shaping/RunSegmenter.cpp

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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 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 #include "platform/fonts/shaping/RunSegmenter.h" 5 #include "platform/fonts/shaping/RunSegmenter.h"
6 6
7 #include "platform/fonts/ScriptRunIterator.h" 7 #include "platform/fonts/ScriptRunIterator.h"
8 #include "platform/fonts/SmallCapsIterator.h" 8 #include "platform/fonts/SmallCapsIterator.h"
9 #include "platform/fonts/SymbolsIterator.h" 9 #include "platform/fonts/SymbolsIterator.h"
10 #include "platform/fonts/UTF16TextIterator.h" 10 #include "platform/fonts/UTF16TextIterator.h"
11 #include "platform/text/Character.h" 11 #include "platform/text/Character.h"
12 #include "wtf/Assertions.h" 12 #include "wtf/Assertions.h"
13 #include "wtf/PtrUtil.h" 13 #include "wtf/PtrUtil.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 RunSegmenter::RunSegmenter(const UChar* buffer, 17 RunSegmenter::RunSegmenter(const UChar* buffer,
18 unsigned bufferSize, 18 unsigned bufferSize,
19 FontOrientation runOrientation) 19 FontOrientation runOrientation)
20 : m_bufferSize(bufferSize), 20 : m_bufferSize(bufferSize),
21 m_candidateRange({0, 0, USCRIPT_INVALID_CODE, 21 m_candidateRange({0, 0, USCRIPT_INVALID_CODE,
22 OrientationIterator::OrientationKeep, 22 OrientationIterator::OrientationKeep,
23 FontFallbackPriority::Text}), 23 FontFallbackPriority::Text}),
24 m_scriptRunIterator( 24 m_scriptRunIterator(makeUnique<ScriptRunIterator>(buffer, bufferSize)),
25 wrapUnique(new ScriptRunIterator(buffer, bufferSize))),
26 m_orientationIterator( 25 m_orientationIterator(
27 runOrientation == FontOrientation::VerticalMixed 26 runOrientation == FontOrientation::VerticalMixed
28 ? wrapUnique( 27 ? wrapUnique(
29 new OrientationIterator(buffer, bufferSize, runOrientation)) 28 new OrientationIterator(buffer, bufferSize, runOrientation))
30 : nullptr), 29 : nullptr),
31 m_symbolsIterator(wrapUnique(new SymbolsIterator(buffer, bufferSize))), 30 m_symbolsIterator(makeUnique<SymbolsIterator>(buffer, bufferSize)),
32 m_lastSplit(0), 31 m_lastSplit(0),
33 m_scriptRunIteratorPosition(0), 32 m_scriptRunIteratorPosition(0),
34 m_orientationIteratorPosition( 33 m_orientationIteratorPosition(
35 runOrientation == FontOrientation::VerticalMixed ? 0 : m_bufferSize), 34 runOrientation == FontOrientation::VerticalMixed ? 0 : m_bufferSize),
36 m_symbolsIteratorPosition(0), 35 m_symbolsIteratorPosition(0),
37 m_atEnd(false) {} 36 m_atEnd(false) {}
38 37
39 void RunSegmenter::consumeScriptIteratorPastLastSplit() { 38 void RunSegmenter::consumeScriptIteratorPastLastSplit() {
40 ASSERT(m_scriptRunIterator); 39 ASSERT(m_scriptRunIterator);
41 if (m_scriptRunIteratorPosition <= m_lastSplit && 40 if (m_scriptRunIteratorPosition <= m_lastSplit &&
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 95
97 m_candidateRange.start = m_candidateRange.end; 96 m_candidateRange.start = m_candidateRange.end;
98 m_candidateRange.end = m_lastSplit; 97 m_candidateRange.end = m_lastSplit;
99 *nextRange = m_candidateRange; 98 *nextRange = m_candidateRange;
100 99
101 m_atEnd = m_lastSplit == m_bufferSize; 100 m_atEnd = m_lastSplit == m_bufferSize;
102 return true; 101 return true;
103 } 102 }
104 103
105 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698