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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/OrientationIterator.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 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 "OrientationIterator.h" 5 #include "OrientationIterator.h"
6 6
7 #include "wtf/PtrUtil.h"
8
9 namespace blink { 7 namespace blink {
10 8
11 OrientationIterator::OrientationIterator(const UChar* buffer, unsigned bufferSiz e, FontOrientation runOrientation) 9 OrientationIterator::OrientationIterator(const UChar* buffer, unsigned bufferSiz e, FontOrientation runOrientation)
12 : m_utf16Iterator(wrapUnique(new UTF16TextIterator(buffer, bufferSize))) 10 : m_utf16Iterator(adoptPtr(new UTF16TextIterator(buffer, bufferSize)))
13 , m_bufferSize(bufferSize) 11 , m_bufferSize(bufferSize)
14 , m_atEnd(bufferSize == 0) 12 , m_atEnd(bufferSize == 0)
15 { 13 {
16 // There's not much point in segmenting by isUprightInVertical if the text 14 // There's not much point in segmenting by isUprightInVertical if the text
17 // orientation is not "mixed". 15 // orientation is not "mixed".
18 ASSERT(runOrientation == FontOrientation::VerticalMixed); 16 ASSERT(runOrientation == FontOrientation::VerticalMixed);
19 } 17 }
20 18
21 bool OrientationIterator::consume(unsigned *orientationLimit, RenderOrientation* renderOrientation) 19 bool OrientationIterator::consume(unsigned *orientationLimit, RenderOrientation* renderOrientation)
22 { 20 {
(...skipping 19 matching lines...) Expand all
42 } 40 }
43 m_utf16Iterator->advance(); 41 m_utf16Iterator->advance();
44 } 42 }
45 *orientationLimit = m_bufferSize; 43 *orientationLimit = m_bufferSize;
46 *renderOrientation = currentRenderOrientation; 44 *renderOrientation = currentRenderOrientation;
47 m_atEnd = true; 45 m_atEnd = true;
48 return true; 46 return true;
49 } 47 }
50 48
51 } // namespace blink 49 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698