Skip to content

Commit

Permalink
* WebThreadImpl::shutdown增加stopSharedTimer。不然游戏加加那边提供的delphi demo通不过
Browse files Browse the repository at this point in the history
* BlinkPlatformImpl::shutdown增加freeV8TempObejctOnOneFrameBefore。也是游戏加加反馈的。不过此处存疑,因为当时是怀疑这里会
导致绑定的js对象释放不了。但后来发现是另外个地方导致。
* 垃圾回收时间改成5秒一次
  • Loading branch information
weolar committed May 21, 2018
1 parent e8cfd08 commit 93482a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions content/web_impl_win/BlinkPlatformImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "gin/public/isolate_holder.h"
#include "gin/array_buffer.h"
#include "net/WebURLLoaderManager.h"
#include "wke/wkeJsBindFreeTempObject.h"

DWORD g_paintToMemoryCanvasInUiThreadCount = 0;
DWORD g_rasterTaskCount = 0;
Expand Down Expand Up @@ -143,7 +144,7 @@ static void setRuntimeEnabledFeatures()
blink::RuntimeEnabledFeatures::setMemoryCacheEnabled(true);
blink::RuntimeEnabledFeatures::setCspCheckEnabled(true);
blink::RuntimeEnabledFeatures::setNpapiPluginsEnabled(true);
}
}

void BlinkPlatformImpl::initialize()
{
Expand Down Expand Up @@ -172,7 +173,7 @@ void BlinkPlatformImpl::initialize()
SkGraphics::SetResourceCacheSingleAllocationByteLimit(kImageCacheSingleAllocationByteLimit);

platform->m_defaultGcTimer = new blink::Timer<BlinkPlatformImpl>(platform, &BlinkPlatformImpl::garbageCollectedTimer);
platform->m_defaultGcTimer->start(5, 5, FROM_HERE);
platform->m_defaultGcTimer->start(10, 10, FROM_HERE);

// platform->m_perfTimer = new blink::Timer<BlinkPlatformImpl>(platform, &BlinkPlatformImpl::perfTimer);
// platform->m_perfTimer->start(2, 2, FROM_HERE);
Expand Down Expand Up @@ -286,6 +287,7 @@ void BlinkPlatformImpl::preShutdown()

void BlinkPlatformImpl::shutdown()
{
wke::freeV8TempObejctOnOneFrameBefore();
((WebThreadImpl*)currentThread())->fire();

net::WebURLLoaderManager::sharedInstance()->shutdown();
Expand Down
9 changes: 5 additions & 4 deletions content/web_impl_win/WebThreadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ WebThreadImpl::~WebThreadImpl()

void WebThreadImpl::shutdown()
{
stopSharedTimer();
willExit();
waitForExit();
}
Expand Down Expand Up @@ -290,10 +291,10 @@ static std::vector<WebThreadImpl::TaskObserver*>::iterator findObserver(std::vec
return observers.end();
}

class EmptyTask : public blink::WebThread::Task {
public:
virtual ~EmptyTask() override {}
virtual void run() override {};
class EmptyTask : public blink::WebThread::Task {
public:
virtual ~EmptyTask() override {}
virtual void run() override {};
};

void WebThreadImpl::addTaskObserver(TaskObserver* observer)
Expand Down

0 comments on commit 93482a4

Please sign in to comment.