RDKEMW-3523:Update rdkNativeScript with application identifiers#20
Conversation
| RUNSCRIPT | ||
| }; | ||
|
|
||
| struct applicationRequest |
There was a problem hiding this comment.
Rename as ApplicationRequest
| }; | ||
| } | ||
| std::mutex mUserMutex; | ||
| struct applicationData{ |
There was a problem hiding this comment.
Rename as ApplicationData
e4c61f9 to
e54dbe2
Compare
| }; | ||
|
|
||
|
|
||
| struct applicationDetails{ |
There was a problem hiding this comment.
Change name to ApplicationDetails (any struct or class need to start with upper case for words within it)
| #include <curl/curl.h> | ||
| #include <JavaScriptEngine.h> | ||
| #include <JavaScriptContext.h> | ||
| //#include <JavaScriptContext.h> |
There was a problem hiding this comment.
Remove this commented line
| } | ||
|
|
||
| renderer->run(); | ||
| std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
madanagopalt
left a comment
There was a problem hiding this comment.
kindly look at comments
ba48605 to
4022c3c
Compare
| bool mEnableJSDOM; | ||
| bool mEnableWindow; | ||
| bool mEnablePlayer; | ||
| //ModuleSettings mModuleSettings; |
There was a problem hiding this comment.
remove this commented line
| }; | ||
| } | ||
| std::mutex mUserMutex; | ||
| struct ApplicationData{ |
There was a problem hiding this comment.
Move structure outisde the class
| } | ||
|
|
||
| void NativeJSRenderer::launchApplication(std::string url, ModuleSettings& moduleSettings) | ||
| uint32_t createID() |
There was a problem hiding this comment.
Can we keep it as private member function within class as createApplicationIdentifier
madanagopalt
left a comment
There was a problem hiding this comment.
kindly look at comments
| if (mapEntry != mContextMap.end()) | ||
| { | ||
| JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context; | ||
| std::string* Url = &mContextMap[id].url; |
There was a problem hiding this comment.
what is need for this line?
madanagopalt
left a comment
There was a problem hiding this comment.
kindly look at comments
4022c3c to
d8981ca
Compare
| } | ||
|
|
||
| void NativeJSRenderer::launchApplication(std::string url, ModuleSettings& moduleSettings) | ||
| uint32_t createApplicationIdentifier() |
There was a problem hiding this comment.
This needs to be NativeJSRenderer::::createApplicationIdentifier
| gPendingUrlRequests.push_back(request); | ||
| mUserMutex.unlock(); | ||
| static uint32_t id = 1; | ||
| std::cout<<"Creating id: "<<id<<std::endl; |
There was a problem hiding this comment.
his print can be removed
| mUserMutex.unlock(); | ||
| static uint32_t id = 1; | ||
| std::cout<<"Creating id: "<<id<<std::endl; | ||
| return id++; |
There was a problem hiding this comment.
Convert this line as:
uint32_t ret = id;
id++;
return ret;
| ApplicationDetails appData; | ||
| appData.id = key; | ||
| appData.url = value.url; | ||
| std::cout<<"Found application with ID: "<<key<<" and url:"<<value.url<<std::endl; |
There was a problem hiding this comment.
This print can be commented and mentioned as DEBUG level print. Same is applicable for print inside createApplication also
| uint32_t id= appRequest.mId; | ||
|
|
||
| JavaScriptContextFeatures features(mEmbedThunderJS, mEmbedRdkWebBridge, mEnableWebSocketServer, settings); | ||
| JavaScriptContext* context = new JavaScriptContext(features, " " , mEngine); |
There was a problem hiding this comment.
Give empty string. The string passed here as single space
| std::cerr<<"context not created for id: "<< id <<std::endl; | ||
| return ; | ||
| } | ||
| std::cout<<"Context created for id: "<<id<<std::endl; |
There was a problem hiding this comment.
Follow same as DEBUG comment
| loadApplication(gPendingUrlRequests[i].mUrl, settings); | ||
|
|
||
| ApplicationRequest& request = gPendingRequests[i]; | ||
| if(request.mRequestType == 0) |
There was a problem hiding this comment.
Compare wtih ENUM name
| ApplicationRequest& request = gPendingRequests[i]; | ||
| if(request.mRequestType == 0) | ||
| { | ||
| NativeJSRenderer::createApplicationInternal(request); |
There was a problem hiding this comment.
We don't want namespace here.
madanagopalt
left a comment
There was a problem hiding this comment.
kindly look at comments
Reason for change: Cleaned up the code Test Procedure: build should be successful. Risks: low Priority: P2
d8981ca to
60fc51b
Compare
Reason for change: Cleaned up the code
Test Procedure: build should be successful.
Risks: low
Priority: P2