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

Side by Side Diff: base/strings/utf_offset_string_conversions.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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/strings/safe_sprintf_unittest.cc ('k') | base/supports_user_data.h » ('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/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
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
OLDNEW
« no previous file with comments | « base/strings/safe_sprintf_unittest.cc ('k') | base/supports_user_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698