|
@@ -23,6 +23,7 @@
|
|
|
#include "../mod_upload/Upload_client_g.h"
|
|
|
#include <tuple>
|
|
|
#include <string>
|
|
|
+#include <algorithm>
|
|
|
#include "EventCode.h"
|
|
|
#ifdef OPEN_PERF
|
|
|
#include <gperftools/profiler.h>
|
|
@@ -380,7 +381,7 @@ namespace Chromium {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- bool CChromiumEntity::OnPreStart_openWeb(CAutoArray<CSimpleStringA>& strArgs, CSmartPointer<ITransactionContext>& pTransactionContext)
|
|
|
+ bool CChromiumEntity::OnPreStart_openWeb()
|
|
|
{
|
|
|
//generateBussinessLimitTimer();
|
|
|
#if (defined _WIN32 || defined _WIN64)
|
|
@@ -459,7 +460,7 @@ namespace Chromium {
|
|
|
if (!OnPreStart_register(strArgs, pTransactionContext)) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!OnPreStart_openWeb(strArgs, pTransactionContext)) {
|
|
|
+ if (!OnPreStart_openWeb()) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -742,16 +743,38 @@ namespace Chromium {
|
|
|
DbgEx("OnBrowserCacheClean get cache path err, %d", error);
|
|
|
return;
|
|
|
}
|
|
|
+#if (defined _WIN32 || defined _WIN64)
|
|
|
CModTools::get_mutable_instance().lockGuard();
|
|
|
CModTools::get_mutable_instance().StopChromiumBrowser(ERR_PAGE_REASON::breakdown, true);//close all tab
|
|
|
auto tmpDirArr = find_files(tmpCacheDir.GetData(), "cefCache*", true);
|
|
|
|
|
|
- for(auto it = tmpDirArr.begin(); it != tmpDirArr.end(); it++)
|
|
|
+ for (auto it = tmpDirArr.begin(); it != tmpDirArr.end(); it++)
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_CHROMIUM_BROWSER_CACHE_CLEAER, CSimpleStringA::Format("clear chromium browser cache %s %s", it->c_str(),
|
|
|
RemoveDirRecursive(it->c_str()) ? "success" : "fail"));
|
|
|
|
|
|
CModTools::get_mutable_instance().unlockGuard();
|
|
|
+#else
|
|
|
+ //uos 由于无guard,需要重启整个chromium实体
|
|
|
+ CModTools::get_mutable_instance().killAllChromium();
|
|
|
+ auto tmpDirArr = find_files(tmpCacheDir.GetData(), "cefCache*", true);
|
|
|
+ auto uosTmpDirArr = find_files(tmpCacheDir.GetData(), "UOSBrowser*", true);
|
|
|
+ std::for_each(uosTmpDirArr.begin(), uosTmpDirArr.end(), [&](std::string tmp) {
|
|
|
+ tmpDirArr.push_back(tmp);
|
|
|
+ });//insert uosTmpDirArr into tmpDirArr
|
|
|
+
|
|
|
+ for (auto it = tmpDirArr.begin(); it != tmpDirArr.end(); it++)
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_CHROMIUM_BROWSER_CACHE_CLEAER, CSimpleStringA::Format("clear chromium browser cache %s %s", it->c_str(),
|
|
|
+ RemoveDirRecursive(it->c_str()) ? "success" : "fail"));
|
|
|
+
|
|
|
+ if (m_pTimerListener != NULL)
|
|
|
+ {
|
|
|
+ GetFunction()->KillTimer(CHROMIUM_TIMER_ID);
|
|
|
+ delete m_pTimerListener;
|
|
|
+ m_pTimerListener = NULL;
|
|
|
+ }
|
|
|
+ OnPreStart_openWeb();//重新调用open web
|
|
|
|
|
|
+#endif
|
|
|
}
|
|
|
void CChromiumEntity::generateCefclientTimer()
|
|
|
{
|