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

Side by Side Diff: src/api.cc

Issue 2722213002: [ValueSerializer] Allow wire format versions beginning with 13 to be deserialized in non-legacy mod… (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 i::MessageTemplate::kDataCloneDeserializationError)); 3266 i::MessageTemplate::kDataCloneDeserializationError));
3267 has_pending_exception = true; 3267 has_pending_exception = true;
3268 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3268 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3269 } 3269 }
3270 3270
3271 bool read_header = false; 3271 bool read_header = false;
3272 has_pending_exception = !private_->deserializer.ReadHeader().To(&read_header); 3272 has_pending_exception = !private_->deserializer.ReadHeader().To(&read_header);
3273 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3273 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3274 DCHECK(read_header); 3274 DCHECK(read_header);
3275 3275
3276 // TODO(jbroman): Today, all wire formats are "legacy". When a more supported 3276 static const uint32_t kMinimumNonLegacyVersion = 13;
3277 // format is added, compare the version of the internal serializer to the 3277 if (GetWireFormatVersion() < kMinimumNonLegacyVersion &&
3278 // minimum non-legacy version number. 3278 !private_->supports_legacy_wire_format) {
3279 if (!private_->supports_legacy_wire_format) {
3280 isolate->Throw(*isolate->factory()->NewError( 3279 isolate->Throw(*isolate->factory()->NewError(
3281 i::MessageTemplate::kDataCloneDeserializationVersionError)); 3280 i::MessageTemplate::kDataCloneDeserializationVersionError));
3282 has_pending_exception = true; 3281 has_pending_exception = true;
3283 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3282 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3284 } 3283 }
3285 3284
3286 return Just(true); 3285 return Just(true);
3287 } 3286 }
3288 3287
3289 void ValueDeserializer::SetSupportsLegacyWireFormat( 3288 void ValueDeserializer::SetSupportsLegacyWireFormat(
(...skipping 6990 matching lines...) Expand 10 before | Expand all | Expand 10 after
10280 Address callback_address = 10279 Address callback_address =
10281 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10280 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10282 VMState<EXTERNAL> state(isolate); 10281 VMState<EXTERNAL> state(isolate);
10283 ExternalCallbackScope call_scope(isolate, callback_address); 10282 ExternalCallbackScope call_scope(isolate, callback_address);
10284 callback(info); 10283 callback(info);
10285 } 10284 }
10286 10285
10287 10286
10288 } // namespace internal 10287 } // namespace internal
10289 } // namespace v8 10288 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698