Changeset View
Changeset View
Standalone View
Standalone View
source/scriptinterface/ScriptInterface.cpp
Show First 20 Lines • Show All 1,097 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void* ScriptInterface::GetPrivate(JS::HandleObject obj) | void* ScriptInterface::GetPrivate(JS::HandleObject obj) | ||||
{ | { | ||||
// TODO: use JS_GetInstancePrivate | // TODO: use JS_GetInstancePrivate | ||||
return JS_GetPrivate(obj); | return JS_GetPrivate(obj); | ||||
} | } | ||||
JS::Value ScriptInterface::CloneValueFromOtherContext(const ScriptInterface& otherContext, JS::HandleValue val) const | JS::Value ScriptInterface::CloneValueFromOtherContext(const ScriptInterface& otherScriptInterface, JS::HandleValue val) const | ||||
{ | { | ||||
PROFILE("CloneValueFromOtherContext"); | PROFILE("CloneValueFromOtherContext"); | ||||
JSAutoRequest rq(m->m_cx); | JSAutoRequest rq(m->m_cx); | ||||
JS::RootedValue out(m->m_cx); | JS::RootedValue out(m->m_cx); | ||||
shared_ptr<StructuredClone> structuredClone = otherContext.WriteStructuredClone(val); | shared_ptr<StructuredClone> structuredClone = otherScriptInterface.WriteStructuredClone(val); | ||||
ReadStructuredClone(structuredClone, &out); | ReadStructuredClone(structuredClone, &out); | ||||
return out.get(); | return out.get(); | ||||
} | } | ||||
ScriptInterface::StructuredClone::StructuredClone() : | ScriptInterface::StructuredClone::StructuredClone() : | ||||
m_Data(NULL), m_Size(0) | m_Data(NULL), m_Size(0) | ||||
{ | { | ||||
} | } | ||||
Show All 29 Lines |
Wildfire Games · Phabricator