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

Side by Side Diff: mojo/public/cpp/bindings/lib/string_serialization.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/public/cpp/bindings/lib/string_serialization.h" 5 #include "mojo/public/cpp/bindings/lib/string_serialization.h"
6 6
7 #include <stddef.h>
7 #include <string.h> 8 #include <string.h>
8 9
9 namespace mojo { 10 namespace mojo {
10 11
11 size_t GetSerializedSize_(const String& input) { 12 size_t GetSerializedSize_(const String& input) {
12 if (!input) 13 if (!input)
13 return 0; 14 return 0;
14 return internal::Align(sizeof(internal::String_Data) + input.size()); 15 return internal::Align(sizeof(internal::String_Data) + input.size());
15 } 16 }
16 17
(...skipping 17 matching lines...) Expand all
34 if (input) { 35 if (input) {
35 String result(input->storage(), input->size()); 36 String result(input->storage(), input->size());
36 result.Swap(output); 37 result.Swap(output);
37 } else { 38 } else {
38 output->reset(); 39 output->reset();
39 } 40 }
40 return true; 41 return true;
41 } 42 }
42 43
43 } // namespace mojo 44 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/string_serialization.h ('k') | mojo/public/cpp/bindings/lib/validate_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698