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:
parent
8b8295dbb9
commit
e46f841849
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user