Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions modules/packages/device-api/src/Extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ ESPostListener::ESPostListener(Escargot::ContextRef* context,
Escargot::ObjectRef* listener)
: context_(context), listener_(listener) {
DEVICEAPI_LOG_INFO("Enter");
GC_add_roots(&listener_, &listener_ + sizeof(Escargot::ObjectRef*));
}

ESPostListener::~ESPostListener() {
Expand All @@ -222,7 +221,6 @@ ESPostListener::~ESPostListener() {

void ESPostListener::finalize() {
DEVICEAPI_LOG_INFO("Enter");
GC_remove_roots(&listener_, &listener_ + sizeof(Escargot::ObjectRef*));
listener_ = nullptr;
context_ = nullptr;
}
Expand Down
11 changes: 6 additions & 5 deletions modules/packages/device-api/src/Extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#ifndef WRT_SERVICE_NODE_EXTENSION_H_
#define WRT_SERVICE_NODE_EXTENSION_H_

#include <GCUtil.h>
#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "XW_Extension.h"
#include "XW_Extension_SyncMessage.h"
Expand Down Expand Up @@ -203,12 +204,12 @@ class ESPostListener {
};

class ESPostMessageListener : public wrt::xwalk::PostMessageListener,
public ESPostListener {
public ESPostListener, public gc {
public:
static ESPostMessageListener* create(Escargot::ContextRef* context,
Escargot::ObjectRef* listener)
{
return new ESPostMessageListener(context, listener);
return new (NoGC)ESPostMessageListener(context, listener);
}
void PostMessageToJS(const std::string& msg);

Expand All @@ -232,12 +233,12 @@ class ESPostMessageListener : public wrt::xwalk::PostMessageListener,
};

class ESPostDataListener : public wrt::xwalk::PostDataListener,
public ESPostListener {
public ESPostListener, public gc {
public:
static ESPostDataListener* create(Escargot::ContextRef* context,
Escargot::ObjectRef* listener)
{
return new ESPostDataListener(context, listener);
return new (NoGC)ESPostDataListener(context, listener);
}
void PostDataToJS(const std::string& msg, uint8_t* buffer, size_t len);

Expand Down