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

Unified Diff: src/api.cc

Issue 2768923002: WIP: Allow ValueSerializer clients to transfer long strings out of band.
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/value-serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index c7ec5722e4f6e52c89fe8355cd4f9a130df9737e..2804e95f316adfc32689d51dbee508b4100ce503 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3130,6 +3130,15 @@ Maybe<uint32_t> ValueSerializer::Delegate::GetWasmModuleTransferId(
return Nothing<uint32_t>();
}
+Maybe<uint32_t> ValueSerializer::Delegate::GetLongStringId(
+ Isolate* v8_isolate, Local<String> string) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ isolate->ScheduleThrow(*isolate->factory()->NewError(
+ isolate->error_function(), i::MessageTemplate::kDataCloneError,
+ Utils::OpenHandle(*string)));
+ return Nothing<uint32_t>();
+}
+
void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer,
size_t size,
size_t* actual_size) {
@@ -3163,6 +3172,10 @@ void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
private_->serializer.SetTreatArrayBufferViewsAsHostObjects(mode);
}
+void ValueSerializer::SetMinimumLongStringLength(int length) {
+ private_->serializer.SetMinimumLongStringLength(length);
+}
+
Maybe<bool> ValueSerializer::WriteValue(Local<Context> context,
Local<Value> value) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, ValueSerializer, WriteValue, bool);
@@ -3328,6 +3341,13 @@ void ValueDeserializer::TransferSharedArrayBuffer(
transfer_id, Utils::OpenHandle(*shared_array_buffer));
}
+void ValueDeserializer::TransferLongString(uint32_t transfer_id,
+ Local<String> string) {
+ CHECK(!private_->has_aborted);
+ private_->deserializer.TransferLongString(transfer_id,
+ Utils::OpenHandle(*string));
+}
+
bool ValueDeserializer::ReadUint32(uint32_t* value) {
return private_->deserializer.ReadUint32(value);
}
« no previous file with comments | « include/v8.h ('k') | src/value-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698