Export the current data format version used by ValueSerializer.

This enables clients like IndexedDB to know when the data format version has
decreased (i.e. the user has switched to an earlier version) and deal with the
resulting incompatibility up front.

BUG=chromium:704293

Review-Url: https://codereview.chromium.org/2772723005
Cr-Commit-Position: refs/heads/master@{#44391}
This commit is contained in:
jbroman 2017-04-04 12:26:32 -07:00 committed by Commit bot
parent 8b8295dbb9
commit e46f841849
4 changed files with 14 additions and 0 deletions

View File

@ -1762,6 +1762,8 @@ class V8_EXPORT ValueSerializer {
virtual void FreeBufferMemory(void* buffer);
};
static uint32_t GetCurrentDataFormatVersion();
explicit ValueSerializer(Isolate* isolate);
ValueSerializer(Isolate* isolate, Delegate* delegate);
~ValueSerializer();

View File

@ -3127,6 +3127,11 @@ struct ValueSerializer::PrivateData {
i::ValueSerializer serializer;
};
// static
uint32_t ValueSerializer::GetCurrentDataFormatVersion() {
return i::ValueSerializer::GetCurrentDataFormatVersion();
}
ValueSerializer::ValueSerializer(Isolate* isolate)
: ValueSerializer(isolate, nullptr) {}

View File

@ -154,6 +154,11 @@ enum class WasmEncodingTag : uint8_t {
} // namespace
// static
uint32_t ValueSerializer::GetCurrentDataFormatVersion() {
return kLatestVersion;
}
ValueSerializer::ValueSerializer(Isolate* isolate,
v8::ValueSerializer::Delegate* delegate)
: isolate_(isolate),

View File

@ -43,6 +43,8 @@ enum class SerializationTag : uint8_t;
*/
class ValueSerializer {
public:
static uint32_t GetCurrentDataFormatVersion();
ValueSerializer(Isolate* isolate, v8::ValueSerializer::Delegate* delegate);
~ValueSerializer();