Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ option(BUILD_JSRUNTIME_APP "BUILD_JSRUNTIME_APP" ON)
option(ENABLE_JSRUNTIME_SERVER "ENABLE_JSRUNTIME_SERVER" OFF)
option(BUILD_JSRUNTIME_CLIENT "BUILD_JSRUNTIME_CLIENT" OFF)
option(NATIVEJS_DEVELOPER_MODE "NATIVEJS_DEVELOPER_MODE" OFF)
option(ENABLE_JSRUNTIME_LAUNCHER "ENABLE_JSRUNTIME_LAUNCHER" OFF)

#can be jsc or node or v8 or quickjs
option(JSRUNTIME_ENGINE_NAME "JSRUNTIME_ENGINE_NAME" "jsc")
Expand Down Expand Up @@ -106,10 +105,6 @@ set(JSRUNTIME_APP_FILES
${JSRUNTIME_COMMON_SOURCE_DIRECTORY}/jsruntime.cpp
)

set(JSRUNTIME_LAUNCHER_FILES
${JSRUNTIME_COMMON_SOURCE_DIRECTORY}/JSRuntimeLauncher.cpp
)

if ( ENABLE_JSRUNTIME_SERVER )
add_definitions("-DENABLE_JSRUNTIME_SERVER")
add_definitions("-DWS_SERVER_PORT=9112")
Expand Down Expand Up @@ -180,16 +175,6 @@ if (BUILD_JSRUNTIME_CLIENT)
target_link_libraries(jsruntime_client ${JSRUNTIME_LIBRARY_LINK_DIRECTORIES} -lpthread)
endif (BUILD_JSRUNTIME_CLIENT)

if (ENABLE_JSRUNTIME_LAUNCHER)
message("Enabling build support for jsruntime launcher - widget")
add_executable(jsruntime_launcher ${JSRUNTIME_LAUNCHER_FILES})
add_dependencies(${JSRUNTIME_LIBRARY_NAME} ${JSRUNTIME_ENGINE_DEPENDENT_LIBRARY_NAME})
add_dependencies(jsruntime_launcher ${JSRUNTIME_LIBRARY_NAME} ${JSRUNTIME_ENGINE_DEPENDENT_LIBRARY_NAME} )
target_include_directories(jsruntime_launcher PRIVATE ${JSRUNTIME_INCLUDE_DIRECTORIES})
set_target_properties(jsruntime_launcher PROPERTIES OUTPUT_NAME "JSRuntimeLauncher")
target_link_libraries(jsruntime_launcher ${JSRUNTIME_LIBRARY_LINK_DIRECTORIES} -l${JSRUNTIME_LIBRARY_NAME} ${JSRUNTIME_LINK_LIBRARIES})
endif (ENABLE_JSRUNTIME_LAUNCHER)

set(UWEBSOCKETS_TARGET "Linux")
if (APPLE)
set(UWEBSOCKETS_TARGET "Darwin")
Expand Down
249 changes: 0 additions & 249 deletions src/JSRuntimeLauncher.cpp

This file was deleted.

20 changes: 4 additions & 16 deletions src/NativeJSRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ std::list<ApplicationDetails> NativeJSRenderer::getApplications()
ApplicationDetails appData;
appData.id = key;
appData.url = value.url;
NativeJSLogger::log(DEBUG, "Found application with ID: %d and URL: %s\n", key, value.url.c_str());
NativeJSLogger::log(DEBUG, "Found application with ID: %d and URL: %s\n", key, value.url);
runningApplication.push_back(appData);
}
}
Expand Down Expand Up @@ -326,15 +326,9 @@ void NativeJSRenderer::runApplicationInternal(ApplicationRequest& appRequest)
return ;
}
JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context;
#if defined(ENABLE_JSRUNTIME_LAUNCHER)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please retain these changes . Remove macro check ENABLE_JSRUNTIME_LAUNCHER

std::stringstream window;
window<<"window.location = {\"href\":\"" << url << "\"};";
NativeJSLogger::log(INFO, "Adding the window location: %s to js file\n", window.str().c_str());
context->runScript(window.str().c_str(),true, url, nullptr, true);
#endif
NativeJSLogger::log(INFO, "nativeJS application thunder execution url: %s, result: %d\n", url.c_str(), ret ? 1 : 0);
std::cout << "nativeJS application thunder execution url " << url << " result " << ret << std::endl;
ret = context->runScript(chunk.contentsBuffer, true, url, nullptr, true);
NativeJSLogger::log(INFO, "nativeJS application execution result: %d\n", ret ? 1 : 0);
std::cout << "nativeJS application execution result " << ret << std::endl;
double duration = context->getExecutionDuration();
context->setAppdata(id, url);
NativeJSLogger::log(INFO, "Execution duration(runApplicationDuration) for ID %d | URL %s : %.3f ms\n", id, url.c_str(), duration);
Expand All @@ -343,13 +337,7 @@ void NativeJSRenderer::runApplicationInternal(ApplicationRequest& appRequest)
{
NativeJSLogger::log(INFO, "About to launch local app\n");
JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context;
#if defined(ENABLE_JSRUNTIME_LAUNCHER)
std::stringstream window;
window<<"window.location = {\"href\":\"file:/" << url << "\"};";
NativeJSLogger::log(INFO, "Adding the window location: %s to js file\n", window.str().c_str());
context->runScript(window.str().c_str(),true, url, nullptr, true);
#endif
NativeJSLogger::log(INFO, "Running test application: %s\n", url.c_str());
NativeJSLogger::log(INFO, "Running test application: %s\n", url);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please retain these changes . Remove macro check ENABLE_JSRUNTIME_LAUNCHER

bool ret = context->runFile(url.c_str(), nullptr, true);
NativeJSLogger::log(INFO, "Test application execution result: %d\n", ret ? 1 : 0);
double duration = context->getExecutionDuration();
Expand Down
12 changes: 0 additions & 12 deletions src/jsc/JavaScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,18 +447,6 @@ if (mModuleSettings.enablePlayer)
runFile("modules/linkedjsdom.js", nullptr/*, true*/);
runFile("modules/linkedjsdomwrapper.js", nullptr/*, true*/);
runFile("modules/windowwrapper.js", nullptr/*, true*/);
if(getenv("FIREBOLT_ENDPOINT")!=NULL)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please retain these changes

{
auto FireboltEndpoint = std::string(getenv("FIREBOLT_ENDPOINT"));
std::stringstream ss;
ss << "window.__firebolt = {\"endpoint\":\"" << FireboltEndpoint << "\"};";
NativeJSLogger::log(INFO, "Adding the Firebolt EndPoint value: %s to window.js file\n", FireboltEndpoint.c_str());
ss << "var self = window;";
ss << "let videoDiv = document.createElement(\"div\");";
ss << "videoDiv.id = \"videoDiv\";";
ss << "document.body.appendChild(videoDiv)";
evaluateScript(ss.str().c_str(),nullptr);
}
}
}

Expand Down
20 changes: 5 additions & 15 deletions utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ class Performance

clearMarks()
{
for (var key in this.entries)
for (var key in entries)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please retain these changes, as this is common and part of jsruntime

{
this.entries[key] = null;
delete this.entries[key];
entries[key] = null;
delete entries[key];
}
this.entries = {}
entries = {}
}

getEntriesByName(name)
Expand All @@ -117,16 +117,6 @@ class Performance
now()
{
return Date.now();
}
clearMeasures()
{
for (var key in this.entries)
{
this.entries[key] = null;
delete this.entries[key];
}
this.entries = {}
}

}
}
performance = new Performance();