Skip to content

Commit

Permalink
update to Chromium 128.0.6613.27
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Aug 14, 2024
1 parent c971425 commit 8d6adf7
Show file tree
Hide file tree
Showing 60 changed files with 453 additions and 507 deletions.
4 changes: 2 additions & 2 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ void MyObject::New(const FunctionCallbackInfo<Value>& args) {
void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();

MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder());
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This());
obj->value_ += 1;

args.GetReturnValue().Set(Number::New(isolate, obj->value_));
Expand Down Expand Up @@ -1138,7 +1138,7 @@ void MyObject::NewInstance(const FunctionCallbackInfo<Value>& args) {
void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();

MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder());
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This());
obj->value_ += 1;

args.GetReturnValue().Set(Number::New(isolate, obj->value_));
Expand Down
6 changes: 2 additions & 4 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ Node.js source code.)

`args[n]` is a `Local<Value>` that represents the n-th argument passed to the
function. `args.This()` is the `this` value inside this function call.
`args.Holder()` is equivalent to `args.This()` in all use cases inside of
Node.js.

`args.GetReturnValue()` is a placeholder for the return value of the function,
and provides a `.Set()` method that can be called with a boolean, integer,
Expand Down Expand Up @@ -829,7 +827,7 @@ The JavaScript object can be accessed as a `v8::Local<v8::Object>` by using
`self->object()`, given a `BaseObject` named `self`.

Accessing a `BaseObject` from a `v8::Local<v8::Object>` (frequently that is
`args.This()` or `args.Holder()` in a [binding function][]) can be done using
`args.This()` in a [binding function][]) can be done using
the `Unwrap<T>(obj)` function, where `T` is a subclass of `BaseObject`.
A helper for this is the `ASSIGN_OR_RETURN_UNWRAP` macro that returns from the
current function if unwrapping fails (typically that means that the `BaseObject`
Expand All @@ -838,7 +836,7 @@ has been deleted earlier).
```cpp
void Http2Session::Request(const FunctionCallbackInfo<Value>& args) {
Http2Session* session;
ASSIGN_OR_RETURN_UNWRAP(&session, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&session, args.This());
Environment* env = session->env();
Local<Context> context = env->context();
Isolate* isolate = env->isolate();
Expand Down
6 changes: 3 additions & 3 deletions src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static void RegisterDestroyHook(const FunctionCallbackInfo<Value>& args) {
void AsyncWrap::GetAsyncId(const FunctionCallbackInfo<Value>& args) {
AsyncWrap* wrap;
args.GetReturnValue().Set(kInvalidAsyncId);
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());
args.GetReturnValue().Set(wrap->get_async_id());
}

Expand Down Expand Up @@ -299,7 +299,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsObject());

AsyncWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());

Local<Object> resource = args[0].As<Object>();
double execution_async_id =
Expand All @@ -311,7 +311,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) {
void AsyncWrap::GetProviderType(const FunctionCallbackInfo<Value>& args) {
AsyncWrap* wrap;
args.GetReturnValue().Set(AsyncWrap::PROVIDER_NONE);
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());
args.GetReturnValue().Set(wrap->provider_type());
}

Expand Down
15 changes: 7 additions & 8 deletions src/base_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,18 @@ v8::EmbedderGraph::Node::Detachedness BaseObject::GetDetachedness() const {

template <int Field>
void BaseObject::InternalFieldGet(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
info.GetReturnValue().Set(
info.This()->GetInternalField(Field).As<v8::Value>());
const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(
args.This()->GetInternalField(Field).As<v8::Value>());
}

template <int Field, bool (v8::Value::*typecheck)() const>
void BaseObject::InternalFieldSet(v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
void BaseObject::InternalFieldSet(
const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Local<v8::Value> value = args[0];
// This could be e.g. value->IsFunction().
CHECK(((*value)->*typecheck)());
info.This()->SetInternalField(Field, value);
args.This()->SetInternalField(Field, value);
}

bool BaseObject::has_pointer_data() const {
Expand Down
7 changes: 2 additions & 5 deletions src/base_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ class BaseObject : public MemoryRetainer {

// Setter/Getter pair for internal fields that can be passed to SetAccessor.
template <int Field>
static void InternalFieldGet(v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info);
static void InternalFieldGet(const v8::FunctionCallbackInfo<v8::Value>& args);
template <int Field, bool (v8::Value::*typecheck)() const>
static void InternalFieldSet(v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info);
static void InternalFieldSet(const v8::FunctionCallbackInfo<v8::Value>& args);

// This is a bit of a hack. See the override in async_wrap.cc for details.
virtual bool IsDoneInitializing() const;
Expand Down
10 changes: 5 additions & 5 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ template <class Wrap>
static void Query(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
ChannelWrap* channel;
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());

CHECK_EQ(false, args.IsConstructCall());
CHECK(args[0]->IsObject());
Expand Down Expand Up @@ -1664,7 +1664,7 @@ void GetNameInfo(const FunctionCallbackInfo<Value>& args) {
void GetServers(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
ChannelWrap* channel;
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());

Local<Array> server_array = Array::New(env->isolate());

Expand Down Expand Up @@ -1702,7 +1702,7 @@ void GetServers(const FunctionCallbackInfo<Value>& args) {
void SetServers(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
ChannelWrap* channel;
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());

if (channel->active_query_count()) {
return args.GetReturnValue().Set(DNS_ESETSRVPENDING);
Expand Down Expand Up @@ -1783,7 +1783,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) {
void SetLocalAddress(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
ChannelWrap* channel;
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());

CHECK_EQ(args.Length(), 2);
CHECK(args[0]->IsString());
Expand Down Expand Up @@ -1846,7 +1846,7 @@ void SetLocalAddress(const FunctionCallbackInfo<Value>& args) {

void Cancel(const FunctionCallbackInfo<Value>& args) {
ChannelWrap* channel;
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());

TRACE_EVENT_INSTANT0(TRACING_CATEGORY_NODE2(dns, native),
"cancel", TRACE_EVENT_SCOPE_THREAD);
Expand Down
14 changes: 7 additions & 7 deletions src/crypto/crypto_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void CipherBase::Init(const char* cipher_type,

void CipherBase::Init(const FunctionCallbackInfo<Value>& args) {
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
Environment* env = Environment::GetCurrent(args);

CHECK_GE(args.Length(), 3);
Expand Down Expand Up @@ -510,7 +510,7 @@ void CipherBase::InitIv(const char* cipher_type,

void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
Environment* env = cipher->env();

CHECK_GE(args.Length(), 4);
Expand Down Expand Up @@ -645,7 +645,7 @@ bool CipherBase::IsAuthenticatedMode() const {
void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());

// Only callable after Final and if encrypting.
if (cipher->ctx_ ||
Expand All @@ -661,7 +661,7 @@ void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) {

void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
Environment* env = Environment::GetCurrent(args);

if (!cipher->ctx_ ||
Expand Down Expand Up @@ -774,7 +774,7 @@ bool CipherBase::SetAAD(

void CipherBase::SetAAD(const FunctionCallbackInfo<Value>& args) {
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
Environment* env = Environment::GetCurrent(args);

CHECK_EQ(args.Length(), 2);
Expand Down Expand Up @@ -887,7 +887,7 @@ bool CipherBase::SetAutoPadding(bool auto_padding) {

void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) {
CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());

bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->IsTrue());
args.GetReturnValue().Set(b); // Possibly report invalid state failure
Expand Down Expand Up @@ -962,7 +962,7 @@ void CipherBase::Final(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);

CipherBase* cipher;
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
if (cipher->ctx_ == nullptr)
return THROW_ERR_CRYPTO_INVALID_STATE(env);

Expand Down
Loading

0 comments on commit 8d6adf7

Please sign in to comment.