fix: big endian bug in V8 serialization (#44794)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
0c83fb1540
commit
67ccd2792e
1 changed files with 7 additions and 6 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
@ -20,11 +21,11 @@
|
|||
namespace electron {
|
||||
|
||||
namespace {
|
||||
enum SerializationTag {
|
||||
kNativeImageTag = 'i',
|
||||
kTrailerOffsetTag = 0xFE,
|
||||
kVersionTag = 0xFF
|
||||
};
|
||||
|
||||
constexpr uint8_t kNativeImageTag = 'i';
|
||||
constexpr uint8_t kTrailerOffsetTag = 0xFE;
|
||||
constexpr uint8_t kVersionTag = 0xFF;
|
||||
|
||||
} // namespace
|
||||
|
||||
class V8Serializer : public v8::ValueSerializer::Delegate {
|
||||
|
@ -104,7 +105,7 @@ class V8Serializer : public v8::ValueSerializer::Delegate {
|
|||
}
|
||||
|
||||
private:
|
||||
void WriteTag(SerializationTag tag) { serializer_.WriteRawBytes(&tag, 1); }
|
||||
void WriteTag(const uint8_t tag) { serializer_.WriteRawBytes(&tag, 1U); }
|
||||
|
||||
void WriteBlinkEnvelope(uint32_t blink_version) {
|
||||
// Write a dummy blink version envelope for compatibility with
|
||||
|
|
Loading…
Reference in a new issue