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

Side by Side Diff: src/value-serializer.cc

Issue 2772723005: Export the current data format version used by ValueSerializer. (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 unified diff | Download patch
« no previous file with comments | « src/value-serializer.h ('k') | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/value-serializer.h" 5 #include "src/value-serializer.h"
6 6
7 #include <type_traits> 7 #include <type_traits>
8 8
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 kFloat64Array = 'F', 147 kFloat64Array = 'F',
148 kDataView = '?', 148 kDataView = '?',
149 }; 149 };
150 150
151 enum class WasmEncodingTag : uint8_t { 151 enum class WasmEncodingTag : uint8_t {
152 kRawBytes = 'y', 152 kRawBytes = 'y',
153 }; 153 };
154 154
155 } // namespace 155 } // namespace
156 156
157 // static
158 uint32_t ValueSerializer::GetCurrentDataFormatVersion() {
159 return kLatestVersion;
160 }
161
157 ValueSerializer::ValueSerializer(Isolate* isolate, 162 ValueSerializer::ValueSerializer(Isolate* isolate,
158 v8::ValueSerializer::Delegate* delegate) 163 v8::ValueSerializer::Delegate* delegate)
159 : isolate_(isolate), 164 : isolate_(isolate),
160 delegate_(delegate), 165 delegate_(delegate),
161 zone_(isolate->allocator(), ZONE_NAME), 166 zone_(isolate->allocator(), ZONE_NAME),
162 id_map_(isolate->heap(), ZoneAllocationPolicy(&zone_)), 167 id_map_(isolate->heap(), ZoneAllocationPolicy(&zone_)),
163 array_buffer_transfer_map_(isolate->heap(), 168 array_buffer_transfer_map_(isolate->heap(),
164 ZoneAllocationPolicy(&zone_)) {} 169 ZoneAllocationPolicy(&zone_)) {}
165 170
166 ValueSerializer::~ValueSerializer() { 171 ValueSerializer::~ValueSerializer() {
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 if (stack.size() != 1) { 2014 if (stack.size() != 1) {
2010 isolate_->Throw(*isolate_->factory()->NewError( 2015 isolate_->Throw(*isolate_->factory()->NewError(
2011 MessageTemplate::kDataCloneDeserializationError)); 2016 MessageTemplate::kDataCloneDeserializationError));
2012 return MaybeHandle<Object>(); 2017 return MaybeHandle<Object>();
2013 } 2018 }
2014 return scope.CloseAndEscape(stack[0]); 2019 return scope.CloseAndEscape(stack[0]);
2015 } 2020 }
2016 2021
2017 } // namespace internal 2022 } // namespace internal
2018 } // namespace v8 2023 } // namespace v8
OLDNEW
« 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