|
|
@@ -517,28 +517,29 @@ namespace Chromium {
|
|
|
return;
|
|
|
*/
|
|
|
auto openRet = CModTools::get_mutable_instance().StartChromiumBrowser(ERR_PAGE_REASON::Install);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("open page install %s, pid:%d", Error_Succeed == openRet.first ? "success" : "fail", openRet.second);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("open page install %s, pid:%d",
|
|
|
+ Error_Succeed == openRet.first ? "success" : "fail", openRet.second);
|
|
|
+ }
|
|
|
+
|
|
|
+ void CChromiumEntity::openStartupPage()
|
|
|
+ {
|
|
|
+ auto openRet = CModTools::get_mutable_instance().StartChromiumBrowser(ERR_PAGE_REASON::startup);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("open page startup %s, pid:%d",
|
|
|
+ Error_Succeed == openRet.first ? "success" : "fail", openRet.second);
|
|
|
+ }
|
|
|
+ void CChromiumEntity::openPerformanceMonitorPage()
|
|
|
+ {
|
|
|
+ auto openRet = CModTools::get_mutable_instance().StartChromiumBrowser(ERR_PAGE_REASON::performance_monitor);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("open page performance_monitor %s, pid:%d",
|
|
|
+ Error_Succeed == openRet.first ? "success" : "fail", openRet.second);
|
|
|
}
|
|
|
|
|
|
|
|
|
void CChromiumEntity::startWithCfg()
|
|
|
{
|
|
|
- // init cef logger first
|
|
|
-#if (defined _WIN32 || defined _WIN64)
|
|
|
- if (!logProducer)
|
|
|
- logProducer = create_log_producer_storage("cefclient_logger", "0", "");
|
|
|
-#else
|
|
|
- CSimpleString dbgPath;
|
|
|
- GetFunction()->GetPath("Dbg", dbgPath);
|
|
|
- std::string dstDbgPath = dbgPath.GetData();
|
|
|
- dstDbgPath.append(SPLIT_SLASH_STR).append("mod_chromium");
|
|
|
-
|
|
|
-#endif
|
|
|
-
|
|
|
OnPreStart_Init(m_strArgs, m_pTransactionContext);//初始化部分, perf ,killchromium, signal, get custom url
|
|
|
- if (!OnPreStart_socketStart(m_strArgs, m_pTransactionContext)) {//OnPreStart_socketStart()->new CWebsocketServer(strStructPath, this) 时间过长
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
if (!IsConfigMode()) {
|
|
|
if (!OnPreStart_register(m_strArgs, m_pTransactionContext)) {
|
|
|
return;
|
|
|
@@ -611,11 +612,29 @@ namespace Chromium {
|
|
|
|
|
|
//all the init,register,openWeb run thread
|
|
|
auto startFun = [&]() {
|
|
|
+ // init cef logger first
|
|
|
+#if (defined _WIN32 || defined _WIN64)
|
|
|
+ if (!logProducer)
|
|
|
+ logProducer = create_log_producer_storage("cefclient_logger", "0", "");
|
|
|
+#else
|
|
|
+ CSimpleString dbgPath;
|
|
|
+ GetFunction()->GetPath("Dbg", dbgPath);
|
|
|
+ std::string dstDbgPath = dbgPath.GetData();
|
|
|
+ dstDbgPath.append(SPLIT_SLASH_STR).append("mod_chromium");
|
|
|
+
|
|
|
+#endif
|
|
|
+ OnPreStart_Init(m_strArgs, m_pTransactionContext);//初始化部分, perf ,killchromium, signal, get custom url
|
|
|
+ if (!OnPreStart_socketStart(m_strArgs, m_pTransactionContext)) {//OnPreStart_socketStart()->new CWebsocketServer(strStructPath, this) 时间过长
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//the system info may be not complete.If the device is not install ,it can't not read the terminalNo.
|
|
|
CSystemStaticInfo t_sysInfo;
|
|
|
GetFunction()->GetSystemStaticInfo(t_sysInfo);
|
|
|
if (t_sysInfo.strTerminalID.GetLength() == 0)// the machine is in install mode, hence start a simple init and open the install page
|
|
|
{
|
|
|
+ openStartupPage();//open startup page in install mode
|
|
|
m_installMode = true;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("subscribe VtmLoader %s",
|
|
|
(Error_Succeed == GetFunction()->SubscribeLog(m_uuidVTMLoader, this, Log_Event, Severity_None, Error_IgnoreAll, -1, "VtmLoader")) ? "success" : "failed");
|
|
|
@@ -624,29 +643,32 @@ namespace Chromium {
|
|
|
}
|
|
|
|
|
|
|
|
|
- CSimpleStringA t_terminalState;
|
|
|
- if (ErrorCodeEnum::Error_Succeed == GetFunction()->GetSysVar("TerminalStage", t_terminalState))
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnPreStart TerminalStage:%s", t_terminalState.GetData());
|
|
|
- CAutoArray<CSimpleStringA> strErrorCodeArr;
|
|
|
- CAutoArray<CSimpleStringA> strDescriptionArr;
|
|
|
- CAutoArray<CSimpleStringA> strRemarkArr;
|
|
|
- auto ret = GetFunction()->GetPrivilegeFunction()->GetVTMErrMsgArr(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
- if (Error_Succeed == ret)
|
|
|
- InitUserCodeToMsgTip(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
-
|
|
|
- if (m_withSpecialTest)
|
|
|
+ CSimpleStringA t_terminalState;
|
|
|
+ if (ErrorCodeEnum::Error_Succeed == GetFunction()->GetSysVar("TerminalStage", t_terminalState))
|
|
|
{
|
|
|
- CSimpleStringA strDescription, strVTMCode;
|
|
|
- GetFunction()->GetVTMErrMsg(123456, strDescription, strVTMCode);
|
|
|
- }
|
|
|
-
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnPreStart TerminalStage:%s", t_terminalState.GetData());
|
|
|
+ CAutoArray<CSimpleStringA> strErrorCodeArr;
|
|
|
+ CAutoArray<CSimpleStringA> strDescriptionArr;
|
|
|
+ CAutoArray<CSimpleStringA> strRemarkArr;
|
|
|
+ auto ret = GetFunction()->GetPrivilegeFunction()->GetVTMErrMsgArr(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
+ if (Error_Succeed == ret)
|
|
|
+ InitUserCodeToMsgTip(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
|
|
|
- startWithCfg();//属于chromium重启或者其他情况,已经初始化好配置
|
|
|
- }
|
|
|
- else
|
|
|
+ if (m_withSpecialTest)
|
|
|
+ {
|
|
|
+ CSimpleStringA strDescription, strVTMCode;
|
|
|
+ GetFunction()->GetVTMErrMsg(123456, strDescription, strVTMCode);
|
|
|
+ }
|
|
|
+ //should not open startup page, since it is already run before.
|
|
|
+ startWithCfg();//属于chromium重启或者其他情况,已经初始化好配置
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ openStartupPage();//open startup page in normal mode
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("subscribe VtmLoader %s",
|
|
|
- (Error_Succeed == GetFunction()->SubscribeLog(m_uuidVTMLoader, this, Log_Event, Severity_None, Error_IgnoreAll, -1, "VtmLoader")) ? "success" : "failed");
|
|
|
+ (Error_Succeed == GetFunction()->SubscribeLog(m_uuidVTMLoader, this, Log_Event, Severity_None, Error_IgnoreAll, -1, "VtmLoader")) ? "success" : "failed");
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
|
|
|
boost::thread(startFun).detach();
|