feat: add support for Blob's going over the ctx bridge (#29247)
This commit is contained in:
parent
d0b9a931cc
commit
f01e35f4ea
3 changed files with 41 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/world_ids.h"
|
||||
#include "third_party/blink/public/web/web_blob.h"
|
||||
#include "third_party/blink/public/web/web_element.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
|
||||
|
@ -346,6 +347,14 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|||
destination_context->Global(), destination_context->GetIsolate()));
|
||||
}
|
||||
|
||||
// Custom logic to "clone" Blob references
|
||||
blink::WebBlob blob = blink::WebBlob::FromV8Value(value);
|
||||
if (!blob.IsNull()) {
|
||||
v8::Context::Scope destination_context_scope(destination_context);
|
||||
return v8::MaybeLocal<v8::Value>(blob.ToV8Value(
|
||||
destination_context->Global(), destination_context->GetIsolate()));
|
||||
}
|
||||
|
||||
// Proxy all objects
|
||||
if (IsPlainObject(value)) {
|
||||
auto object_value = value.As<v8::Object>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue