mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
cripple
This commit is contained in:
@ -58,7 +58,7 @@ CV8RealTimeWorker::CV8RealTimeWorker(NSDoctRenderer::CDocBuilder* pBuilder)
|
||||
{
|
||||
m_nFileType = -1;
|
||||
|
||||
m_isolate = CV8Worker::getInitializer()->CreateNew();
|
||||
m_isolate = v8::Isolate::GetCurrent(); // CV8Worker::getInitializer()->CreateNew();
|
||||
|
||||
m_isolate_scope = new v8::Isolate::Scope(m_isolate);
|
||||
m_isolate_locker = new v8::Locker(m_isolate);
|
||||
@ -933,12 +933,12 @@ namespace NSDoctRenderer
|
||||
|
||||
void CDocBuilder::Initialize()
|
||||
{
|
||||
CV8Worker::Initialize();
|
||||
// CV8Worker::Initialize();
|
||||
}
|
||||
|
||||
void CDocBuilder::Dispose()
|
||||
{
|
||||
CV8Worker::Dispose();
|
||||
// CV8Worker::Dispose();
|
||||
}
|
||||
|
||||
void CDocBuilder::WriteData(const wchar_t* path, const wchar_t* value, const bool& append)
|
||||
|
||||
@ -741,7 +741,7 @@ namespace NSDoctRenderer
|
||||
LOGGER_SPEED_START
|
||||
|
||||
bool bIsBreak = false;
|
||||
v8::Isolate* isolate = CV8Worker::getInitializer()->CreateNew();
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent(); // CV8Worker::getInitializer()->CreateNew();
|
||||
if (true)
|
||||
{
|
||||
v8::Isolate::Scope isolate_cope(isolate);
|
||||
|
||||
@ -119,6 +119,7 @@ public:
|
||||
JSSmart<CJSValue> DrawPolygon(JSSmart<CJSValue> oPath, JSSmart<CJSValue> lineWidth, JSSmart<CJSValue> shift);
|
||||
JSSmart<CJSValue> DrawFootnoteRect(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
|
||||
static void CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void CreateObjectInContext(const std::string& name, JSSmart<CJSContext> context);
|
||||
};
|
||||
|
||||
|
||||
@ -322,26 +322,26 @@ namespace NSGraphics
|
||||
|
||||
return handle_scope.Escape(result);
|
||||
}
|
||||
}
|
||||
|
||||
void CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args)
|
||||
{
|
||||
v8::Isolate* isolate = args.GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
void CGraphicsEmbed::CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args)
|
||||
{
|
||||
v8::Isolate* isolate = args.GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
v8::Handle<v8::ObjectTemplate> GraphicsTemplate = NSGraphics::CreateGraphicsTemplate(isolate);
|
||||
CGraphicsEmbed* pGraphics = new CGraphicsEmbed();
|
||||
v8::Handle<v8::ObjectTemplate> GraphicsTemplate = NSGraphics::CreateGraphicsTemplate(isolate);
|
||||
CGraphicsEmbed* pGraphics = new CGraphicsEmbed();
|
||||
|
||||
v8::Local<v8::Object> obj = GraphicsTemplate->NewInstance(isolate->GetCurrentContext()).ToLocalChecked();
|
||||
obj->SetInternalField(0, v8::External::New(CV8Worker::GetCurrent(), pGraphics));
|
||||
v8::Local<v8::Object> obj = GraphicsTemplate->NewInstance(isolate->GetCurrentContext()).ToLocalChecked();
|
||||
obj->SetInternalField(0, v8::External::New(CV8Worker::GetCurrent(), pGraphics));
|
||||
|
||||
args.GetReturnValue().Set(obj);
|
||||
}
|
||||
args.GetReturnValue().Set(obj);
|
||||
}
|
||||
|
||||
void CGraphicsEmbed::CreateObjectInContext(const std::string& name, JSSmart<CJSContext> context)
|
||||
{
|
||||
v8::Isolate* current = CV8Worker::GetCurrent();
|
||||
context->m_internal->m_global->Set(current, name.c_str(), v8::FunctionTemplate::New(current, NSGraphics::CreateNativeGraphics));
|
||||
context->m_internal->m_global->Set(current, name.c_str(), v8::FunctionTemplate::New(current, CreateNativeGraphics));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -621,6 +621,7 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplateBuilder(v8::Isolate* i
|
||||
}
|
||||
// --------------------------
|
||||
|
||||
/*
|
||||
void CV8Worker::Initialize()
|
||||
{
|
||||
if (NULL == m_pInitializer)
|
||||
@ -644,5 +645,5 @@ CV8Initializer* CV8Worker::getInitializer()
|
||||
return CV8Worker::m_pInitializer;
|
||||
}
|
||||
|
||||
CV8Initializer* CV8Worker::m_pInitializer = NULL;
|
||||
CV8Initializer* CV8Worker::m_pInitializer = NULL;*/
|
||||
// --------------------------
|
||||
|
||||
@ -1257,6 +1257,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
class CV8Worker
|
||||
{
|
||||
private:
|
||||
@ -1271,6 +1272,7 @@ public:
|
||||
|
||||
static CV8Initializer* getInitializer();
|
||||
};
|
||||
*/
|
||||
|
||||
bool Doct_renderer_SaveFile_ForBuilder(int nFormat, const std::wstring& strDstFile,
|
||||
CNativeControl* pNative,
|
||||
|
||||
Reference in New Issue
Block a user