-
Notifications
You must be signed in to change notification settings - Fork 1
RDKEMW-5230: JSRuntimeLauncher component - RDKE #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
| } | ||
| } | ||
|
|
@@ -326,15 +326,9 @@ void NativeJSRenderer::runApplicationInternal(ApplicationRequest& appRequest) | |
| return ; | ||
| } | ||
| JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context; | ||
| #if defined(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); | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,12 +85,12 @@ class Performance | |
|
|
||
| clearMarks() | ||
| { | ||
| for (var key in this.entries) | ||
| for (var key in entries) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
@@ -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(); | ||
There was a problem hiding this comment.
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