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

Side by Side Diff: base/i18n/break_iterator.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « base/base.gypi ('k') | base/i18n/time_formatting_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/i18n/break_iterator.h" 5 #include "base/i18n/break_iterator.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/icu/source/common/unicode/ubrk.h" 8 #include "third_party/icu/source/common/unicode/ubrk.h"
9 #include "third_party/icu/source/common/unicode/uchar.h" 9 #include "third_party/icu/source/common/unicode/uchar.h"
10 #include "third_party/icu/source/common/unicode/ustring.h" 10 #include "third_party/icu/source/common/unicode/ustring.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 NOTREACHED() << "ubrk_openRules failed to parse rule string at line " 67 NOTREACHED() << "ubrk_openRules failed to parse rule string at line "
68 << parse_error.line << ", offset " << parse_error.offset; 68 << parse_error.line << ", offset " << parse_error.offset;
69 } 69 }
70 } else { 70 } else {
71 iter_ = ubrk_open(break_type, 71 iter_ = ubrk_open(break_type,
72 NULL, 72 NULL,
73 string_.data(), 73 string_.data(),
74 static_cast<int32_t>(string_.size()), 74 static_cast<int32_t>(string_.size()),
75 &status); 75 &status);
76 if (U_FAILURE(status)) { 76 if (U_FAILURE(status)) {
77 NOTREACHED() << "ubrk_open failed for type " << break_type 77 NOTREACHED() << "ubrk_open failed";
78 << " with error " << status;
79 } 78 }
80 } 79 }
81 80
82 if (U_FAILURE(status)) { 81 if (U_FAILURE(status)) {
83 return false; 82 return false;
84 } 83 }
85 84
86 // Move the iterator to the beginning of the string. 85 // Move the iterator to the beginning of the string.
87 ubrk_first(static_cast<UBreakIterator*>(iter_)); 86 ubrk_first(static_cast<UBreakIterator*>(iter_));
88 return true; 87 return true;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return GetStringPiece().as_string(); 176 return GetStringPiece().as_string();
178 } 177 }
179 178
180 StringPiece16 BreakIterator::GetStringPiece() const { 179 StringPiece16 BreakIterator::GetStringPiece() const {
181 DCHECK(prev_ != npos && pos_ != npos); 180 DCHECK(prev_ != npos && pos_ != npos);
182 return string_.substr(prev_, pos_ - prev_); 181 return string_.substr(prev_, pos_ - prev_);
183 } 182 }
184 183
185 } // namespace i18n 184 } // namespace i18n
186 } // namespace base 185 } // namespace base
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/i18n/time_formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698