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

Unified Diff: src/value-serializer.cc

Issue 2804643006: Expose the ValueSerializer data format version as a compile-time constant. (Closed)
Patch Set: . 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
« no previous file with comments | « src/value-serializer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/value-serializer.cc
diff --git a/src/value-serializer.cc b/src/value-serializer.cc
index 44cb8dc1887720374db4fb5dd92413c21cfab67a..1aa2525d99f5603ccdddda629d58f6971a5466eb 100644
--- a/src/value-serializer.cc
+++ b/src/value-serializer.cc
@@ -6,6 +6,7 @@
#include <type_traits>
+#include "include/v8-value-serializer-version.h"
#include "src/base/logging.h"
#include "src/conversions.h"
#include "src/factory.h"
@@ -30,6 +31,8 @@ namespace internal {
// Version 13: host objects have an explicit tag (rather than handling all
// unknown tags)
static const uint32_t kLatestVersion = 13;
+static_assert(kLatestVersion == v8::CurrentValueSerializerFormatVersion(),
+ "Exported format version must match latest version.");
static const int kPretenureThreshold = 100 * KB;
@@ -154,11 +157,6 @@ enum class WasmEncodingTag : uint8_t {
} // namespace
-// static
-uint32_t ValueSerializer::GetCurrentDataFormatVersion() {
- return kLatestVersion;
-}
-
ValueSerializer::ValueSerializer(Isolate* isolate,
v8::ValueSerializer::Delegate* delegate)
: isolate_(isolate),
« no previous file with comments | « src/value-serializer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698