mirror of
https://github.com/electron/electron.git
synced 2026-02-17 02:21:37 -05:00
refactor: native_mate => gin (cookies API) (#18036)
* convert cookie converters to gin * event_emitter GetWrapper
This commit is contained in:
committed by
John Kleinschmidt
parent
e9d88e965e
commit
fdf5f838f4
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user