Commit e46f8418 authored by jbroman's avatar jbroman Committed by Commit bot

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}
parent 8b8295db
......@@ -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();
......
......@@ -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) {}
......
......@@ -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),
......
......@@ -43,6 +43,8 @@ enum class SerializationTag : uint8_t;
*/
class ValueSerializer {
public:
static uint32_t GetCurrentDataFormatVersion();
ValueSerializer(Isolate* isolate, v8::ValueSerializer::Delegate* delegate);
~ValueSerializer();
......
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