| OLD | NEW | 
|    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/strings/utf_offset_string_conversions.h" |    5 #include "base/strings/utf_offset_string_conversions.h" | 
|    6  |    6  | 
|    7 #include <stdint.h> |    7 #include <stdint.h> | 
|    8  |    8  | 
|    9 #include <algorithm> |    9 #include <algorithm> | 
 |   10 #include <memory> | 
|   10  |   11  | 
|   11 #include "base/logging.h" |   12 #include "base/logging.h" | 
|   12 #include "base/memory/scoped_ptr.h" |  | 
|   13 #include "base/strings/string_piece.h" |   13 #include "base/strings/string_piece.h" | 
|   14 #include "base/strings/utf_string_conversion_utils.h" |   14 #include "base/strings/utf_string_conversion_utils.h" | 
|   15  |   15  | 
|   16 namespace base { |   16 namespace base { | 
|   17  |   17  | 
|   18 OffsetAdjuster::Adjustment::Adjustment(size_t original_offset, |   18 OffsetAdjuster::Adjustment::Adjustment(size_t original_offset, | 
|   19                                        size_t original_length, |   19                                        size_t original_length, | 
|   20                                        size_t output_length) |   20                                        size_t output_length) | 
|   21     : original_offset(original_offset), |   21     : original_offset(original_offset), | 
|   22       original_length(original_length), |   22       original_length(original_length), | 
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  253                 LimitOffset<base::StringPiece16>(utf16.length())); |  253                 LimitOffset<base::StringPiece16>(utf16.length())); | 
|  254   std::string result; |  254   std::string result; | 
|  255   PrepareForUTF8Output(utf16.data(), utf16.length(), &result); |  255   PrepareForUTF8Output(utf16.data(), utf16.length(), &result); | 
|  256   OffsetAdjuster::Adjustments adjustments; |  256   OffsetAdjuster::Adjustments adjustments; | 
|  257   ConvertUnicode(utf16.data(), utf16.length(), &result, &adjustments); |  257   ConvertUnicode(utf16.data(), utf16.length(), &result, &adjustments); | 
|  258   OffsetAdjuster::AdjustOffsets(adjustments, offsets_for_adjustment); |  258   OffsetAdjuster::AdjustOffsets(adjustments, offsets_for_adjustment); | 
|  259   return result; |  259   return result; | 
|  260 } |  260 } | 
|  261  |  261  | 
|  262 }  // namespace base |  262 }  // namespace base | 
| OLD | NEW |