Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1731)

Unified Diff: third_party/WebKit/public/web/WebSerializedScriptValueVersion.h

Issue 2773823002: Use a two-part data format version in IndexedDB metadata. (Closed)
Patch Set: jsbell, cmumford Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/web/WebSerializedScriptValueVersion.h
diff --git a/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h b/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h
index a808ae23fedda2fd79b7392ff8e258f50049c2c9..9a4b3d26c06c4068b1dfb2966dff9eb2d08f9293 100644
--- a/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h
+++ b/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h
@@ -31,14 +31,29 @@
#ifndef WebSerializedScriptValueVersion_h
#define WebSerializedScriptValueVersion_h
+#include <cstdint>
+
+#include "third_party/WebKit/public/platform/WebCommon.h"
+
namespace blink {
-// SerializedScriptValue wire format version. Versions higher than
-// this value will not be deserializable by WebSerializedScriptValue.
-// Embedders may serialize this as out-of-band metadata along with
-// collections of serialized data so that version skew can be detected
-// before deserializing individual values.
-const unsigned kSerializedScriptValueVersion = 16;
+// The currently supported version data for serialized script values.
+// This is the version that will be written. Values can be read only if they
+// were written by a serializer for which both |v8_version| and |blink_version|
+// were less than or equal to the current version.
+//
+// Versions higher than |current()| will not be deserializable by
+// WebSerializedScriptValue. Embedders may serialize this as out-of-band
+// metadata along with collections of serialized data so that version skew can
+// be detected before deserializing individual values.
+//
+// In general, both versions should monotonically increase.
+struct WebSerializedScriptValueVersion {
+ uint32_t v8Version = 0;
cmumford 2017/04/05 21:23:18 v8 has a major and minor version (V8_MAJOR_VERSION
jbroman 2017/04/05 21:27:10 V8 has a wire format version, which is analogous t
+ uint32_t blinkVersion = 0;
+
+ BLINK_EXPORT static WebSerializedScriptValueVersion current();
+};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698