| 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <new> | 10 #include <new> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "mojo/public/c/system/macros.h" | 15 #include "mojo/public/c/system/macros.h" |
| 16 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" | 16 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
| 17 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" | 17 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" |
| 18 #include "mojo/public/cpp/bindings/lib/buffer.h" | 18 #include "mojo/public/cpp/bindings/lib/buffer.h" |
| 19 #include "mojo/public/cpp/bindings/lib/map_data_internal.h" | |
| 20 #include "mojo/public/cpp/bindings/lib/serialization_util.h" | 19 #include "mojo/public/cpp/bindings/lib/serialization_util.h" |
| 21 #include "mojo/public/cpp/bindings/lib/template_util.h" | 20 #include "mojo/public/cpp/bindings/lib/template_util.h" |
| 22 #include "mojo/public/cpp/bindings/lib/validate_params.h" | 21 #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| 23 #include "mojo/public/cpp/bindings/lib/validation_errors.h" | 22 #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| 23 #include "mojo/public/cpp/bindings/lib/validation_util.h" |
| 24 | 24 |
| 25 namespace mojo { | 25 namespace mojo { |
| 26 namespace internal { | 26 namespace internal { |
| 27 | 27 |
| 28 // std::numeric_limits<uint32_t>::max() is not a compile-time constant (until | 28 // std::numeric_limits<uint32_t>::max() is not a compile-time constant (until |
| 29 // C++11). | 29 // C++11). |
| 30 const uint32_t kMaxUint32 = 0xFFFFFFFF; | 30 const uint32_t kMaxUint32 = 0xFFFFFFFF; |
| 31 | 31 |
| 32 template <typename K, typename V> |
| 33 class Map_Data; |
| 34 |
| 32 std::string MakeMessageWithArrayIndex(const char* message, | 35 std::string MakeMessageWithArrayIndex(const char* message, |
| 33 size_t size, | 36 size_t size, |
| 34 size_t index); | 37 size_t index); |
| 35 | 38 |
| 36 std::string MakeMessageWithExpectedArraySize(const char* message, | 39 std::string MakeMessageWithExpectedArraySize(const char* message, |
| 37 size_t size, | 40 size_t size, |
| 38 size_t expected_size); | 41 size_t expected_size); |
| 39 | 42 |
| 40 template <typename T> | 43 template <typename T> |
| 41 struct ArrayDataTraits { | 44 struct ArrayDataTraits { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 }; | 407 }; |
| 405 static_assert(sizeof(Array_Data<char>) == 8, "Bad sizeof(Array_Data)"); | 408 static_assert(sizeof(Array_Data<char>) == 8, "Bad sizeof(Array_Data)"); |
| 406 | 409 |
| 407 // UTF-8 encoded | 410 // UTF-8 encoded |
| 408 using String_Data = Array_Data<char>; | 411 using String_Data = Array_Data<char>; |
| 409 | 412 |
| 410 } // namespace internal | 413 } // namespace internal |
| 411 } // namespace mojo | 414 } // namespace mojo |
| 412 | 415 |
| 413 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ | 416 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_ |
| OLD | NEW |