OLD | NEW |
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/public/bindings/lib/bindings_serialization.h" | 5 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 | 8 |
9 #include "mojo/public/bindings/lib/bindings_internal.h" | 9 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 size_t Align(size_t size) { | 14 size_t Align(size_t size) { |
15 const size_t kAlignment = 8; | 15 const size_t kAlignment = 8; |
16 return size + (kAlignment - (size % kAlignment)) % kAlignment; | 16 return size + (kAlignment - (size % kAlignment)) % kAlignment; |
17 } | 17 } |
18 | 18 |
19 void EncodePointer(const void* ptr, uint64_t* offset) { | 19 void EncodePointer(const void* ptr, uint64_t* offset) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 if (handle->value() >= handles->size()) | 65 if (handle->value() >= handles->size()) |
66 return false; | 66 return false; |
67 // Just leave holes in the vector so we don't screw up other indices. | 67 // Just leave holes in the vector so we don't screw up other indices. |
68 *handle = FetchAndReset(&handles->at(handle->value())); | 68 *handle = FetchAndReset(&handles->at(handle->value())); |
69 return true; | 69 return true; |
70 } | 70 } |
71 | 71 |
72 } // namespace internal | 72 } // namespace internal |
73 } // namespace mojo | 73 } // namespace mojo |
OLD | NEW |