chore: bump chromium to 104.0.5073.0 (main) (#34272)
This commit is contained in:
parent
3849d19e14
commit
470396d6ac
112 changed files with 663 additions and 589 deletions
|
@ -271,9 +271,11 @@ std::string NativeImage::ToDataURL(gin::Arguments* args) {
|
|||
image_.AsImageSkia().GetRepresentation(scale_factor).GetBitmap());
|
||||
}
|
||||
|
||||
#if !defined(V8_SANDBOX)
|
||||
void SkUnref(char* data, void* hint) {
|
||||
reinterpret_cast<SkRefCnt*>(hint)->unref();
|
||||
}
|
||||
#endif
|
||||
|
||||
v8::Local<v8::Value> NativeImage::GetBitmap(gin::Arguments* args) {
|
||||
float scale_factor = GetScaleFactorFromOptions(args);
|
||||
|
@ -283,11 +285,18 @@ v8::Local<v8::Value> NativeImage::GetBitmap(gin::Arguments* args) {
|
|||
SkPixelRef* ref = bitmap.pixelRef();
|
||||
if (!ref)
|
||||
return node::Buffer::New(args->isolate(), 0).ToLocalChecked();
|
||||
#if defined(V8_SANDBOX)
|
||||
return node::Buffer::Copy(args->isolate(),
|
||||
reinterpret_cast<char*>(ref->pixels()),
|
||||
bitmap.computeByteSize())
|
||||
.ToLocalChecked();
|
||||
#else
|
||||
ref->ref();
|
||||
return node::Buffer::New(args->isolate(),
|
||||
reinterpret_cast<char*>(ref->pixels()),
|
||||
bitmap.computeByteSize(), &SkUnref, ref)
|
||||
.ToLocalChecked();
|
||||
#endif
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> NativeImage::GetNativeHandle(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue