| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 | 7 |
| 8 #include "native_client/src/trusted/plugin/srpc/stream_shm_buffer.h" | 8 #include "native_client/src/trusted/plugin/stream_shm_buffer.h" |
| 9 | 9 |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| 11 #include <string.h> | 11 #include <string.h> |
| 12 #include <limits> | 12 #include <limits> |
| 13 | 13 |
| 14 #include "native_client/src/include/checked_cast.h" | 14 #include "native_client/src/include/checked_cast.h" |
| 15 #include "native_client/src/include/nacl_macros.h" | 15 #include "native_client/src/include/nacl_macros.h" |
| 16 #include "native_client/src/include/portability.h" | 16 #include "native_client/src/include/portability.h" |
| 17 | 17 |
| 18 #include "native_client/src/trusted/plugin/srpc/utility.h" | 18 #include "native_client/src/trusted/plugin/utility.h" |
| 19 | 19 |
| 20 #include "native_client/src/trusted/service_runtime/gio_shm_unbounded.h" | 20 #include "native_client/src/trusted/service_runtime/gio_shm_unbounded.h" |
| 21 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 21 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
| 22 #include "native_client/src/trusted/service_runtime/sel_util.h" | 22 #include "native_client/src/trusted/service_runtime/sel_util.h" |
| 23 | 23 |
| 24 using nacl::assert_cast; | 24 using nacl::assert_cast; |
| 25 | 25 |
| 26 namespace plugin { | 26 namespace plugin { |
| 27 | 27 |
| 28 StreamShmBuffer::StreamShmBuffer() { | 28 StreamShmBuffer::StreamShmBuffer() { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (static_cast<size_t>(std::numeric_limits<int32_t>::max()) < actual_size) { | 100 if (static_cast<size_t>(std::numeric_limits<int32_t>::max()) < actual_size) { |
| 101 // fail -- not representable | 101 // fail -- not representable |
| 102 *size = 0; | 102 *size = 0; |
| 103 return NULL; | 103 return NULL; |
| 104 } | 104 } |
| 105 *size = assert_cast<int32_t>(actual_size); | 105 *size = assert_cast<int32_t>(actual_size); |
| 106 return ndp; | 106 return ndp; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace plugin | 109 } // namespace plugin |
| OLD | NEW |