refactor: native_mate => gin (cookies API) (#18036)
* convert cookie converters to gin * event_emitter GetWrapper
This commit is contained in:
parent
e9d88e965e
commit
fdf5f838f4
5 changed files with 36 additions and 21 deletions
|
@ -28,6 +28,15 @@ v8::Local<v8::Object> WrappableBase::GetWrapper() const {
|
|||
return v8::Local<v8::Object>();
|
||||
}
|
||||
|
||||
v8::MaybeLocal<v8::Object> WrappableBase::GetWrapper(
|
||||
v8::Isolate* isolate) const {
|
||||
if (!wrapper_.IsEmpty())
|
||||
return v8::MaybeLocal<v8::Object>(
|
||||
v8::Local<v8::Object>::New(isolate, wrapper_));
|
||||
else
|
||||
return v8::MaybeLocal<v8::Object>();
|
||||
}
|
||||
|
||||
void WrappableBase::InitWith(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> wrapper) {
|
||||
CHECK(wrapper_.IsEmpty());
|
||||
|
|
|
@ -30,6 +30,7 @@ class WrappableBase {
|
|||
|
||||
// Retrieve the v8 wrapper object cooresponding to this object.
|
||||
v8::Local<v8::Object> GetWrapper() const;
|
||||
v8::MaybeLocal<v8::Object> GetWrapper(v8::Isolate* isolate) const;
|
||||
|
||||
// Returns the Isolate this object is created in.
|
||||
v8::Isolate* isolate() const { return isolate_; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue