diff --git a/third_party/angle/include/GLSLANG/ShaderVars.h b/third_party/angle/include/GLSLANG/ShaderVars.h index f72b8c6faba8..852eef3a8b14 100644 --- a/third_party/angle/include/GLSLANG/ShaderVars.h +++ b/third_party/angle/include/GLSLANG/ShaderVars.h @@ -11,6 +11,11 @@ #define GLSLANG_SHADERVARS_H_ #include +<<<<<<< HEAD +======= +#include +#include +>>>>>>> 00102040267 (Add missing cstdint includes (#1643)) #include #include diff --git a/third_party/angle/src/common/angleutils.h b/third_party/angle/src/common/angleutils.h index 1cbb9686c7c6..af8284832b4f 100644 --- a/third_party/angle/src/common/angleutils.h +++ b/third_party/angle/src/common/angleutils.h @@ -14,7 +14,11 @@ #include #include #include +<<<<<<< HEAD #include +======= +#include +>>>>>>> 00102040267 (Add missing cstdint includes (#1643)) #include #include #include diff --git a/third_party/crashpad/util/misc/reinterpret_bytes.cc b/third_party/crashpad/util/misc/reinterpret_bytes.cc new file mode 100644 index 000000000000..3fee722dea39 --- /dev/null +++ b/third_party/crashpad/util/misc/reinterpret_bytes.cc @@ -0,0 +1,71 @@ +// Copyright 2017 The Crashpad Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "util/misc/reinterpret_bytes.h" + +#include + +#include +#include + +#include "base/logging.h" + +namespace crashpad { +namespace internal { + +bool ReinterpretBytesImpl(const char* data, + size_t data_size, + char* dest, + size_t dest_size) { + // Verify that any unused bytes from data are zero. + // The unused bytes are at the start of the data buffer for big-endian and the + // end of the buffer for little-endian. + if (dest_size < data_size) { + auto extra_bytes = data; +#if defined(ARCH_CPU_LITTLE_ENDIAN) + extra_bytes += dest_size; +#endif // ARCH_CPU_LITTLE_ENDIAN + + uint64_t zero = 0; + size_t extra_bytes_size = data_size - dest_size; + while (extra_bytes_size > 0) { + size_t to_check = std::min(extra_bytes_size, sizeof(zero)); + if (memcmp(extra_bytes, &zero, to_check) != 0) { + LOG(ERROR) << "information loss"; + return false; + } + extra_bytes += to_check; + extra_bytes_size -= to_check; + } + } + + // Zero out the destination, in case it is larger than data. + memset(dest, 0, dest_size); + +#if defined(ARCH_CPU_LITTLE_ENDIAN) + // Copy a prefix of data to a prefix of dest for little-endian + memcpy(dest, data, std::min(dest_size, data_size)); +#else + // or the suffix of data to the suffix of dest for big-endian + if (data_size >= dest_size) { + memcpy(dest, data + data_size - dest_size, dest_size); + } else { + memcpy(dest + dest_size - data_size, data, data_size); + } +#endif // ARCH_CPU_LITTLE_ENDIAN + return true; +} + +} // namespace internal +} // namespace crashpad diff --git a/third_party/v8/src/inspector/v8-string-conversions.h b/third_party/v8/src/inspector/v8-string-conversions.h new file mode 100644 index 000000000000..eb33c6816a58 --- /dev/null +++ b/third_party/v8/src/inspector/v8-string-conversions.h @@ -0,0 +1,18 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ +#define V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ + +#include +#include + +// Conversion routines between UT8 and UTF16, used by string-16.{h,cc}. You may +// want to use string-16.h directly rather than these. +namespace v8_inspector { +std::basic_string UTF8ToUTF16(const char* stringStart, size_t length); +std::string UTF16ToUTF8(const uint16_t* stringStart, size_t length); +} // namespace v8_inspector + +#endif // V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ diff --git a/v8/src/base/logging.h b/v8/src/base/logging.h index 5275fdc6a6e1..edc8d702b6d9 100644 --- a/v8/src/base/logging.h +++ b/v8/src/base/logging.h @@ -5,6 +5,7 @@ #ifndef V8_BASE_LOGGING_H_ #define V8_BASE_LOGGING_H_ +#include #include #include #include diff --git a/v8/src/base/macros.h b/v8/src/base/macros.h index a265408d9108..2dba36fadb86 100644 --- a/v8/src/base/macros.h +++ b/v8/src/base/macros.h @@ -5,6 +5,7 @@ #ifndef V8_BASE_MACROS_H_ #define V8_BASE_MACROS_H_ +#include #include #include "src/base/compiler-specific.h"