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

Side by Side Diff: mojo/common/common_type_converters.cc

Issue 1543603002: Switch to standard integer types in mojo/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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 | « mojo/common/common_type_converters.h ('k') | mojo/common/common_type_converters_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/common/common_type_converters.h" 5 #include "mojo/common/common_type_converters.h"
6 6
7 #include <stdint.h>
8
7 #include <string> 9 #include <string>
8 10
9 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
10 12
11 namespace mojo { 13 namespace mojo {
12 14
13 // static 15 // static
14 String TypeConverter<String, base::StringPiece>::Convert( 16 String TypeConverter<String, base::StringPiece>::Convert(
15 const base::StringPiece& input) { 17 const base::StringPiece& input) {
16 if (input.empty()) { 18 if (input.empty()) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 50
49 Array<uint8_t> TypeConverter<Array<uint8_t>, std::string>::Convert( 51 Array<uint8_t> TypeConverter<Array<uint8_t>, std::string>::Convert(
50 const std::string& input) { 52 const std::string& input) {
51 Array<uint8_t> result(input.size()); 53 Array<uint8_t> result(input.size());
52 if (input.size() > 0) 54 if (input.size() > 0)
53 memcpy(&result.front(), input.c_str(), input.size()); 55 memcpy(&result.front(), input.c_str(), input.size());
54 return result; 56 return result;
55 } 57 }
56 58
57 } // namespace mojo 59 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/common/common_type_converters.h ('k') | mojo/common/common_type_converters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698