| 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/bindings/lib/bindings_serialization.h" |
| 6 #include "mojo/public/bindings/lib/buffer.h" | 6 #include "mojo/public/bindings/lib/buffer.h" |
| 7 #include "mojo/public/tests/simple_bindings_support.h" | 7 #include "mojo/public/tests/bindings/simple_bindings_support.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 namespace test { | 11 namespace test { |
| 12 | 12 |
| 13 bool IsZero(void* p_buf, size_t size) { | 13 bool IsZero(void* p_buf, size_t size) { |
| 14 char* buf = reinterpret_cast<char*>(p_buf); | 14 char* buf = reinterpret_cast<char*>(p_buf); |
| 15 for (size_t i = 0; i < size; ++i) { | 15 for (size_t i = 0; i < size; ++i) { |
| 16 if (buf[i] != 0) | 16 if (buf[i] != 0) |
| 17 return false; | 17 return false; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Since we called Leak, ptr is still writable after FixedBuffer went out of | 105 // Since we called Leak, ptr is still writable after FixedBuffer went out of |
| 106 // scope. | 106 // scope. |
| 107 memset(ptr, 1, 8); | 107 memset(ptr, 1, 8); |
| 108 free(buf_ptr); | 108 free(buf_ptr); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace test | 111 } // namespace test |
| 112 } // namespace mojo | 112 } // namespace mojo |
| OLD | NEW |