Commit 23ff6b2f authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Explicitly reserve those tags which cannot be trivially reused without breaking back compat.

Bug: chromium:982304
Change-Id: I1a313ca67d6e3a9430f74f519a236c7dd4f88418
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1698923
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62686}
parent 37cb58b8
......@@ -66,9 +66,6 @@ static size_t BytesNeededForVarint(T value) {
return result;
}
// Note that some additional tag values are defined in Blink's
// Source/bindings/core/v8/serialization/SerializationTag.h, which must
// not clash with values defined here.
enum class SerializationTag : uint8_t {
// version:uint32_t (if at beginning of data, sets version > 0)
kVersion = 0xFF,
......@@ -165,6 +162,37 @@ enum class SerializationTag : uint8_t {
// A list of (subtag: ErrorTag, [subtag dependent data]). See ErrorTag for
// details.
kError = 'r',
// The following tags are reserved because they were in use in Chromium before
// the kHostObject tag was introduced in format version 13, at
// v8 refs/heads/master@{#43466}
// chromium/src refs/heads/master@{#453568}
//
// They must not be reused without a version check to prevent old values from
// starting to deserialize incorrectly. For simplicity, it's recommended to
// avoid them altogether.
//
// This is the set of tags that existed in SerializationTag.h at that time and
// still exist at the time of this writing (i.e., excluding those that were
// removed on the Chromium side because there should be no real user data
// containing them).
//
// It might be possible to also free up other tags which were never persisted
// (e.g. because they were used only for transfer) in the future.
kLegacyReservedMessagePort = 'M',
kLegacyReservedBlob = 'b',
kLegacyReservedBlobIndex = 'i',
kLegacyReservedFile = 'f',
kLegacyReservedFileIndex = 'e',
kLegacyReservedDOMFileSystem = 'd',
kLegacyReservedFileList = 'l',
kLegacyReservedFileListIndex = 'L',
kLegacyReservedImageData = '#',
kLegacyReservedImageBitmap = 'g',
kLegacyReservedImageBitmapTransfer = 'G',
kLegacyReservedOffscreenCanvas = 'H',
kLegacyReservedCryptoKey = 'K',
kLegacyReservedRTCCertificate = 'k',
};
namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment