refactor: native_mate => gin (cookies API) (#18036)

* convert cookie converters to gin

* event_emitter GetWrapper
This commit is contained in:
Jeremy Apthorp 2019-04-30 06:45:05 -07:00 committed by John Kleinschmidt
parent e9d88e965e
commit fdf5f838f4
5 changed files with 36 additions and 21 deletions

View file

@ -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());

View file

@ -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_; }