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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp

Issue 2803593005: Avoid unnecessary byte-swapping in blink's SerializedScriptValue. (Closed)
Patch Set: Correct handling for SSV version 0. 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/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
index 3fb2c598f644d0a6ab49c984f91921365459b1c1..3b8663b48f20c8c5889eb74d006874f8059818b0 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp
@@ -129,10 +129,10 @@ void checkKeyPathNumberValue(v8::Isolate* isolate,
// SerializedScriptValue header format offsets are inferred from the Blink and
// V8 serialization code. The code below DCHECKs that
-constexpr static size_t kSSVHeaderBlinkVersionOffset = 0;
-constexpr static size_t kSSVHeaderBlinkVersionTagOffset = 1;
-constexpr static size_t kSSVHeaderV8VersionOffset = 2;
-constexpr static size_t kSSVHeaderV8VersionTagOffset = 3;
+constexpr static size_t kSSVHeaderBlinkVersionTagOffset = 0;
+constexpr static size_t kSSVHeaderBlinkVersionOffset = 1;
+constexpr static size_t kSSVHeaderV8VersionTagOffset = 2;
+constexpr static size_t kSSVHeaderV8VersionOffset = 3;
// 13 is v8::internal::kLatestVersion in v8/src/value-serializer.cc at the
// time when this test was written. Unlike Blink, V8 does not currently export
@@ -159,16 +159,16 @@ void serializeV8Value(v8::Local<v8::Value> value,
// 0xFF.
const unsigned char* wireData =
reinterpret_cast<unsigned char*>(wireBytes->data());
+ ASSERT_EQ(static_cast<unsigned char>(VersionTag),
+ wireData[kSSVHeaderBlinkVersionTagOffset]);
ASSERT_EQ(
static_cast<unsigned char>(SerializedScriptValue::wireFormatVersion),
wireData[kSSVHeaderBlinkVersionOffset]);
- ASSERT_EQ(static_cast<unsigned char>(VersionTag),
- wireData[kSSVHeaderBlinkVersionTagOffset]);
- ASSERT_GE(static_cast<unsigned char>(kV8LatestKnownVersion),
- wireData[kSSVHeaderV8VersionOffset]);
ASSERT_EQ(static_cast<unsigned char>(VersionTag),
wireData[kSSVHeaderV8VersionTagOffset]);
+ ASSERT_GE(static_cast<unsigned char>(kV8LatestKnownVersion),
+ wireData[kSSVHeaderV8VersionOffset]);
}
PassRefPtr<IDBValue> createIDBValue(v8::Isolate* isolate,

Powered by Google App Engine
This is Rietveld 408576698