diff --git a/.github/workflows/ContentProtectionTests.yml b/.github/workflows/ContentProtectionTests.yml new file mode 100644 index 0000000000..98ca9e8eec --- /dev/null +++ b/.github/workflows/ContentProtectionTests.yml @@ -0,0 +1,35 @@ +name: ContentProtection + +on: + push: + paths: + - ContentProtection/** + - .github/workflows/*ContentProtection*.yml + pull_request: + paths: + - ContentProtection/** + - .github/workflows/*ContentProtection*.yml + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - src: 'ContentProtection' + build: 'build/ContentProtection' + steps: + - uses: actions/checkout@v4 + with: + path: ${{github.repository}} + - run: | + sudo apt update + sudo apt install -y cmake + - run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh + - run: | + cmake \ + -S ${GITHUB_REPOSITORY}/${{ matrix.src }} \ + -B ${{ matrix.build }} \ + -DCMAKE_INSTALL_PREFIX="install" \ + -DCMAKE_CXX_FLAGS="-Wall -Werror" + cmake --build ${{ matrix.build }} --target install diff --git a/.github/workflows/L2-ContentProtection.yml b/.github/workflows/L2-ContentProtection.yml deleted file mode 100644 index 34c91be58f..0000000000 --- a/.github/workflows/L2-ContentProtection.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: L2-ContentProtection - -on: - push: - paths: - - ContentProtection/** - - .github/workflows/*ContentProtection*.yml - pull_request: - paths: - - ContentProtection/** - - .github/workflows/*ContentProtection*.yml - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - path: ${{github.repository}} - - - name: Install cmake - run: | - sudo apt update - sudo apt install -y cmake - - - name: Build Thunder - working-directory: ${{github.workspace}} - run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh - - - name: Build - working-directory: ${{github.workspace}} - run: | - cmake -S ${GITHUB_REPOSITORY}/ContentProtection -B build/ContentProtection -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="-Wall -Werror" - cmake --build build/ContentProtection --target install diff --git a/AVOutput/AVOutputTV.cpp b/AVOutput/AVOutputTV.cpp index e05f370124..ac1ea0ba6f 100644 --- a/AVOutput/AVOutputTV.cpp +++ b/AVOutput/AVOutputTV.cpp @@ -2016,6 +2016,10 @@ namespace Plugin { returnResponse(false); } + if (isPlatformSupport("DimmingMode") != 0) { + returnResponse(false); + } + if (getParamIndex("DimmingMode",inputInfo,indexInfo) == -1) { LOGERR("%s: getParamIndex failed to get \n", __FUNCTION__); returnResponse(false); @@ -2072,6 +2076,10 @@ namespace Plugin { returnResponse(false); } + if (isPlatformSupport("DimmingMode") != 0) { + returnResponse(false); + } + if( !isCapablityCheckPassed( "DimmingMode" , inputInfo )) { LOGERR("%s: CapablityCheck failed for DimmingMode\n", __FUNCTION__); returnResponse(false); @@ -2118,6 +2126,10 @@ namespace Plugin { returnResponse(false); } + if (isPlatformSupport("DimmingMode") != 0) { + returnResponse(false); + } + int retval= updateAVoutputTVParam("reset","DimmingMode", inputInfo,PQ_PARAM_DIMMINGMODE,dMode); if(retval != 0 ) { @@ -2171,6 +2183,8 @@ namespace Plugin { returnResponse(false); } else { + response["platformSupport"] = (info.isPlatformSupportVector[0].compare("true") == 0) ? true : false; + for (index = 0; index < info.rangeVector.size(); index++) { supportedDimmingModeArray.Add(info.rangeVector[index]); } diff --git a/AVOutput/AVOutputTVHelper.cpp b/AVOutput/AVOutputTVHelper.cpp index fa93cc1504..89287a52c8 100644 --- a/AVOutput/AVOutputTVHelper.cpp +++ b/AVOutput/AVOutputTVHelper.cpp @@ -2302,7 +2302,7 @@ namespace Plugin { } - if ((param == "DolbyVisionMode") || (param == "Backlight") || (param == "CMS") || (param == "CustomWhiteBalance") || (param == "HDRMode") || (param == "BacklightControl")) { + if ((param == "DolbyVisionMode") || (param == "Backlight") || (param == "CMS") || (param == "CustomWhiteBalance") || (param == "HDRMode") || (param == "BacklightControl") || (param == "DimmingMode")) { configString = param + ".platformsupport"; info.isPlatformSupport = inFile.Get(configString); printf(" platformsupport : %s\n",info.isPlatformSupport.c_str() ); diff --git a/ContentProtection/ContentProtection.cpp b/ContentProtection/ContentProtection.cpp index a785b591b1..42b73f2d11 100644 --- a/ContentProtection/ContentProtection.cpp +++ b/ContentProtection/ContentProtection.cpp @@ -61,7 +61,7 @@ namespace Plugin { token); if (ret != Core::ERROR_NONE) { SYSLOG(Logging::Startup, - (_T("Couldn't create token: %d"), ret)); + (_T("Couldn't create token: %" PRIu32), ret)); } security->Release(); } diff --git a/ContentProtection/ContentProtection.h b/ContentProtection/ContentProtection.h index 7918403bfa..50f558234d 100644 --- a/ContentProtection/ContentProtection.h +++ b/ContentProtection/ContentProtection.h @@ -387,10 +387,8 @@ namespace Plugin { override { uint32_t result; - Core::JSON::String jsonString; - jsonString.FromString(initData); JsonObject out; - out.FromString(jsonString); + out.FromString(initData); out["clientId"] = clientId; out["keySystem"] = Core::JSON::EnumType(keySystem) .Data(); @@ -409,9 +407,7 @@ namespace Plugin { : Core::ERROR_GENERAL; } else { sessionId = in["sessionId"].Number(); - string inStr; - in.ToString(inStr); - response = Core::ToQuotedString('\"', inStr); + in.ToString(response); _parent._sessionStorage.Set(sessionId, { clientId, appId, keySystem }); @@ -455,10 +451,8 @@ namespace Plugin { } uint32_t result; - Core::JSON::String jsonString; - jsonString.FromString(initData); JsonObject out; - out.FromString(jsonString); + out.FromString(initData); out["clientId"] = session.Value().ClientId; out["sessionId"] = sessionId; out["keySystem"] = Core::JSON::EnumType( @@ -479,9 +473,7 @@ namespace Plugin { ? status.Value() : Core::ERROR_GENERAL; } else { - string inStr; - in.ToString(inStr); - response = Core::ToQuotedString('\"', inStr); + in.ToString(response); } } return result; @@ -579,11 +571,11 @@ namespace Plugin { Timeout, _T("onAddWatermark"), [&](const OnAddWatermarkParams& params) { _watermarkStorage.Set( - params.GraphicId, - { params.SessionId, - params.AdjustVisibilityRequired, - params.GraphicImageBufferKey, - params.GraphicImageSize }); + params.GraphicId.Value(), + { params.SessionId.Value(), + params.AdjustVisibilityRequired.Value(), + params.GraphicImageBufferKey.Value(), + params.GraphicImageSize.Value() }); CreateWatermarkParams out; out.Id = params.GraphicId; @@ -595,7 +587,8 @@ namespace Plugin { != Core::ERROR_NONE) || !in["success"].Boolean()) { TRACE(Trace::Error, - (_T("create %d failed"), params.GraphicId)); + (_T("create %" PRIu32 " failed"), + params.GraphicId.Value())); } }) == Core::ERROR_NONE); @@ -611,7 +604,8 @@ namespace Plugin { != Core::ERROR_NONE) || !in["success"].Boolean()) { TRACE(Trace::Error, - (_T("delete %d failed"), params.GraphicId)); + (_T("delete %" PRIu32 " failed"), + params.GraphicId.Value())); } }) == Core::ERROR_NONE); @@ -620,7 +614,7 @@ namespace Plugin { [&](const OnDisplayWatermarkParams& params) { uint32_t result; ShowWatermarkParams out; - out.Show = !params.HideWatermark; + out.Show = !params.HideWatermark.Value(); JsonObject in; result = _watermark->Invoke< ShowWatermarkParams, JsonObject>( @@ -635,31 +629,33 @@ namespace Plugin { Timeout, _T("onWatermarkSession"), [&](const OnWatermarkSessionParams& params) { auto session = _sessionStorage.Get( - params.SessionId); + params.SessionId.Value()); if (!session.IsSet()) { return; // No such session } + auto value = params.ConditionContext.Value(); WatermarkStatusChanged( - params.SessionId, + params.SessionId.Value(), session.Value().AppId, - { ((params.ConditionContext == 1) + { ((value == 1) ? State::GRANTED - : ((params.ConditionContext == 2) + : ((value == 2) ? State::NOT_REQUIRED - : ((params.ConditionContext == 3) + : ((value == 3) ? State::DENIED : State::FAILED))), - params.ConditionContext }); + value }); }) == Core::ERROR_NONE); ASSERT(_secManager->Subscribe( Timeout, _T("onUpdateWatermark"), [&](const OnUpdateWatermarkParams& params) { auto palette = _palettedImageDataStorage.Get( - params.GraphicId); + params.GraphicId.Value()); if (!palette.IsSet()) { TRACE(Trace::Error, - (_T("no palette %d"), params.GraphicId)); + (_T("no palette %" PRIu32), + params.GraphicId.Value())); } else { PaletteWatermarkParams out; out.Id = params.GraphicId; @@ -677,8 +673,8 @@ namespace Plugin { != Core::ERROR_NONE) || !in["success"].Boolean()) { TRACE(Trace::Error, - (_T("modify %d failed"), - params.GraphicId)); + (_T("modify %" PRIu32 " failed"), + params.GraphicId.Value())); } } }) @@ -686,25 +682,25 @@ namespace Plugin { ASSERT(_watermark->Subscribe( Timeout, _T("onWatermarkRequestStatus"), [&](const OnWatermarkRequestStatusParams& params) { - if (params.Type == "show") { - if (!params.Success) { + if (params.Type.Value() == "show") { + if (!params.Success.Value()) { TRACE(Trace::Error, (_T("show failed"))); } // Watermark plugin does not tell // which call ended, can be any. Can't take this // information as a response - } else if (!params.Success) { + } else if (!params.Success.Value()) { auto watermark = _watermarkStorage - .Get(params.Id); + .Get(params.Id.Value()); if (watermark.IsSet()) { TRACE(Trace::Error, - (_T("%s %d failed"), + (_T("%s %" PRIu32 " failed"), params.Type.Value().c_str(), - params.Id)); + params.Id.Value())); } - } else if (params.Type == "create") { + } else if (params.Type.Value() == "create") { auto watermark = _watermarkStorage - .Get(params.Id); + .Get(params.Id.Value()); if (watermark.IsSet()) { UpdateWatermarkParams out; out.Id = params.Id; @@ -720,13 +716,13 @@ namespace Plugin { != Core::ERROR_NONE) || !in["success"].Boolean()) { TRACE(Trace::Error, - (_T("update %d failed"), - params.Id)); + (_T("update %" PRIu32 " failed"), + params.Id.Value())); } } - } else if (params.Type == "update") { + } else if (params.Type.Value() == "update") { auto watermark = _watermarkStorage - .Get(params.Id); + .Get(params.Id.Value()); if (watermark.IsSet() && watermark.Value() .AdjustVisibilityRequired) { @@ -740,18 +736,20 @@ namespace Plugin { _T("getPalettedWatermark"), out, in) != Core::ERROR_NONE) - || !in.ImageWidth || !in.ImageHeight) { + || !in.ImageWidth.Value() + || !in.ImageHeight.Value()) { TRACE(Trace::Error, - (_T("get %d failed"), params.Id)); + (_T("get %" PRIu32 " failed"), + params.Id.Value())); } else { _palettedImageDataStorage.Set( - params.Id, - { in.ImageKey, - in.ImageWidth, - in.ImageHeight, - in.ClutKey, - in.ClutSize, - in.ClutType }); + params.Id.Value(), + { in.ImageKey.Value(), + in.ImageWidth.Value(), + in.ImageHeight.Value(), + in.ClutKey.Value(), + in.ClutSize.Value(), + in.ClutType.Value() }); LoadClutWatermarkParams out; out.SessionId = watermark.Value() @@ -765,8 +763,8 @@ namespace Plugin { out.WatermarkWidth = in.ImageWidth; out.WatermarkHeight = in.ImageHeight; out.AspectRatio - = ((float)in.ImageWidth - / (float)in.ImageHeight); + = ((float)in.ImageWidth.Value() + / (float)in.ImageHeight.Value()); JsonObject in2; if ((_secManager->Invoke< LoadClutWatermarkParams, @@ -777,8 +775,8 @@ namespace Plugin { != Core::ERROR_NONE) || !in2["success"].Boolean()) { TRACE(Trace::Error, - (_T("load %d failed"), - params.Id)); + (_T("load %" PRIu32 " failed"), + params.Id.Value())); } } } @@ -789,7 +787,7 @@ namespace Plugin { Timeout, _T("onWatermarkRenderFailed"), [&](const OnWatermarkRenderFailedParams& params) { auto watermark = _watermarkStorage - .Get(params.Image); + .Get(params.Image.Value()); if (watermark.IsSet()) { auto session = _sessionStorage.Get( watermark.Value().SessionId); diff --git a/HdmiCecSink/HdmiCecSink.cpp b/HdmiCecSink/HdmiCecSink.cpp index d375315843..d8a60b507f 100644 --- a/HdmiCecSink/HdmiCecSink.cpp +++ b/HdmiCecSink/HdmiCecSink.cpp @@ -78,8 +78,7 @@ #define HDMICECSINK_NUMBER_TV_ADDR 2 #define HDMICECSINK_UPDATE_POWER_STATUS_INTERVA_MS (60 * 1000) #define HDMISINK_ARC_START_STOP_MAX_WAIT_MS 4000 -#define HDMICECSINK_UPDATE_AUDIO_STATUS_INTERVAL_MS 500 - +#define HDMICECSINK_UPDATE_AUDIO_STATUS_INTERVAL_MS 2000 #define SAD_FMT_CODE_AC3 2 #define SAD_FMT_CODE_ENHANCED_AC3 10 @@ -695,6 +694,7 @@ namespace WPEFramework m_isHdmiInConnected = false; hdmiCecAudioDeviceConnected = false; m_isAudioStatusInfoUpdated = false; + m_audioStatusRequestedCount = 0; m_audioStatusReceived = false; m_audioStatusTimerStarted = false; m_audioDevicePowerStatusRequested = false; @@ -1223,9 +1223,11 @@ namespace WPEFramework LOGINFO("AudioStatus received from the Audio Device and the timer is still active. So stopping the timer!\n"); m_audioStatusDetectionTimer.stop(); } - LOGINFO("AudioStatus received from the Audio Device. Updating the AudioStatus info! m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted); + LOGINFO("AudioStatus received from the Audio Device. Updating the AudioStatus info! m_isAudioStatusInfoUpdated :%d, m_audioStatusRequestedCount :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusRequestedCount,m_audioStatusReceived,m_audioStatusTimerStarted); } - LOGINFO("Command: ReportAudioStatus %s audio Mute status %d means %s and current Volume level is %d \n",GetOpName(msg.opCode()),msg.status.getAudioMuteStatus(),msg.status.toString().c_str(),msg.status.getAudioVolume()); + if(m_audioStatusRequestedCount > 0) + m_audioStatusRequestedCount--; + LOGINFO("Command: ReportAudioStatus %s audio Mute status %d means %s and current Volume level is %d \n",GetOpName(msg.opCode()),msg.status.getAudioMuteStatus(),msg.status.toString().c_str(),msg.status.getAudioVolume()); params["muteStatus"] = msg.status.getAudioMuteStatus(); params["volumeLevel"] = msg.status.getAudioVolume(); sendNotify(eventString[HDMICECSINK_EVENT_REPORT_AUDIO_STATUS], params); @@ -1417,7 +1419,15 @@ namespace WPEFramework return; if(!(_instance->smConnection)) return; + if (m_audioStatusDetectionTimer.isActive()) + { + LOGINFO("Stopping the Audio Status Timer!\n"); + m_audioStatusDetectionTimer.stop(); + m_audioStatusTimerStarted = false; + LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ",m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted); + } LOGINFO(" Send GiveAudioStatus "); + m_audioStatusRequestedCount++; _instance->smConnection->sendTo(LogicalAddress::AUDIO_SYSTEM,MessageEncoder().encode(GiveAudioStatus()), 100); } @@ -2651,10 +2661,11 @@ namespace WPEFramework m_audioStatusDetectionTimer.stop(); } m_isAudioStatusInfoUpdated = false; + m_audioStatusRequestedCount = 0; m_audioStatusReceived = false; m_audioStatusTimerStarted = false; - LOGINFO("Audio device removed, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted); - sendNotify(eventString[HDMICECSINK_EVENT_AUDIO_DEVICE_CONNECTED_STATUS], params) + LOGINFO("Audio device removed, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusRequestedCount :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d", m_isAudioStatusInfoUpdated,m_audioStatusRequestedCount,m_audioStatusReceived,m_audioStatusTimerStarted); + sendNotify(eventString[HDMICECSINK_EVENT_AUDIO_DEVICE_CONNECTED_STATUS], params) } _instance->deviceList[logicalAddress].m_isRequestRetry = 0; @@ -3287,10 +3298,10 @@ namespace WPEFramework m_audioStatusDetectionTimer.stop(); } m_isAudioStatusInfoUpdated = false; + m_audioStatusRequestedCount = 0; m_audioStatusReceived = false; m_audioStatusTimerStarted = false; - LOGINFO("CEC Disabled, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusReceived,m_audioStatusTimerStarted); - + LOGINFO("CEC Disabled, reset the audio status info. m_isAudioStatusInfoUpdated :%d, m_audioStatusRequestedCount :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ", m_isAudioStatusInfoUpdated,m_audioStatusRequestedCount,m_audioStatusReceived,m_audioStatusTimerStarted); for(int i=0; i< 16; i++) { @@ -3527,6 +3538,8 @@ namespace WPEFramework keyInfo = _instance->m_SendKeyQueue.front(); _instance->m_SendKeyQueue.pop(); + if((keyInfo.logicalAddr != 0x5) || ((keyInfo.logicalAddr == 0x5) && (_instance->hdmiCecAudioDeviceConnected == true))) + { if(keyInfo.UserControl == "sendUserControlPressed" ) { LOGINFO("sendUserControlPressed : logical addr:0x%x keyCode: 0x%x queue size :%zu \n",keyInfo.logicalAddr,keyInfo.keyCode,_instance->m_SendKeyQueue.size()); @@ -3546,16 +3559,16 @@ namespace WPEFramework if((_instance->m_SendKeyQueue.size()<=1 || (_instance->m_SendKeyQueue.size() % 2 == 0)) && ((keyInfo.keyCode == VOLUME_UP) || (keyInfo.keyCode == VOLUME_DOWN) || (keyInfo.keyCode == MUTE)) ) { + LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusRequestedCount :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ",_instance->m_isAudioStatusInfoUpdated,_instance->m_audioStatusRequestedCount,_instance->m_audioStatusReceived,_instance->m_audioStatusTimerStarted); if(keyInfo.keyCode == MUTE) { _instance->sendGiveAudioStatusMsg(); } else { - LOGINFO("m_isAudioStatusInfoUpdated :%d, m_audioStatusReceived :%d, m_audioStatusTimerStarted:%d ",_instance->m_isAudioStatusInfoUpdated,_instance->m_audioStatusReceived,_instance->m_audioStatusTimerStarted); if (!_instance->m_isAudioStatusInfoUpdated) { - if ( !(_instance->m_audioStatusDetectionTimer.isActive())) + if ((!(_instance->m_audioStatusDetectionTimer.isActive())) && (_instance->m_audioStatusRequestedCount == 0)) { LOGINFO("Audio status info not updated. Starting the Timer!"); _instance->m_audioStatusTimerStarted = true; @@ -3570,6 +3583,7 @@ namespace WPEFramework } } } + } } }//while(!_instance->m_sendKeyEventThreadExit) diff --git a/HdmiCecSink/HdmiCecSink.h b/HdmiCecSink/HdmiCecSink.h index c6b77c0232..5b7d908175 100644 --- a/HdmiCecSink/HdmiCecSink.h +++ b/HdmiCecSink/HdmiCecSink.h @@ -634,6 +634,7 @@ namespace WPEFramework { bool m_isAudioStatusInfoUpdated; bool m_audioStatusReceived; bool m_audioStatusTimerStarted; + int m_audioStatusRequestedCount; std::thread m_sendKeyEventThread; std::mutex m_sendKeyEventMutex; std::queue m_SendKeyQueue; diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index b8be1815ca..47cfc67605 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -69,6 +69,7 @@ using namespace std; #define PROC_DIR "/proc" #define RDK_PATH "/lib/rdk/" +#define BIN_PATH "/usr/bin/" #define MAINTENANCE_MANAGER_RFC_CALLER_ID "MaintenanceManager" #define TR181_AUTOREBOOT_ENABLE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AutoReboot.Enable" @@ -81,7 +82,7 @@ using namespace std; #define TR181_XCONFURL "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.XconfUrl" #endif -#define RFC_TASK RDK_PATH "Start_RFC.sh" +#define RFC_TASK BIN_PATH "rfcMgr" #define SWUPDATE_TASK RDK_PATH "swupdate_utility.sh" #define LOGUPLOAD_TASK RDK_PATH "Start_uploadSTBLogs.sh" @@ -272,7 +273,7 @@ namespace WPEFramework bool MaintenanceManager::g_task_timerCreated = false; string task_names_foreground[] = { - "/lib/rdk/Start_RFC.sh", + "/usr/bin/rfcMgr >> /opt/logs/rfcscript.log", "/lib/rdk/swupdate_utility.sh", "/lib/rdk/Start_uploadSTBLogs.sh" }; @@ -292,7 +293,7 @@ namespace WPEFramework }; string task_names[]={ - "RFCbase.sh", + "rfcMgr", "swupdate_utility.sh", "uploadSTBLogs.sh" }; @@ -1049,14 +1050,14 @@ namespace WPEFramework MM_LOGINFO("Starting Critical Tasks..."); int rfc_task_status = -1; int xconf_imagecheck_status = -1; - - MM_LOGINFO("Starting /lib/rdk/Start_RFC.sh"); - rfc_task_status = system("/lib/rdk/Start_RFC.sh &"); + + MM_LOGINFO("Starting /usr/bin/rfcMgr"); + rfc_task_status = system("/usr/bin/rfcMgr >> /opt/logs/rfcscript.log &"); if (rfc_task_status != 0) { - MM_LOGINFO("Failed to run Start_RFC.sh with %d", WEXITSTATUS(rfc_task_status)); - } - + MM_LOGINFO("Failed to run rfcMgr with %d", WEXITSTATUS(rfc_task_status)); + } + MM_LOGINFO("Starting /lib/rdk/xconfImageCheck.sh"); xconf_imagecheck_status = system("/lib/rdk/xconfImageCheck.sh &"); if (xconf_imagecheck_status != 0) diff --git a/TextToSpeech/TextToSpeechImplementation.cpp b/TextToSpeech/TextToSpeechImplementation.cpp index 9d5b0c76b9..8d2a8dd18e 100644 --- a/TextToSpeech/TextToSpeechImplementation.cpp +++ b/TextToSpeech/TextToSpeechImplementation.cpp @@ -29,6 +29,7 @@ #define TTS_MINOR_VERSION 0 #define GET_STR(map, key, def) ((map.HasLabel(key) && !map[key].String().empty() && map[key].String() != "null") ? map[key].String() : def) +#define SERVER_DETAILS "127.0.0.1:9998" #undef returnResponse #define returnResponse(success) \ @@ -78,8 +79,32 @@ namespace Plugin { JsonObject config; config.FromString(service->ConfigLine()); + std::string token; + auto security = service->QueryInterfaceByCallsign("SecurityAgent"); + if (nullptr != security) + { + std::string payload = "http://localhost"; + if (security->CreateToken(static_cast(payload.length()), + reinterpret_cast(payload.c_str()), + token) == Core::ERROR_NONE) + { + TTSLOG_INFO("got security token - %s", token.empty() ? "" : token.c_str()); + } + else + { + TTSLOG_INFO("Failed to get security token"); + } + security->Release(); + } + else + { + TTSLOG_INFO("No security agent\n"); + } + std::string query = "token=" + token; + Core::SystemInfo::SetEnvironment(_T("THUNDER_ACCESS"), (_T(SERVER_DETAILS))); + TTS::TTSConfiguration *ttsConfig = _ttsManager->configuration(); - TTS::RFCURLObserver::getInstance()->triggerRFC(ttsConfig); + TTS::RFCURLObserver::getInstance()->triggerRFC(ttsConfig, query); ttsConfig->setEndPoint(GET_STR(config, "endpoint", "")); ttsConfig->setSecureEndPoint(GET_STR(config, "secureendpoint", "")); ttsConfig->setLocalEndPoint(GET_STR(config, "localendpoint", "")); diff --git a/TextToSpeech/impl/RFCURLObserver.cpp b/TextToSpeech/impl/RFCURLObserver.cpp index d3326e09ea..f2e59ea3b5 100644 --- a/TextToSpeech/impl/RFCURLObserver.cpp +++ b/TextToSpeech/impl/RFCURLObserver.cpp @@ -27,9 +27,10 @@ RFCURLObserver* RFCURLObserver::getInstance() { } -void RFCURLObserver::triggerRFC(TTSConfiguration *config) +void RFCURLObserver::triggerRFC(TTSConfiguration *config,std::string token) { m_defaultConfig = config; + m_token = token; fetchURLFromConfig(); std::thread notificationThread(&RFCURLObserver::registerNotification, this); notificationThread.detach(); // Detach the thread to run independently @@ -49,65 +50,9 @@ void RFCURLObserver::fetchURLFromConfig() { } } -string RFCURLObserver::getSecurityToken() { - std::string token = "token="; - int tokenLength = 0; - unsigned char buffer[MAX_SECURITY_TOKEN_SIZE] = {0}; - static std::string endpoint; - - if(endpoint.empty()) { - Core::SystemInfo::GetEnvironment(_T("THUNDER_ACCESS"), endpoint); - TTSLOG_INFO("Thunder RPC Endpoint read from env - %s", endpoint.c_str()); - } - - if(endpoint.empty()) { - Core::File file("/etc/WPEFramework/config.json"); - if(file.Open(true)) { - JsonObject config; - if(config.IElement::FromFile(file)) { - Core::JSON::String port = config.Get("port"); - Core::JSON::String binding = config.Get("binding"); - if(!binding.Value().empty() && !port.Value().empty()) - endpoint = binding.Value() + ":" + port.Value(); - } - file.Close(); - } - if(endpoint.empty()) - endpoint = _T("127.0.0.1:9998"); - - TTSLOG_INFO("Thunder RPC Endpoint read from config file - %s", endpoint.c_str()); - Core::SystemInfo::SetEnvironment(_T("THUNDER_ACCESS"), endpoint); - } - - string payload = "http://localhost"; - if(payload.empty()) { - tokenLength = GetSecurityToken(sizeof(buffer), buffer); - } else { - int buffLength = std::min(sizeof(buffer), payload.length()); - ::memcpy(buffer, payload.c_str(), buffLength); - tokenLength = GetToken(sizeof(buffer), buffLength, buffer); - } - - if(tokenLength > 0) { - token.append((char*)buffer); - } else { - token.clear(); - } - - TTSLOG_INFO("Thunder token - %s", token.empty() ? "" : token.c_str()); - return token; -} - - void RFCURLObserver::registerNotification() { if (m_systemService == nullptr && !m_eventRegistered) { - std::string token = getSecurityToken(); - if(token.empty()) { - m_systemService = new WPEFramework::JSONRPC::LinkType(_T(SYSTEMSERVICE_CALLSIGN_VER),""); - } else { - m_systemService = new WPEFramework::JSONRPC::LinkType(_T(SYSTEMSERVICE_CALLSIGN_VER),"", false, token); - } - + m_systemService = new WPEFramework::JSONRPC::LinkType(_T(SYSTEMSERVICE_CALLSIGN_VER),"", false, m_token); while (!m_eventRegistered) { if (m_systemService->Subscribe(3000, "onDeviceMgtUpdateReceived", &RFCURLObserver::onDeviceMgtUpdateReceivedHandler, this) == Core::ERROR_NONE) { diff --git a/TextToSpeech/impl/RFCURLObserver.h b/TextToSpeech/impl/RFCURLObserver.h index 46a4527571..8f749ac07b 100644 --- a/TextToSpeech/impl/RFCURLObserver.h +++ b/TextToSpeech/impl/RFCURLObserver.h @@ -8,7 +8,7 @@ namespace TTS { class RFCURLObserver { public: static RFCURLObserver* getInstance(); - void triggerRFC(TTSConfiguration*); + void triggerRFC(TTSConfiguration*,std::string); ~RFCURLObserver(); private: @@ -18,12 +18,12 @@ class RFCURLObserver { void fetchURLFromConfig(); void registerNotification(); - string getSecurityToken(); void onDeviceMgtUpdateReceivedHandler(const JsonObject& parameters); WPEFramework::JSONRPC::LinkType* m_systemService{nullptr}; bool m_eventRegistered {false}; + std::string m_token; TTSConfiguration *m_defaultConfig; }; diff --git a/WebKitBrowser/Amazon.config b/WebKitBrowser/Amazon.config deleted file mode 100644 index c37c35e415..0000000000 --- a/WebKitBrowser/Amazon.config +++ /dev/null @@ -1,248 +0,0 @@ -set(autostart ${PLUGIN_AMAZON_AUTOSTART}) - -set(preconditions Graphics Internet) - -if(PLUGIN_AMAZON_STARTUPORDER) -set (startuporder ${PLUGIN_AMAZON_STARTUPORDER}) -endif() - -map() - kv(mode ${PLUGIN_AMAZON_MODE}) - kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) - if(PLUGIN_AMAZON_USER) - kv(user ${PLUGIN_AMAZON_USER}) - endif() - if(PLUGIN_AMAZON_GROUP) - kv(group ${PLUGIN_AMAZON_GROUP}) - endif() -end() -ans(rootobject) - -map() - kv(url ${PLUGIN_AMAZON_STARTURL}) - if(PLUGIN_AMAZON_USERAGENT) - semicolon_safe_string(PLUGIN_AMAZON_USERAGENT) - kv(useragent ${PLUGIN_AMAZON_USERAGENT}) - endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() - kv(transparent ${PLUGIN_AMAZON_TRANSPARENT}) - kv(compositor "noaa") - kv(inspector ${PLUGIN_AMAZON_WEBINSPECTOR_ADDRESS}) - kv(fps true) - kv(cursor false) - key(bundle) - map() - key(hawaii) - map() - kv(displayWidth 1280) - kv(displayHeight 720) - kv(panelWidth 1280) - kv(panelHeight 720) - kv(proxyHost "") - kv(proxyPort 0) - kv(proxyUsername "") - kv(proxyPassword "") - kv(bandwidthEstimateFilePath "/tmp/BandwidthEstimate.txt") - - if(PLUGIN_AMAZON_CADIRECTORYPATH) - kv(CADirectoryPath ${PLUGIN_AMAZON_CADIRECTORYPATH}) - else(PLUGIN_AMAZON_CADIRECTORYPATH) - kv(CADirectoryPath "/etc/ssl/certs/") - endif(PLUGIN_AMAZON_CADIRECTORYPATH) - - if(PLUGIN_AMAZON_CABUNDLEFILENAME) - kv(CABundleFileName ${PLUGIN_AMAZON_CABUNDLEFILENAME}) - else(PLUGIN_AMAZON_CABUNDLEFILENAME) - kv(CABundleFileName "ca-certificates.crt") - endif(PLUGIN_AMAZON_CABUNDLEFILENAME) - - kv(supportsSurroundSound true) - kv(supportsAudioCodecSwitching true) - kv(dolbyDigitalAudioPassthroughOnly false) - kv(supportsHEVC false) - kv(supportsHEVC10Bits false) - kv(supportsCVBR true) - kv(supportsIntraChunkSeeking false) - kv(hasExternalOutput true) - kv(hasPlatformVideoNode true) - kv(supportsCompressedContentEncoding true) - kv(supportsHexEncodedManifest true) - kv(hdcpMajorVersion 2) - kv(hdcpMinorVersion 2) - kv(supportsUHD false) - kv(supportsHDR false) - kv(hdrFlags 0) - kv(supportsOLED true) - - if(PLUGIN_AMAZON_MANUFACTURER) - kv(manufacturer ${PLUGIN_AMAZON_MANUFACTURER}) - else(PLUGIN_AMAZON_MANUFACTURER) - kv(manufacturer "Broadcom") - endif(PLUGIN_AMAZON_MANUFACTURER) - - if(PLUGIN_AMAZON_MODELNAME) - kv(modelName ${PLUGIN_AMAZON_MODELNAME}) - else(PLUGIN_AMAZON_MODELNAME) - kv(modelName "2952") - endif(PLUGIN_AMAZON_MODELNAME) - - kv(platformPackageVersion "") - kv(deviceMode "") - - if(PLUGIN_AMAZON_DEVICELANGUAGE) - kv(deviceLanguage ${PLUGIN_AMAZON_DEVICELANGUAGE}) - else(PLUGIN_AMAZON_DEVICELANGUAGE) - kv(deviceLanguage "en-US") - endif(PLUGIN_AMAZON_DEVICELANGUAGE) - - if(PLUGIN_AMAZON_DEVICETYPEID) - kv(deviceTypeId ${PLUGIN_AMAZON_DEVICETYPEID}) - else(PLUGIN_AMAZON_DEVICETYPEID) - kv(deviceTypeId "A71I8788P1ZV8") - endif(PLUGIN_AMAZON_DEVICETYPEID) - - if(PLUGIN_AMAZON_FIRMWAREVERSION) - kv(firmwareVersion ${PLUGIN_AMAZON_FIRMWAREVERSION}) - else(PLUGIN_AMAZON_FIRMWAREVERSION) - kv(firmwareVersion "1.0") - endif(PLUGIN_AMAZON_FIRMWAREVERSION) - - if(PLUGIN_AMAZON_CHIPSETNAME) - kv(chipsetName ${PLUGIN_AMAZON_CHIPSETNAME}) - else(PLUGIN_AMAZON_CHIPSETNAME) - kv(chipsetName "BCM2837") - endif(PLUGIN_AMAZON_CHIPSETNAME) - - if(PLUGIN_AMAZON_ETHERNETDEVICE) - kv(ethernetDevice ${PLUGIN_AMAZON_ETHERNETDEVICE}) - else(PLUGIN_AMAZON_ETHERNETDEVICE) - kv(ethernetDevice "eth0") - endif(PLUGIN_AMAZON_ETHERNETDEVICE) - - kv(wifiDevice "wlan0") - - if(PLUGIN_AMAZON_FRAGMENTCACHESIZE) - kv(fragmentCacheSizeMB ${PLUGIN_AMAZON_FRAGMENTCACHESIZE}) - else(PLUGIN_AMAZON_FRAGMENTCACHESIZE) - kv(fragmentCacheSizeMB "100") - endif(PLUGIN_AMAZON_FRAGMENTCACHESIZE) - - kv(updateFrequency "30") - kv(fragmentCacheMountPoint "/tmp/") - key(overrideBySystem) - map() - - if(PLUGIN_AMAZON_FIRMWAREVERSION) - kv(firmwareVersion false) - else(PLUGIN_AMAZON_FIRMWAREVERSION) - kv(firmwareVersion true) - endif(PLUGIN_AMAZON_FIRMWAREVERSION) - - if(PLUGIN_AMAZON_CHIPSETNAME) - kv(chipsetName false) - else(PLUGIN_AMAZON_CHIPSETNAME) - kv(chipsetName true) - endif(PLUGIN_AMAZON_CHIPSETNAME) - - kv(displayResolution true) - kv(panelResolution true) - kv(supportsSurroundSound true) - kv(dolbyDigitalAudioPassthroughOnly true) - kv(supportsUHD true) - kv(supportsHDR true) - kv(supportsOLED true) - kv(supportsHEVC true) - kv(hdcpVersion true) - end() - end() - end() - kv(touch false) - kv(msebuffers "audio:2m,video:15m,text:1m") - kv(thunderdecryptorpreference ${PLUGIN_WEBKITBROWSER_THUNDER_DECRYPTOR_PREFERENCE}) - kv(memoryprofile ${PLUGIN_AMAZON_MEMORYPROFILE}) - kv(mediacontenttypesrequiringhardwaresupport ${PLUGIN_WEBKITBROWSER_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT}) - kv(mediadiskcache ${PLUGIN_WEBKITBROWSER_MEDIADISKCACHE}) - kv(diskcache ${PLUGIN_WEBKITBROWSER_DISKCACHE}) - kv(xhrcache ${PLUGIN_WEBKITBROWSER_XHRCACHE}) - kv(webgl false) - kv(windowclose true) - kv(threadedpainting ${PLUGIN_WEBKITBROWSER_THREADEDPAINTING}) - if(PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER) - kv(clientidentifier ${PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER}) - endif() - kv(localstorageenabled ${PLUGIN_AMAZON_LOCALSTORAGE_ENABLE}) - if(PLUGIN_WEBKITBROWSER_LOCALSTORAGE) - kv(localstorage ${PLUGIN_WEBKITBROWSER_LOCALSTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_COOKIESTORAGE) - kv(cookiestorage ${PLUGIN_WEBKITBROWSER_COOKIESTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_PSTOFFSET) - kv(ptsoffset ${PLUGIN_WEBKITBROWSER_PSTOFFSET}) - endif() - if(PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH) - kv(execpath ${PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY) - kv(proxy ${PLUGIN_WEBKITBROWSER_HTTP_PROXY}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION) - kv(proxyexclusion ${PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION}) - endif() -end() -ans(configuration) - -map_append(${configuration} root ${rootobject}) - -map() -if(PLUGIN_WEBKITBROWSER_ENABLE_JIT) - kv(useJIT true) -else() - kv(useJIT false) -endif() -if(PLUGIN_WEBKITBROWSER_ENABLE_DFG) - kv(useDFG true) -else() - kv(useDFG false) -endif() -end() -ans(javascriptsettings) -map_append(${configuration} javascript ${javascriptsettings}) - -map() -map() -if(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT OR (PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) OR PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - key(webprocesssettings) - map() -if(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) - kv(gpulimit ${PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT}) - kv(gpufile ${PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE}) -endif() -if(PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_AMAZON_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() - -if(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT OR PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - key(networkprocesssettings) - map() -if(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() -end() -ans(memory) - -map_append(${configuration} memory ${memory}) diff --git a/WebKitBrowser/Apps.config b/WebKitBrowser/Apps.config deleted file mode 100644 index f477a1accf..0000000000 --- a/WebKitBrowser/Apps.config +++ /dev/null @@ -1,123 +0,0 @@ -set(autostart ${PLUGIN_APPS_AUTOSTART}) - -set(preconditions Graphics Internet) - -if(PLUGIN_APPS_STARTUPORDER) -set (startuporder ${PLUGIN_APPS_STARTUPORDER}) -endif() - -map() - kv(mode ${PLUGIN_APPS_MODE}) - kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) -end() -ans(rootobject) - -map() - kv(url "about:blank") - if(PLUGIN_APPS_USERAGENT) - semicolon_safe_string(PLUGIN_APPS_USERAGENT) - kv(useragent ${PLUGIN_APPS_USERAGENT}) - endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() - kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) - kv(compositor "noaa") - kv(inspector ${PLUGIN_APPS_WEBINSPECTOR_ADDRESS}) - kv(fps true) - kv(cursor false) - kv(touch false) - kv(msebuffers ${PLUGIN_APPS_MSEBUFFERS}) - kv(thunderdecryptorpreference ${PLUGIN_WEBKITBROWSER_THUNDER_DECRYPTOR_PREFERENCE}) - kv(memoryprofile ${PLUGIN_WEBKITBROWSER_MEMORYPROFILE}) - kv(mediacontenttypesrequiringhardwaresupport ${PLUGIN_WEBKITBROWSER_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT}) - kv(mediadiskcache ${PLUGIN_WEBKITBROWSER_MEDIADISKCACHE}) - kv(diskcache ${PLUGIN_WEBKITBROWSER_DISKCACHE}) - kv(xhrcache ${PLUGIN_WEBKITBROWSER_XHRCACHE}) - kv(webgl ${PLUGIN_APPS_WEBGL}) - kv(threadedpainting ${PLUGIN_WEBKITBROWSER_THREADEDPAINTING}) - if(PLUGIN_WEBKITBROWSER_HEIGHT) - kv(height ${PLUGIN_WEBKITBROWSER_HEIGHT}) - endif() - if(PLUGIN_WEBKITBROWSER_WIDTH) - kv(width ${PLUGIN_WEBKITBROWSER_WIDTH}) - endif() - if(PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER) - kv(clientidentifier ${PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER}) - endif() - kv(localstorageenabled ${PLUGIN_APPS_LOCALSTORAGE_ENABLE}) - if(PLUGIN_WEBKITBROWSER_LOCALSTORAGE) - kv(localstorage ${PLUGIN_WEBKITBROWSER_LOCALSTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_COOKIESTORAGE) - kv(cookiestorage ${PLUGIN_WEBKITBROWSER_COOKIESTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_WINDOWCLOSE) - kv(windowclose ${PLUGIN_WEBKITBROWSER_WINDOWCLOSE}) - endif() - if(PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH) - kv(execpath ${PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH}) - endif() - if(PLUGIN_WEBKITBROWSER_PTSOFFSET) - kv(ptsoffset ${PLUGIN_WEBKITBROWSER_PTSOFFSET}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY) - kv(proxy ${PLUGIN_WEBKITBROWSER_HTTP_PROXY}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION) - kv(proxyexclusion ${PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION}) - endif() -end() -ans(configuration) - -map_append(${configuration} root ${rootobject}) - -map() -if(PLUGIN_APPS_ENABLE_JIT) - kv(useJIT true) -else() - kv(useJIT false) -endif() -if(PLUGIN_APPS_ENABLE_DFG) - kv(useDFG true) -else() - kv(useDFG false) -endif() -end() -ans(javascriptsettings) -map_append(${configuration} javascript ${javascriptsettings}) - -map() -if(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT OR (PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) OR PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - key(webprocesssettings) - map() -if(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) - kv(gpulimit ${PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT}) - kv(gpufile ${PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE}) -endif() -if(PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_APPS_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() - -if(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT OR PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - key(networkprocesssettings) - map() -if(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() -end() -ans(memory) - -map_append(${configuration} memory ${memory}) diff --git a/WebKitBrowser/BrowserConsoleLog.h b/WebKitBrowser/BrowserConsoleLog.h index 1bc76276f5..5eeac06bbf 100644 --- a/WebKitBrowser/BrowserConsoleLog.h +++ b/WebKitBrowser/BrowserConsoleLog.h @@ -21,9 +21,6 @@ #define __BROWSERCONSOLELOG_H #include -#ifndef WEBKIT_GLIB_API -#include "InjectedBundle/Utils.h" -#endif using namespace WPEFramework; class BrowserConsoleLog { @@ -33,7 +30,6 @@ class BrowserConsoleLog { BrowserConsoleLog& operator=(const BrowserConsoleLog& a_RHS) = delete; public: -#ifdef WEBKIT_GLIB_API BrowserConsoleLog(const string& prefix, const string& message, const uint64_t line, const uint64_t column) { _text = '[' + prefix + "][" + Core::NumberType(line).Text() + ',' + Core::NumberType(column).Text() + ']' + message; @@ -46,20 +42,6 @@ class BrowserConsoleLog { _text = _text.substr(0, maxStringLength); } } -#else - BrowserConsoleLog(const string& prefix, const WKStringRef message, const uint64_t line, const uint64_t column) - { - _text = '[' + prefix + "][" + Core::NumberType(line).Text() + ',' + Core::NumberType(column).Text() + ']' + WebKit::Utils::WKStringToString(message); -#ifdef __CORE_MESSAGING__ - const uint16_t maxStringLength = Messaging::MessageUnit::DataSize - 1; -#else - const uint16_t maxStringLength = Trace::TRACINGBUFFERSIZE - 1; -#endif - if (_text.length() > maxStringLength) { - _text = _text.substr(0, maxStringLength); - } - } -#endif ~BrowserConsoleLog() { } diff --git a/WebKitBrowser/CMakeLists.txt b/WebKitBrowser/CMakeLists.txt index ab4f560ba8..1d1c7e7964 100644 --- a/WebKitBrowser/CMakeLists.txt +++ b/WebKitBrowser/CMakeLists.txt @@ -78,6 +78,8 @@ set(PLUGIN_WEBKITBROWSER_XHRCACHE "true" CACHE STRING "XHR Cache") set(PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY "Extension" CACHE STRING "Directory to store extension libraries") set(PLUGIN_WEBKITBROWSER_LOCALSTORAGE "" CACHE STRING "HTML5 local storage path") set(PLUGIN_WEBKITBROWSER_COOKIESTORAGE "" CACHE STRING "Browser cookie storage path") +set(PLUGIN_WEBKITBROWSER_INDEXEDDB_ENABLE "false" CACHE STRING "Enable IndexedDB (HTML5) database") +set(PLUGIN_WEBKITBROWSER_INDEXEDDB_PATH "%persistentpath%" CACHE STRING "The directory where IndexedDB databases will be stored") set(PLUGIN_WEBKITBROWSER_WINDOWCLOSE "false" CACHE STRING "Allow window close") set(PLUGIN_WEBKITBROWSER_WEBGL "true" CACHE STRING "Enable WebGL") set(PLUGIN_WEBKITBROWSER_RESOLUTION "720p" CACHE STRING "Browser resolution") @@ -88,6 +90,10 @@ set(PLUGIN_WEBKITBROWSER_THUNDER_DECRYPTOR_PREFERENCE "true" CACHE STRING "Enabl set(PLUGIN_WEBKITBROWSER_PERSISTENTPATHPOSTFIX "" CACHE STRING "Specify callsign persistent path postfix") set(PLUGIN_WEBKITBROWSER_PTSOFFSET "0" CACHE STRING "Set ptsoffset for webkit") set(PLUGIN_WEBKITBROWSER_USE_EXACT_PATHS "false" CACHE STRING "Use paths specified in configuration options without further modifying them") +set(PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO "0" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO "0" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") +set(PLUGIN_WEBKITBROWSER_GST_QUIRKS "" CACHE STRING "A list of GStreamer quirks to be used by the browser") +set(PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK "" CACHE STRING "GStreamer hole punch quirk to be used by the browser") set(PLUGIN_YOUTUBE_AUTOSTART "false" CACHE STRING "Automatically start Youtube plugin") set(PLUGIN_YOUTUBE_STARTUPORDER "" CACHE STRING "To configure startup order of YouTube plugin") @@ -108,6 +114,8 @@ set(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITB set(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "YouTube Memory Pressure Networkprocess Poll Interval") set(PLUGIN_YOUTUBE_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "YouTube Memory Pressure Service Worker kprocess Limit") set(PLUGIN_YOUTUBE_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "YouTube Memory Pressure Service Worker process Poll Interval") +set(PLUGIN_YOUTUBE_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_YOUTUBE_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_UX_AUTOSTART "false" CACHE STRING "Automatically start UX plugin") set(PLUGIN_UX_STARTUPORDER "" CACHE STRING "To configure startup order of UX plugin") @@ -124,6 +132,8 @@ set(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSE set(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "UX Memory Pressure Networkprocess Poll Interval") set(PLUGIN_UX_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "UX Memory Pressure Service Worker kprocess Limit") set(PLUGIN_UX_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "UX Memory Pressure Service Worker process Poll Interval") +set(PLUGIN_UX_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_UX_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_APPS_AUTOSTART "false" CACHE STRING "Automatically start Apps plugin") set(PLUGIN_APPS_STARTUPORDER "" CACHE STRING "To configure startup order of Apps plugin") @@ -141,6 +151,8 @@ set(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROW set(PLUGIN_APPS_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Apps Memory Pressure Networkprocess Poll Interval") set(PLUGIN_APPS_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Apps Memory Pressure Service Worker kprocess Limit") set(PLUGIN_APPS_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Apps Memory Pressure Service Worker process Poll Interval") +set(PLUGIN_APPS_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_APPS_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_RESIDENT_APP_AUTOSTART "false" CACHE STRING "Automatically start Resident App plugin") set(PLUGIN_RESIDENT_APP_STARTUPORDER "" CACHE STRING "To configure startup order of Resident App plugin") @@ -159,6 +171,8 @@ set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PL set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Resident App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Resident App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_RESIDENT_APP_COMPOSITOR "msaa" CACHE STRING "cairo compositor mode for Resident App") +set(PLUGIN_RESIDENT_APP_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_RESIDENT_APP_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_AUTOSTART "false" CACHE STRING "Automatically start Search&Discovery App plugin") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_STARTUPORDER "" CACHE STRING "To configure startup order of Search&Discovery App plugin") @@ -176,6 +190,8 @@ set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLI set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Search and Discovery App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Search and Discovery App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_SEARCH_AND_DISCOVERY_APP_COMPOSITOR "msaa" CACHE STRING "cairo compositor mode for Search&Discovery App") +set(PLUGIN_SEARCH_AND_DISCOVERY_APP_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_SEARCH_AND_DISCOVERY_APP_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_HTML_APP_AUTOSTART "false" CACHE STRING "Automatically start Htmp App plugin") set(PLUGIN_HTML_APP_STARTUPORDER "" CACHE STRING "To configure startup order of Html App plugin") @@ -193,6 +209,8 @@ set(PLUGIN_HTML_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN set(PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Html App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_HTML_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Html App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_HTML_APP_COMPOSITOR "noaa" CACHE STRING "cairo compositor mode for Html App") +set(PLUGIN_HTML_APP_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_HTML_APP_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_LIGHTNING_APP_AUTOSTART "false" CACHE STRING "Automatically start Lightning App plugin") set(PLUGIN_LIGHTNING_APP_STARTUPORDER "" CACHE STRING "To configure startup order of Lightning App plugin") @@ -210,6 +228,8 @@ set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${P set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Lightning App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Lightning App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_LIGHTNING_APP_COMPOSITOR "noaa" CACHE STRING "cairo compositor mode for Lightning App") +set(PLUGIN_LIGHTNING_APP_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_LIGHTNING_APP_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_JSPP_AUTOSTART "false" CACHE STRING "Automatically start JSPP plugin") set(PLUGIN_JSPP_STARTUPORDER "" CACHE STRING "To configure startup order of JSPP plugin") @@ -226,6 +246,8 @@ set(PLUGIN_JSPP_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEB set(PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "JSPP App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_JSPP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "JSPP App Memory Pressure Service Worker process Poll Interval") set(PLUGIN_JSPP_STARTURL "about:blank" CACHE STRING "JSPP default URL to use") +set(PLUGIN_JSPP_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_JSPP_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") set(PLUGIN_AMAZON_AUTOSTART "false" CACHE STRING "Automatically start Amazon plugin") set(PLUGIN_AMAZON_STARTUPORDER "" CACHE STRING "To configure startup order of Amazon plugin") @@ -241,6 +263,8 @@ set(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBR set(PLUGIN_AMAZON_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Amazon App Memory Pressure Networkprocess Poll Interval") set(PLUGIN_AMAZON_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT} CACHE STRING "Amazon App Memory Pressure Service Worker kprocess Limit") set(PLUGIN_AMAZON_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL ${PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_POLLINTERVAL} CACHE STRING "Amazon App Memory Pressure Service Worker process Poll Interval") +set(PLUGIN_AMAZON_ORIGIN_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for each domain") +set(PLUGIN_AMAZON_TOTAL_STORAGE_RATIO "${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}" CACHE STRING "The percentage of volume space that can be used for data storage for all domains") find_package(${NAMESPACE}Plugins REQUIRED) find_package(${NAMESPACE}Definitions REQUIRED) @@ -270,10 +294,6 @@ add_library(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} SHARED Tags.cpp ) -if(NOT WEBKIT_GLIB_API) - target_sources(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE InjectedBundle/Utils.cpp) -endif() - # This is a temporary solution. Normally we should leave this to the framework. # Do not replicate for other plugins. target_link_options(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE "-Wl,-z,nodelete") @@ -302,8 +322,7 @@ if (PLUGIN_WEBKITBROWSER_LOGGING_UTILS) target_sources(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE LoggingUtils.cpp) endif() -if (PLUGIN_WEBKITBROWSER_TESTING AND WEBKIT_GLIB_API) - # Enable for GLIB Api only +if (PLUGIN_WEBKITBROWSER_TESTING) target_compile_definitions(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE ENABLE_TESTING) include(Testing/CMakeLists.txt) endif() @@ -312,9 +331,7 @@ if(WPE_WEBKIT_DEPRECATED_API) target_compile_definitions(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE WPE_WEBKIT_DEPRECATED_API) endif() -if(WEBKIT_GLIB_API) - target_compile_definitions(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE WEBKIT_GLIB_API) -endif() +target_compile_definitions(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE WEBKIT_GLIB_API) if(PLUGIN_WEBKITBROWSER_USE_EXACT_PATHS) target_compile_definitions(${PLUGIN_WEBKITBROWSER_IMPLEMENTATION} PRIVATE USE_EXACT_PATHS) @@ -335,12 +352,7 @@ install( DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins COMPONENT ${PROJECT_NAME}) -if(WEBKIT_GLIB_API) - add_subdirectory(Extension) -else() - # also build injected bundle - add_subdirectory(InjectedBundle) -endif() +add_subdirectory(Extension) # resolution handling if(PLUGIN_WEBKITBROWSER_RESOLUTION EQUAL "720p") diff --git a/WebKitBrowser/HtmlApp.conf.in b/WebKitBrowser/HtmlApp.conf.in index 678681b818..f29b3257d0 100644 --- a/WebKitBrowser/HtmlApp.conf.in +++ b/WebKitBrowser/HtmlApp.conf.in @@ -9,12 +9,7 @@ configuration = JSON() configuration.add("url", "about:blank") configuration.add("useragent", "@PLUGIN_HTML_APP_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "@PLUGIN_HTML_APP_COMPOSITOR@") configuration.add("inspector", "@PLUGIN_HTML_APP_WEBINSPECTOR_ADDRESS@") @@ -39,7 +34,8 @@ configuration.add("localstoragesize", "@PLUGIN_HTML_APP_LOCALSTORAGESIZE@") configuration.add("cookiestorage", "@PLUGIN_HTML_APP_COOKIESTORAGE@") configuration.add("indexeddbenabled", "@PLUGIN_HTML_APP_INDEXEDDB_ENABLE@") configuration.add("indexeddbpath", "@PLUGIN_HTML_APP_INDEXEDDB_PATH@") -configuration.add("indexeddbsize", "@PLUGIN_HTML_APP_INDEXEDDB_SIZE@") +configuration.add("originstorageratio", "@PLUGIN_HTML_APP_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_HTML_APP_TOTAL_STORAGE_RATIO@") if boolean("@PLUGIN_HTML_APP_WINDOWCLOSE@"): configuration.add("windowclose", "true") @@ -99,3 +95,5 @@ memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") diff --git a/WebKitBrowser/HtmlApp.config b/WebKitBrowser/HtmlApp.config index dae8b78008..570991eacc 100644 --- a/WebKitBrowser/HtmlApp.config +++ b/WebKitBrowser/HtmlApp.config @@ -28,11 +28,7 @@ map() semicolon_safe_string(PLUGIN_HTML_APP_USERAGENT) kv(useragent ${PLUGIN_HTML_APP_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor ${PLUGIN_HTML_APP_COMPOSITOR}) kv(inspector ${PLUGIN_HTML_APP_WEBINSPECTOR_ADDRESS}) @@ -75,8 +71,11 @@ map() if(PLUGIN_HTML_APP_INDEXEDDB_PATH) kv(indexeddbpath ${PLUGIN_HTML_APP_INDEXEDDB_PATH}) endif() - if(PLUGIN_HTML_APP_INDEXEDDB_SIZE) - kv(indexeddbsize ${PLUGIN_HTML_APP_INDEXEDDB_SIZE}) + if(PLUGIN_HTML_APP_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_HTML_APP_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_HTML_APP_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_HTML_APP_TOTAL_STORAGE_RATIO}) endif() if(PLUGIN_HTML_APP_WINDOWCLOSE) kv(windowclose ${PLUGIN_HTML_APP_WINDOWCLOSE}) diff --git a/WebKitBrowser/JSPP.conf.in b/WebKitBrowser/JSPP.conf.in index 19a2e26bd7..a6d3e8c140 100644 --- a/WebKitBrowser/JSPP.conf.in +++ b/WebKitBrowser/JSPP.conf.in @@ -8,12 +8,7 @@ configuration = JSON() configuration.add("url", "@PLUGIN_JSPP_STARTURL@") configuration.add("useragent", "@PLUGIN_JSPP_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "noaa") configuration.add("inspector", "@PLUGIN_JSPP_WEBINSPECTOR_ADDRESS@") @@ -36,6 +31,10 @@ configuration.add("localstorageenabled", "@PLUGIN_JSPP_LOCALSTORAGE_ENABLE@") configuration.add("localstorage", "@PLUGIN_JSPP_LOCALSTORAGE@") configuration.add("localstoragesize", "@PLUGIN_JSPP_LOCALSTORAGESIZE@") configuration.add("cookiestorage", "@PLUGIN_JSPP_COOKIESTORAGE@") +configuration.add("indexeddbenabled", "@PLUGIN_JSPP_APP_INDEXEDDB_ENABLE@") +configuration.add("indexeddbpath", "@PLUGIN_JSPP_APP_INDEXEDDB_PATH@") +configuration.add("originstorageratio", "@PLUGIN_JSPP_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_JSPP_TOTAL_STORAGE_RATIO@") if boolean("@PLUGIN_JSPP_WINDOWCLOSE@"): configuration.add("windowclose", "true") @@ -151,3 +150,5 @@ memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") diff --git a/WebKitBrowser/JSPP.config b/WebKitBrowser/JSPP.config index e9627e93ff..ac71527365 100644 --- a/WebKitBrowser/JSPP.config +++ b/WebKitBrowser/JSPP.config @@ -28,11 +28,7 @@ map() semicolon_safe_string(PLUGIN_JSPP_USERAGENT) kv(useragent ${PLUGIN_JSPP_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor "noaa") kv(inspector ${PLUGIN_JSPP_WEBINSPECTOR_ADDRESS}) @@ -70,6 +66,18 @@ map() if(PLUGIN_JSPP_COOKIESTORAGE) kv(cookiestorage ${PLUGIN_JSPP_COOKIESTORAGE}) endif() + if(PLUGIN_JSPP_APP_INDEXEDDB_ENABLE) + kv(indexeddbenabled ${PLUGIN_JSPP_APP_INDEXEDDB_ENABLE}) + endif() + if(PLUGIN_JSPP_APP_INDEXEDDB_PATH) + kv(indexeddbpath ${PLUGIN_JSPP_APP_INDEXEDDB_PATH}) + endif() + if(PLUGIN_JSPP_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_JSPP_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_JSPP_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_JSPP_TOTAL_STORAGE_RATIO}) + endif() if(PLUGIN_JSPP_WINDOWCLOSE) kv(windowclose ${PLUGIN_JSPP_WINDOWCLOSE}) endif() diff --git a/WebKitBrowser/LightningApp.conf.in b/WebKitBrowser/LightningApp.conf.in index 382f1e1c5d..3810a14942 100644 --- a/WebKitBrowser/LightningApp.conf.in +++ b/WebKitBrowser/LightningApp.conf.in @@ -9,12 +9,7 @@ configuration = JSON() configuration.add("url", "about:blank") configuration.add("useragent", "@PLUGIN_LIGHTNING_APP_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "@PLUGIN_LIGHTNING_APP_COMPOSITOR@") configuration.add("inspector", "@PLUGIN_LIGHTNING_APP_WEBINSPECTOR_ADDRESS@") @@ -39,7 +34,8 @@ configuration.add("localstoragesize", "@PLUGIN_LIGHTNING_APP_LOCALSTORAGESIZE@") configuration.add("cookiestorage", "@PLUGIN_LIGHTNING_APP_COOKIESTORAGE@") configuration.add("indexeddbenabled", "@PLUGIN_LIGHTNING_APP_INDEXEDDB_ENABLE@") configuration.add("indexeddbpath", "@PLUGIN_LIGHTNING_APP_INDEXEDDB_PATH@") -configuration.add("indexeddbsize", "@PLUGIN_LIGHTNING_APP_INDEXEDDB_SIZE@") +configuration.add("originstorageratio", "@PLUGIN_LIGHTNING_APP_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_LIGHTNING_APP_TOTAL_STORAGE_RATIO@") if boolean("@PLUGIN_LIGHTNING_APP_WINDOWCLOSE@"): configuration.add("windowclose", "true") @@ -98,3 +94,6 @@ if ("@PLUGIN_LIGHTNING_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ A memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) + +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") \ No newline at end of file diff --git a/WebKitBrowser/LightningApp.config b/WebKitBrowser/LightningApp.config index 1e619b5f53..bf37a464d3 100644 --- a/WebKitBrowser/LightningApp.config +++ b/WebKitBrowser/LightningApp.config @@ -28,11 +28,7 @@ map() semicolon_safe_string(PLUGIN_LIGHTNING_APP_USERAGENT) kv(useragent ${PLUGIN_LIGHTNING_APP_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor ${PLUGIN_LIGHTNING_APP_COMPOSITOR}) kv(inspector ${PLUGIN_LIGHTNING_APP_WEBINSPECTOR_ADDRESS}) @@ -75,8 +71,11 @@ map() if(PLUGIN_LIGHTNING_APP_INDEXEDDB_PATH) kv(indexeddbpath ${PLUGIN_LIGHTNING_APP_INDEXEDDB_PATH}) endif() - if(PLUGIN_LIGHTNING_APP_INDEXEDDB_SIZE) - kv(indexeddbsize ${PLUGIN_LIGHTNING_APP_INDEXEDDB_SIZE}) + if(PLUGIN_LIGHTNING_APP_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_LIGHTNING_APP_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_LIGHTNING_APP_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_LIGHTNING_APP_TOTAL_STORAGE_RATIO}) endif() if(PLUGIN_LIGHTNING_APP_WINDOWCLOSE) kv(windowclose ${PLUGIN_LIGHTNING_APP_WINDOWCLOSE}) diff --git a/WebKitBrowser/ResidentApp.conf.in b/WebKitBrowser/ResidentApp.conf.in index 69208ebbc0..efb2840572 100644 --- a/WebKitBrowser/ResidentApp.conf.in +++ b/WebKitBrowser/ResidentApp.conf.in @@ -8,12 +8,7 @@ configuration = JSON() configuration.add("url", "@PLUGIN_RESIDENT_APP_STARTURL@") configuration.add("useragent", "@PLUGIN_RESIDENT_APP_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "@PLUGIN_RESIDENT_APP_COMPOSITOR@") configuration.add("inspector", "@PLUGIN_RESIDENT_APP_WEBINSPECTOR_ADDRESS@") @@ -38,7 +33,8 @@ configuration.add("localstoragesize", "@PLUGIN_RESIDENT_APP_LOCALSTORAGESIZE@") configuration.add("cookiestorage", "@PLUGIN_RESIDENT_APP_COOKIESTORAGE@") configuration.add("indexeddbenabled", "@PLUGIN_RESIDENT_APP_INDEXEDDB_ENABLE@") configuration.add("indexeddbpath", "@PLUGIN_RESIDENT_APP_INDEXEDDB_PATH@") -configuration.add("indexeddbsize", "@PLUGIN_RESIDENT_APP_INDEXEDDB_SIZE@") +configuration.add("originstorageratio", "@PLUGIN_RESIDENT_APP_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_RESIDENT_APP_TOTAL_STORAGE_RATIO@") if "@PLUGIN_WEBKITBROWSER_CLIENT_CERT@" != "" and "@PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY@" != "": configuration.add("clientcert", "@PLUGIN_WEBKITBROWSER_CLIENT_CERT@") @@ -93,3 +89,6 @@ if ("@PLUGIN_RESIDENT_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ AN memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) + +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") diff --git a/WebKitBrowser/ResidentApp.config b/WebKitBrowser/ResidentApp.config index a51e31ea23..6a743df793 100644 --- a/WebKitBrowser/ResidentApp.config +++ b/WebKitBrowser/ResidentApp.config @@ -29,10 +29,7 @@ map() semicolon_safe_string(PLUGIN_RESIDENT_APP_USERAGENT) kv(useragent ${PLUGIN_RESIDENT_APP_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) endif() kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor ${PLUGIN_RESIDENT_APP_COMPOSITOR}) @@ -76,8 +73,11 @@ map() if(PLUGIN_RESIDENT_APP_INDEXEDDB_PATH) kv(indexeddbpath ${PLUGIN_RESIDENT_APP_INDEXEDDB_PATH}) endif() - if(PLUGIN_RESIDENT_APP_INDEXEDDB_SIZE) - kv(indexeddbsize ${PLUGIN_RESIDENT_APP_INDEXEDDB_SIZE}) + if(PLUGIN_RESIDENT_APP_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_RESIDENT_APP_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_RESIDENT_APP_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_RESIDENT_APP_TOTAL_STORAGE_RATIO}) endif() if(PLUGIN_WEBKITBROWSER_CLIENT_CERT AND PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY) kv(clientcert ${PLUGIN_WEBKITBROWSER_CLIENT_CERT}) diff --git a/WebKitBrowser/SearchAndDiscoveryApp.conf.in b/WebKitBrowser/SearchAndDiscoveryApp.conf.in index cadea0216f..454528cc0b 100644 --- a/WebKitBrowser/SearchAndDiscoveryApp.conf.in +++ b/WebKitBrowser/SearchAndDiscoveryApp.conf.in @@ -9,12 +9,7 @@ configuration = JSON() configuration.add("url", "about:blank") configuration.add("useragent", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_COMPOSITOR@") configuration.add("inspector", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_WEBINSPECTOR_ADDRESS@") @@ -39,7 +34,8 @@ configuration.add("localstoragesize", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_LOCALSTO configuration.add("cookiestorage", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_COOKIESTORAGE@") configuration.add("indexeddbenabled", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_ENABLE@") configuration.add("indexeddbpath", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_PATH@") -configuration.add("indexeddbsize", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_SIZE@") +configuration.add("originstorageratio", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_SEARCH_AND_DISCOVERY_APP_TOTAL_STORAGE_RATIO@") if "@PLUGIN_WEBKITBROWSER_CLIENT_CERT@" != "" and "@PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY@" != "": configuration.add("clientcert", "@PLUGIN_WEBKITBROWSER_CLIENT_CERT@") @@ -94,3 +90,6 @@ if ("@PLUGIN_SEARCH_AND_DISCOVERY_APP_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTIN memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) + +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") diff --git a/WebKitBrowser/SearchAndDiscoveryApp.config b/WebKitBrowser/SearchAndDiscoveryApp.config index 6247a729a6..33a803899a 100644 --- a/WebKitBrowser/SearchAndDiscoveryApp.config +++ b/WebKitBrowser/SearchAndDiscoveryApp.config @@ -28,11 +28,7 @@ map() semicolon_safe_string(PLUGIN_SEARCH_AND_DISCOVERY_APP_USERAGENT) kv(useragent ${PLUGIN_SEARCH_AND_DISCOVERY_APP_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor ${PLUGIN_SEARCH_AND_DISCOVERY_APP_COMPOSITOR}) kv(inspector ${PLUGIN_SEARCH_AND_DISCOVERY_APP_WEBINSPECTOR_ADDRESS}) @@ -75,8 +71,11 @@ map() if(PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_PATH) kv(indexeddbpath ${PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_PATH}) endif() - if(PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_SIZE) - kv(indexeddbsize ${PLUGIN_SEARCH_AND_DISCOVERY_APP_INDEXEDDB_SIZE}) + if(PLUGIN_SEARCH_AND_DISCOVERY_APP_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_SEARCH_AND_DISCOVERY_APP_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_SEARCH_AND_DISCOVERY_APP_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_SEARCH_AND_DISCOVERY_APP_TOTAL_STORAGE_RATIO}) endif() if(PLUGIN_WEBKITBROWSER_CLIENT_CERT AND PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY) kv(clientcert ${PLUGIN_WEBKITBROWSER_CLIENT_CERT}) diff --git a/WebKitBrowser/UX.config b/WebKitBrowser/UX.config deleted file mode 100644 index d2aea3ffc7..0000000000 --- a/WebKitBrowser/UX.config +++ /dev/null @@ -1,128 +0,0 @@ -set(autostart ${PLUGIN_UX_AUTOSTART}) - -set(preconditions Graphics) - -if(PLUGIN_UX_STARTUPORDER) -set (startuporder ${PLUGIN_UX_STARTUPORDER}) -endif() - -map() - kv(mode ${PLUGIN_UX_MODE}) - kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) - if(PLUGIN_WEBKITBROWSER_USER) - kv(user ${PLUGIN_WEBKITBROWSER_USER}) - endif() - if(PLUGIN_WEBKITBROWSER_GROUP) - kv(group ${PLUGIN_WEBKITBROWSER_GROUP}) - endif() -end() -ans(rootobject) - -map() - kv(url "about:blank") - if(PLUGIN_UX_USERAGENT) - semicolon_safe_string(PLUGIN_UX_USERAGENT) - kv(useragent ${PLUGIN_UX_USERAGENT}) - endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() - kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) - kv(compositor "aa") - kv(inspector ${PLUGIN_UX_WEBINSPECTOR_ADDRESS}) - kv(fps true) - kv(cursor false) - kv(touch false) - kv(msebuffers "${PLUGIN_UX_MSEBUFFERS}") - kv(thunderdecryptorpreference ${PLUGIN_WEBKITBROWSER_THUNDER_DECRYPTOR_PREFERENCE}) - kv(memoryprofile ${PLUGIN_WEBKITBROWSER_MEMORYPROFILE}) - kv(mediacontenttypesrequiringhardwaresupport ${PLUGIN_WEBKITBROWSER_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT}) - kv(mediadiskcache ${PLUGIN_WEBKITBROWSER_MEDIADISKCACHE}) - kv(diskcache ${PLUGIN_WEBKITBROWSER_DISKCACHE}) - kv(xhrcache ${PLUGIN_WEBKITBROWSER_XHRCACHE}) - kv(noncompositedwebgl true) - kv(secure false) - kv(webgl ${PLUGIN_WEBKITBROWSER_WEBGL}) - kv(threadedpainting ${PLUGIN_WEBKITBROWSER_THREADEDPAINTING}) - if(PLUGIN_WEBKITBROWSER_HEIGHT) - kv(height ${PLUGIN_WEBKITBROWSER_HEIGHT}) - endif() - if(PLUGIN_WEBKITBROWSER_WIDTH) - kv(width ${PLUGIN_WEBKITBROWSER_WIDTH}) - endif() - if(PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER) - kv(clientidentifier ${PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER}) - endif() - if(DEFINED PLUGIN_UX_SECURE) - kv(secure ${PLUGIN_UX_SECURE}) - endif() - kv(localstorageenabled ${PLUGIN_UX_LOCALSTORAGE_ENABLE}) - if(PLUGIN_WEBKITBROWSER_LOCALSTORAGE) - kv(localstorage ${PLUGIN_WEBKITBROWSER_LOCALSTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_COOKIESTORAGE) - kv(cookiestorage ${PLUGIN_WEBKITBROWSER_COOKIESTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH) - kv(execpath ${PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY) - kv(proxy ${PLUGIN_WEBKITBROWSER_HTTP_PROXY}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION) - kv(proxyexclusion ${PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION}) - endif() -end() -ans(configuration) - -map_append(${configuration} root ${rootobject}) - -map() -if(PLUGIN_WEBKITBROWSER_ENABLE_JIT) - kv(useJIT true) -else() - kv(useJIT false) -endif() -if(PLUGIN_WEBKITBROWSER_ENABLE_DFG) - kv(useDFG true) -else() - kv(useDFG false) -endif() -end() -ans(javascriptsettings) -map_append(${configuration} javascript ${javascriptsettings}) - -map() -if(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT OR (PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) OR PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - key(webprocesssettings) - map() -if(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) - kv(gpulimit ${PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT}) - kv(gpufile ${PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE}) -endif() -if(PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_UX_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() - -if(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT OR PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - key(networkprocesssettings) - map() -if(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_UX_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() -end() -ans(memory) - -map_append(${configuration} memory ${memory}) diff --git a/WebKitBrowser/WebKitBrowser.conf.in b/WebKitBrowser/WebKitBrowser.conf.in index 067cad5a60..fcb28cf978 100644 --- a/WebKitBrowser/WebKitBrowser.conf.in +++ b/WebKitBrowser/WebKitBrowser.conf.in @@ -15,12 +15,7 @@ configuration = JSON() configuration.add("url", "@PLUGIN_WEBKITBROWSER_STARTURL@") configuration.add("useragent", "@PLUGIN_WEBKITBROWSER_USERAGENT@") - -if not boolean("@WEBKIT_GLIB_API@"): - configuration.add("injectedbundle", "libWPEInjectedBundle@CMAKE_SHARED_LIBRARY_SUFFIX@") -else: - configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") - +configuration.add("extensiondir", "@PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY@") configuration.add("transparent", "@PLUGIN_WEBKITBROWSER_TRANSPARENT@") configuration.add("compositor", "noaa") configuration.add("inspector", "@PLUGIN_WEBKITBROWSER_WEBINSPECTOR_ADDRESS@") @@ -46,7 +41,8 @@ configuration.add("localstorage", "@PLUGIN_WEBKITBROWSER_LOCALSTORAGE@") configuration.add("cookiestorage", "@PLUGIN_WEBKITBROWSER_COOKIESTORAGE@") configuration.add("indexeddbenabled", "@PLUGIN_WEBKITBROWSER_INDEXEDDB_ENABLE@") configuration.add("indexeddbpath", "@PLUGIN_WEBKITBROWSER_INDEXEDDB_PATH@") -configuration.add("indexeddbsize", "@PLUGIN_WEBKITBROWSER_INDEXEDDB_SIZE@") +configuration.add("originstorageratio", "@PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO@") +configuration.add("totalstorageratio", "@PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO@") if boolean("@PLUGIN_WEBKITBROWSER_WINDOWCLOSE@"): configuration.add("windowclose", "@PLUGIN_WEBKITBROWSER_WINDOWCLOSE@") @@ -108,3 +104,6 @@ if ("@PLUGIN_WEBKITBROWSER_MEMORYPRESSURE_SERVICEWORKERPROCESS_SETTINGS_LIMIT@ A memory.add("serviceworkerprocesssettings", serviceworkerprocesssettings) configuration.add("memory", memory) + +configuration.add("gstquirks", "@PLUGIN_WEBKITBROWSER_GST_QUIRKS@") +configuration.add("gstholepunchquirk", "@PLUGIN_WEBKITBROWSER_GST_HOLE_PUNCH_QUIRK@") \ No newline at end of file diff --git a/WebKitBrowser/WebKitBrowser.config b/WebKitBrowser/WebKitBrowser.config index 72cb33b228..eb1d016fbf 100644 --- a/WebKitBrowser/WebKitBrowser.config +++ b/WebKitBrowser/WebKitBrowser.config @@ -33,11 +33,7 @@ map() semicolon_safe_string(PLUGIN_WEBKITBROWSER_USERAGENT) kv(useragent ${PLUGIN_WEBKITBROWSER_USERAGENT}) endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() + kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) kv(compositor "noaa") kv(inspector ${PLUGIN_WEBKITBROWSER_WEBINSPECTOR_ADDRESS}) @@ -78,8 +74,11 @@ map() if(PLUGIN_WEBKITBROWSER_INDEXEDDB_PATH) kv(indexeddbpath ${PLUGIN_WEBKITBROWSER_INDEXEDDB_PATH}) endif() - if(PLUGIN_WEBKITBROWSER_INDEXEDDB_SIZE) - kv(indexeddbsize ${PLUGIN_WEBKITBROWSER_INDEXEDDB_SIZE}) + if(PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO) + kv(originstorageratio ${PLUGIN_WEBKITBROWSER_ORIGIN_STORAGE_RATIO}) + endif() + if(PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO) + kv(totalstorageratio ${PLUGIN_WEBKITBROWSER_TOTAL_STORAGE_RATIO}) endif() if(PLUGIN_WEBKITBROWSER_WINDOWCLOSE) kv(windowclose ${PLUGIN_WEBKITBROWSER_WINDOWCLOSE}) diff --git a/WebKitBrowser/WebKitImplementation.cpp b/WebKitBrowser/WebKitImplementation.cpp index 24a1e01e26..564dc26b50 100644 --- a/WebKitBrowser/WebKitImplementation.cpp +++ b/WebKitBrowser/WebKitImplementation.cpp @@ -26,42 +26,8 @@ #include "Module.h" -#ifdef WEBKIT_GLIB_API #include #include "Tags.h" -#else -#include -#include -#include // TODO: add ref to this header in WebKit.h? -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "BrowserConsoleLog.h" -#include "Tags.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef pid_t WKProcessID; -typedef void (*WKPageIsWebProcessResponsiveFunction)(bool isWebProcessResponsive, void* context); -WK_EXPORT void WKPageIsWebProcessResponsive(WKPageRef page, void* context, WKPageIsWebProcessResponsiveFunction function); -WK_EXPORT WKProcessID WKPageGetProcessIdentifier(WKPageRef page); -WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bool enabled); - -#ifdef __cplusplus -} -#endif - -#endif - #include #include @@ -78,11 +44,11 @@ WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bo #include "LoggingUtils.h" #endif - -#if !WEBKIT_GLIB_API -#define HAS_MEMORY_PRESSURE_SETTINGS_API 0 -#else #define HAS_MEMORY_PRESSURE_SETTINGS_API WEBKIT_CHECK_VERSION(2, 38, 0) + +#define HAS_SCREEN_HDR_API WEBKIT_CHECK_VERSION(2, 46, 0) +#if HAS_SCREEN_HDR_API +#include #endif #ifdef ENABLE_TESTING @@ -91,271 +57,6 @@ WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bo namespace WPEFramework { namespace Plugin { - -#ifndef WEBKIT_GLIB_API - static void onDidReceiveSynchronousMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, - WKTypeRef messageBodyObj, WKTypeRef* returnData, const void* clientInfo); - static void onNotificationShow(WKPageRef page, WKNotificationRef notification, const void* clientInfo); - static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo); - static void didFinishDocumentLoad(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo); - static void onFrameDisplayed(WKViewRef view, const void* clientInfo); - static void didSameDocumentNavigation(const OpaqueWKPage* page, const OpaqueWKNavigation* nav, unsigned int count, const void* clientInfo, const void* info); - static void requestClosure(const void* clientInfo); - static void didRequestAutomationSession(WKContextRef context, WKStringRef sessionID, const void* clientInfo); - static WKPageRef onAutomationSessionRequestNewPage(WKWebAutomationSessionRef session, const void* clientInfo); - static void decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef response, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo); - static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef, const void *clientInfo); - static void didFailNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef, const void *clientInfo); - static void webProcessDidCrash(WKPageRef page, const void* clientInfo); - static void willAddDetailedMessageToConsole(WKPageRef, WKStringRef source, WKStringRef, uint64_t line, uint64_t column, WKStringRef message, WKStringRef, const void* clientInfo); - - struct GCharDeleter { - void operator()(gchar* ptr) const { g_free(ptr); } - }; - - // ----------------------------------------------------------------------------------------------------- - // Hide all NASTY C details that come with the POC libraries !!!!! - // ----------------------------------------------------------------------------------------------------- - static WKPageNavigationClientV0 _handlerWebKit = { - { 0, nullptr }, - // decidePolicyForNavigationAction - [](WKPageRef, WKNavigationActionRef, WKFramePolicyListenerRef listener, WKTypeRef, const void* customData) { - WKFramePolicyListenerUse(listener); - }, - decidePolicyForNavigationResponse, - nullptr, // decidePolicyForPluginLoad - didStartProvisionalNavigation, - nullptr, // didReceiveServerRedirectForProvisionalNavigation - didFailProvisionalNavigation, - nullptr, // didCommitNavigation - nullptr, // didFinishNavigation - didFailNavigation, - nullptr, // didFailProvisionalLoadInSubframe - didFinishDocumentLoad, - didSameDocumentNavigation, // didSameDocumentNavigation - nullptr, // renderingProgressDidChange - nullptr, // canAuthenticateAgainstProtectionSpace - nullptr, // didReceiveAuthenticationChallenge - webProcessDidCrash, - nullptr, // copyWebCryptoMasterKey - nullptr, // didBeginNavigationGesture - nullptr, // willEndNavigationGesture - nullptr, // didEndNavigationGesture - nullptr, // didRemoveNavigationGestureSnapshot - }; - - static WKContextInjectedBundleClientV1 _handlerInjectedBundle = { - { 1, nullptr }, - nullptr, // didReceiveMessageFromInjectedBundle - // didReceiveSynchronousMessageFromInjectedBundle - onDidReceiveSynchronousMessageFromInjectedBundle, - nullptr, // getInjectedBundleInitializationUserData - }; - - WKGeolocationProviderV0 _handlerGeolocationProvider = { - { 0, nullptr }, - // startUpdating - [](WKGeolocationManagerRef geolocationManager, const void* clientInfo) { - std::cerr << "in WKGeolocationProviderV0::startUpdating" << std::endl; - WKGeolocationPositionRef position = WKGeolocationPositionCreate(0.0, 51.49, 4.40, 1.0); - WKGeolocationManagerProviderDidChangePosition(geolocationManager, position); - }, - nullptr, // stopUpdating - }; - - WKPageUIClientV8 _handlerPageUI = { - { 8, nullptr }, - nullptr, // createNewPage_deprecatedForUseWithV0 - nullptr, // showPage - // close - [](const OpaqueWKPage*, const void* clientInfo) { - requestClosure(clientInfo); - }, - nullptr, // takeFocus - nullptr, // focus - nullptr, // unfocus - nullptr, // runJavaScriptAlert_deprecatedForUseWithV0 - nullptr, // runJavaScriptConfirm_deprecatedForUseWithV0 - nullptr, // runJavaScriptPrompt_deprecatedForUseWithV0 - nullptr, // setStatusText - nullptr, // mouseDidMoveOverElement_deprecatedForUseWithV0 - nullptr, // missingPluginButtonClicked_deprecatedForUseWithV0 - nullptr, // didNotHandleKeyEvent - nullptr, // didNotHandleWheelEvent - nullptr, // toolbarsAreVisible - nullptr, // setToolbarsAreVisible - nullptr, // menuBarIsVisible - nullptr, // setMenuBarIsVisible - nullptr, // statusBarIsVisible - nullptr, // setStatusBarIsVisible - nullptr, // isResizable - nullptr, // setIsResizable - nullptr, // getWindowFrame - nullptr, // setWindowFrame - nullptr, // runBeforeUnloadConfirmPanel - nullptr, // didDraw - nullptr, // pageDidScroll - nullptr, // exceededDatabaseQuota - nullptr, // runOpenPanel - // decidePolicyForGeolocationPermissionRequest - [](WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo) { - WKGeolocationPermissionRequestAllow(permissionRequest); - }, - nullptr, // headerHeight - nullptr, // footerHeight - nullptr, // drawHeader - nullptr, // drawFooter - nullptr, // printFrame - nullptr, // runModal - nullptr, // unused1 - nullptr, // saveDataToFileInDownloadsFolder - nullptr, // shouldInterruptJavaScript_unavailable - nullptr, // createNewPage_deprecatedForUseWithV1 - nullptr, // mouseDidMoveOverElement - // decidePolicyForNotificationPermissionRequest - [](WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void* clientInfo) { - WKNotificationPermissionRequestAllow(permissionRequest); - }, - nullptr, // unavailablePluginButtonClicked_deprecatedForUseWithV1 - nullptr, // showColorPicker - nullptr, // hideColorPicker - nullptr, // unavailablePluginButtonClicked - nullptr, // pinnedStateDidChange - nullptr, // didBeginTrackingPotentialLongMousePress - nullptr, // didRecognizeLongMousePress - nullptr, // didCancelTrackingPotentialLongMousePress - nullptr, // isPlayingAudioDidChange - // decidePolicyForUserMediaPermissionRequest - [](WKPageRef, WKFrameRef, WKSecurityOriginRef, WKSecurityOriginRef, WKUserMediaPermissionRequestRef permission, const void*) { - auto audioDevices = WKUserMediaPermissionRequestAudioDeviceUIDs(permission); - auto videoDevices = WKUserMediaPermissionRequestVideoDeviceUIDs(permission); - auto audioDevice = WKStringCreateWithUTF8CString("NO AUDIO DEVICE FOUND"); - if (WKArrayGetSize(audioDevices) > 0) { - audioDevice = static_cast(WKArrayGetItemAtIndex(audioDevices, 0)); - } - auto videoDevice = WKStringCreateWithUTF8CString("NO VIDEO DEVICE FOUND"); - if (WKArrayGetSize(videoDevices) > 0) { - videoDevice = static_cast(WKArrayGetItemAtIndex(videoDevices, 0)); - } - WKUserMediaPermissionRequestAllow(permission, audioDevice, videoDevice); - }, - nullptr, // didClickAutoFillButton - nullptr, // runJavaScriptAlert - nullptr, // runJavaScriptConfirm - nullptr, // runJavaScriptPrompt - nullptr, // mediaSessionMetadataDidChange - nullptr, // createNewPage - nullptr, // runJavaScriptAlert - nullptr, // runJavaScriptConfirm - nullptr, // runJavaScriptPrompt - nullptr, // checkUserMediaPermissionForOrigin - nullptr, // runBeforeUnloadConfirmPanel - nullptr, // fullscreenMayReturnToInline - willAddDetailedMessageToConsole, - }; - - WKNotificationProviderV0 _handlerNotificationProvider = { - { 0, nullptr }, - // show - onNotificationShow, - nullptr, // cancel - nullptr, // didDestroyNotification - nullptr, // addNotificationManager - nullptr, // removeNotificationManager - nullptr, // notificationPermissions - nullptr, // clearNotifications - }; - - WKViewClientV0 _viewClient = { - { 0, nullptr }, - // frameDisplayed - onFrameDisplayed, - }; - - WKContextAutomationClientV0 _handlerAutomation = { - { 0, nullptr }, - // allowsRemoteAutomation - [](WKContextRef, const void*) -> bool { - return true; - }, - didRequestAutomationSession, - // browserName - [](WKContextRef, const void*) -> WKStringRef { - return WKStringCreateWithUTF8CString("WPEWebKitBrowser"); - }, - // browserVersion - [](WKContextRef, const void*) -> WKStringRef { - return WKStringCreateWithUTF8CString("1.0"); - } - }; - - WKWebAutomationsessionClientV0 _handlerAutomationSession = { - { 0, nullptr }, - // requestNewPage - onAutomationSessionRequestNewPage - }; - - static string WKStringToString(WKStringRef wkStringRef) { - size_t bufferSize = WKStringGetMaximumUTF8CStringSize(wkStringRef); - std::unique_ptr buffer(new char[bufferSize]); - size_t stringLength = WKStringGetUTF8CString(wkStringRef, buffer.get(), bufferSize); - return Core::ToString(buffer.get(), stringLength - 1); - } - static std::vector ConvertWKArrayToStringVector(WKArrayRef array) { - size_t arraySize = WKArrayGetSize(array); - - std::vector stringVector; - - stringVector.reserve(arraySize); - for (unsigned int index = 0; index < arraySize; ++index) { - stringVector.emplace_back(WKStringToString(static_cast(WKArrayGetItemAtIndex(array, index)))); - } - - return stringVector; - } - - static string GetPageActiveURL(WKPageRef page) - { - string activeURL; - WKURLRef urlRef = WKPageCopyActiveURL(page); - if (urlRef) { - WKStringRef urlStringRef = WKURLCopyString(urlRef); - activeURL = WKStringToString(urlStringRef); - WKRelease(urlStringRef); - WKRelease(urlRef); - } - return activeURL; - } - - /* --------------------------------------------------------------------------------------------------- -struct CustomLoopHandler -{ - GSource source; - uint32_t attentionPending; -}; -static gboolean source_prepare(GSource*, gint*) -{ - return (false); -} -static gboolean source_check(GSource* mySource) -{ - return (static_cast(mySource)->attentionPending != 0); -} -static gboolean source_dispatch (GSource*, GSourceFunc callback, gpointer) -{ - uint32_t attention (static_cast(mySource)->attentionPending); - -} -static GSourceFuncs _handlerIntervention = -{ - source_prepare, - source_check, - source_dispatch, - nullptr -}; ---------------------------------------------------------------------------------------------------- */ -#endif // !WEBKIT_GLIB_API - static Exchange::IWebBrowser* implementation = nullptr; static void CloseDown() @@ -382,7 +83,11 @@ static GSourceFuncs _handlerIntervention = #if defined(ENABLE_CLOUD_COOKIE_JAR) public Exchange::IBrowserCookieJar, #endif - public PluginHost::IStateControl { + public PluginHost::IStateControl +#if HAS_SCREEN_HDR_API + , public Exchange::IConnectionProperties::INotification +#endif + { public: class BundleConfig : public Core::JSON::Container { private: @@ -580,7 +285,8 @@ static GSourceFuncs _handlerIntervention = , LocalStorageSize() , IndexedDBEnabled(false) , IndexedDBPath() - , IndexedDBSize() + , OriginStorageRatio() + , TotalStorageRatio() , Secure(false) , InjectedBundle() , Transparent(false) @@ -635,6 +341,9 @@ static GSourceFuncs _handlerIntervention = , Testing(false) , ServiceWorkerEnabled(false) , ICECandidateFilteringEnabled() + , GstQuirks() + , GstHolePunchQuirk() + , HDRRefreshDelay(1000) // Default to 1 second for HDR refresh delay { Add(_T("useragent"), &UserAgent); Add(_T("url"), &URL); @@ -647,7 +356,8 @@ static GSourceFuncs _handlerIntervention = Add(_T("localstoragesize"), &LocalStorageSize); Add(_T("indexeddbenabled"), &IndexedDBEnabled); Add(_T("indexeddbpath"), &IndexedDBPath); - Add(_T("indexeddbsize"), &IndexedDBSize); + Add(_T("originstorageratio"), &OriginStorageRatio); + Add(_T("totalstorageratio"), &TotalStorageRatio); Add(_T("secure"), &Secure); Add(_T("injectedbundle"), &InjectedBundle); Add(_T("transparent"), &Transparent); @@ -704,6 +414,9 @@ static GSourceFuncs _handlerIntervention = Add(_T("testing"), &Testing); Add(_T("serviceworker"), &ServiceWorkerEnabled); Add(_T("icecandidatefiltering"), &ICECandidateFilteringEnabled); + Add(_T("gstquirks"), &GstQuirks); + Add(_T("gstholepunchquirk"), &GstHolePunchQuirk); + Add(_T("hdrrefreshDelay"), &HDRRefreshDelay); } ~Config() { @@ -721,7 +434,8 @@ static GSourceFuncs _handlerIntervention = Core::JSON::DecUInt16 LocalStorageSize; Core::JSON::Boolean IndexedDBEnabled; Core::JSON::String IndexedDBPath; - Core::JSON::DecUInt16 IndexedDBSize; // [KB] + Core::JSON::Float OriginStorageRatio; // [ratio of volume space for each domain] + Core::JSON::Float TotalStorageRatio; // [ratio of volume space for all domains] Core::JSON::Boolean Secure; Core::JSON::String InjectedBundle; Core::JSON::Boolean Transparent; @@ -778,6 +492,9 @@ static GSourceFuncs _handlerIntervention = Core::JSON::Boolean Testing; Core::JSON::Boolean ServiceWorkerEnabled; Core::JSON::Boolean ICECandidateFilteringEnabled; + Core::JSON::String GstQuirks; + Core::JSON::String GstHolePunchQuirk; + Core::JSON::DecUInt16 HDRRefreshDelay; // Delay in miliseconds to refresh HDR support }; class HangDetector @@ -895,21 +612,11 @@ static GSourceFuncs _handlerIntervention = , _headers() , _localStorageEnabled(false) , _httpStatusCode(-1) -#ifdef WEBKIT_GLIB_API , _view(nullptr) , _guid(Core::Time::Now().Ticks()) , _httpCookieAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY) , _extensionPath() , _ignoreLoadFinishedOnce(false) -#else - , _view() - , _page() - , _automationSession(nullptr) - , _notificationManager() - , _httpCookieAcceptPolicy(kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain) - , _navigationRef(nullptr) - , _userContentController(nullptr) -#endif , _adminLock() , _fps(0) , _loop(nullptr) @@ -927,6 +634,11 @@ static GSourceFuncs _handlerIntervention = , _unresponsiveReplyNum(0) , _frameCount(0) , _lastDumpTime(g_get_monotonic_time()) +#if HAS_SCREEN_HDR_API + ,_displayInfoPlugin(nullptr) + ,_displayConnectionProps(nullptr) + ,_hdrSupported(false) +#endif // HAS_SCREEN_HDR_API { // Register an @Exit, in case we are killed, with an incorrect ref count !! if (atexit(CloseDown) != 0) { @@ -957,6 +669,10 @@ static GSourceFuncs _handlerIntervention = TRACE(Trace::Information, (_T("Bailed out before the end of the WPE main app was reached. %d"), 6000)); } +#if HAS_SCREEN_HDR_API + UnsubscribeHDRCapabilities(); +#endif + implementation = nullptr; } @@ -986,19 +702,9 @@ static GSourceFuncs _handlerIntervention = object->_adminLock.Lock(); object->_headers = headers; object->_adminLock.Unlock(); -#ifdef WEBKIT_GLIB_API webkit_web_view_send_message_to_page(object->_view, webkit_user_message_new(Tags::Headers, g_variant_new("s", headers.c_str())), nullptr, nullptr, nullptr); -#else - auto messageName = WKStringCreateWithUTF8CString(Tags::Headers); - auto messageBody = WKStringCreateWithUTF8CString(headers.c_str()); - - WKPagePostMessageToInjectedBundle(object->_page, messageName, messageBody); - - WKRelease(messageBody); - WKRelease(messageName); -#endif return G_SOURCE_REMOVE; }, data, @@ -1040,14 +746,8 @@ static GSourceFuncs _handlerIntervention = object->_adminLock.Lock(); object->_config.UserAgent = useragent; object->_adminLock.Unlock(); -#ifdef WEBKIT_GLIB_API WebKitSettings* settings = webkit_web_view_get_settings(object->_view); webkit_settings_set_user_agent(settings, useragent.c_str()); -#else - auto ua = WKStringCreateWithUTF8CString(useragent.c_str()); - WKPageSetCustomUserAgent(object->_page, ua); - WKRelease(ua); -#endif return G_SOURCE_REMOVE; }, data, @@ -1085,15 +785,8 @@ static GSourceFuncs _handlerIntervention = object->_adminLock.Lock(); object->_localStorageEnabled = enabled; object->_adminLock.Unlock(); - -#ifdef WEBKIT_GLIB_API WebKitSettings* settings = webkit_web_view_get_settings(object->_view); webkit_settings_set_enable_html5_local_storage(settings, enabled); -#else - auto group = WKPageGetPageGroup(object->_page); - auto preferences = WKPageGroupGetPreferences(group); - WKPreferencesSetLocalStorageEnabled(preferences, enabled); -#endif return G_SOURCE_REMOVE; }, data, @@ -1106,7 +799,6 @@ static GSourceFuncs _handlerIntervention = uint32_t HTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyType& policy) const override { -#ifdef WEBKIT_GLIB_API auto translatePolicy = [](WebKitCookieAcceptPolicy policy) { switch(policy) { @@ -1120,23 +812,6 @@ static GSourceFuncs _handlerIntervention = ASSERT(false); return Exchange::IWebBrowser::ONLY_FROM_MAIN_DOCUMENT_DOMAIN; }; -#else - auto translatePolicy = - [](WKHTTPCookieAcceptPolicy policy) { - switch(policy) { - case kWKHTTPCookieAcceptPolicyAlways: - return Exchange::IWebBrowser::ALWAYS; - case kWKHTTPCookieAcceptPolicyNever: - return Exchange::IWebBrowser::NEVER; - case kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain: - return Exchange::IWebBrowser::ONLY_FROM_MAIN_DOCUMENT_DOMAIN; - case kWKHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain: - return Exchange::IWebBrowser::EXCLUSIVELY_FROM_MAIN_DOCUMENT_DOMAIN; - } - ASSERT(false); - return Exchange::IWebBrowser::ONLY_FROM_MAIN_DOCUMENT_DOMAIN; - }; -#endif _adminLock.Lock(); policy = translatePolicy(_httpCookieAcceptPolicy); _adminLock.Unlock(); @@ -1148,7 +823,6 @@ static GSourceFuncs _handlerIntervention = if (_context == nullptr) return Core::ERROR_GENERAL; -#ifdef WEBKIT_GLIB_API auto translatePolicy = [](Exchange::IWebBrowser::HTTPCookieAcceptPolicyType policy) { switch(policy) { @@ -1164,24 +838,6 @@ static GSourceFuncs _handlerIntervention = return WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY; }; using SetHTTPCookieAcceptPolicyData = std::tuple; -#else - auto translatePolicy = - [](Exchange::IWebBrowser::HTTPCookieAcceptPolicyType policy) { - switch(policy) { - case Exchange::IWebBrowser::ALWAYS: - return kWKHTTPCookieAcceptPolicyAlways; - case Exchange::IWebBrowser::NEVER: - return kWKHTTPCookieAcceptPolicyNever; - case Exchange::IWebBrowser::ONLY_FROM_MAIN_DOCUMENT_DOMAIN: - return kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; - case Exchange::IWebBrowser::EXCLUSIVELY_FROM_MAIN_DOCUMENT_DOMAIN: - return kWKHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain; - } - ASSERT(false); - return kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; - }; - using SetHTTPCookieAcceptPolicyData = std::tuple; -#endif auto* data = new SetHTTPCookieAcceptPolicyData(this, translatePolicy(policy)); g_main_context_invoke_full( @@ -1190,7 +846,6 @@ static GSourceFuncs _handlerIntervention = [](gpointer customdata) -> gboolean { auto& data = *static_cast(customdata); WebKitImplementation* object = std::get<0>(data); -#ifdef WEBKIT_GLIB_API WebKitCookieAcceptPolicy policy = std::get<1>(data); object->_adminLock.Lock(); @@ -1200,17 +855,6 @@ static GSourceFuncs _handlerIntervention = WebKitWebContext* context = webkit_web_view_get_context(object->_view); WebKitCookieManager* manager = webkit_web_context_get_cookie_manager(context); webkit_cookie_manager_set_accept_policy(manager, policy); -#else - WKHTTPCookieAcceptPolicy policy = std::get<1>(data); - - object->_adminLock.Lock(); - object->_httpCookieAcceptPolicy = policy; - object->_adminLock.Unlock(); - - auto context = WKPageGetContext(object->_page); - auto manager = WKContextGetCookieManager(context); - WKCookieManagerSetHTTPCookieAcceptPolicy(manager, policy); -#endif return G_SOURCE_REMOVE; }, data, @@ -1247,23 +891,12 @@ static GSourceFuncs _handlerIntervention = [](gpointer customdata) -> gboolean { BridgeMessageData& data = *static_cast(customdata); WebKitImplementation* object = std::get<0>(data); - -#ifdef WEBKIT_GLIB_API auto messageName = std::get<1>(data).c_str(); auto messageBody = std::get<2>(data).c_str(); webkit_web_view_send_message_to_page(object->_view, webkit_user_message_new(messageName, g_variant_new("s", messageBody)), nullptr, nullptr, nullptr); -#else - auto messageName = WKStringCreateWithUTF8CString(std::get<1>(data).c_str()); - auto messageBody = WKStringCreateWithUTF8CString(std::get<2>(data).c_str()); - - WKPagePostMessageToInjectedBundle(object->_page, messageName, messageBody); - - WKRelease(messageBody); - WKRelease(messageName); -#endif return G_SOURCE_REMOVE; }, data, @@ -1279,13 +912,8 @@ static GSourceFuncs _handlerIntervention = G_PRIORITY_DEFAULT, [](gpointer customdata) -> gboolean { WebKitImplementation* object = static_cast(customdata); -#ifdef WEBKIT_GLIB_API WebKitWebContext* context = webkit_web_view_get_context(object->_view); webkit_web_context_garbage_collect_javascript_objects(context); -#else - auto context = WKPageGetContext(object->_page); - WKContextGarbageCollectJavaScriptObjects(context); -#endif return G_SOURCE_REMOVE; }, this, @@ -1309,13 +937,12 @@ static GSourceFuncs _handlerIntervention = auto& data = *static_cast(customdata); WebKitImplementation* object = std::get<0>(data); auto& script = std::get<1>(data); -#ifdef WEBKIT_GLIB_API - webkit_web_view_run_javascript(object->_view, script.c_str(), nullptr, nullptr, nullptr); +#if WEBKIT_CHECK_VERSION(2, 42, 0) + // length: size of script, or -1 if script is a nul-terminated string + webkit_web_view_evaluate_javascript(object->_view, script.c_str(), -1, nullptr, nullptr, nullptr, nullptr, nullptr); #else - auto scriptRef = WKStringCreateWithUTF8CString(script.c_str()); - WKPageRunJavaScriptInMainFrame(object->_page, scriptRef, nullptr, [](WKSerializedScriptValueRef, WKErrorRef, void*){}); - WKRelease(scriptRef); -#endif + webkit_web_view_run_javascript(object->_view, script.c_str(), nullptr, nullptr, nullptr); +#endif // WEBKIT_CHECK_VERSION return G_SOURCE_REMOVE; }, data, @@ -1359,12 +986,8 @@ static GSourceFuncs _handlerIntervention = G_PRIORITY_DEFAULT, [](gpointer customdata) -> gboolean { WebKitImplementation* object = static_cast(customdata); -#ifdef WEBKIT_GLIB_API auto* userContentManager = webkit_web_view_get_user_content_manager(object->_view); webkit_user_content_manager_remove_all_scripts(userContentManager); -#else - WKUserContentControllerRemoveAllUserScripts(object->_userContentController); -#endif return G_SOURCE_REMOVE; }, this, @@ -1486,7 +1109,6 @@ static GSourceFuncs _handlerIntervention = void RefreshCookieJar() { - #ifdef WEBKIT_GLIB_API WebKitWebContext* context = webkit_web_view_get_context(_view); WebKitCookieManager* manager = webkit_web_context_get_cookie_manager(context); webkit_cookie_manager_get_cookie_jar(manager, NULL, [](GObject* object, GAsyncResult* result, gpointer user_data) { @@ -1506,74 +1128,10 @@ static GSourceFuncs _handlerIntervention = browser._cookieJar.SetCookies(std::move(cookieVector)); browser._adminLock.Unlock(); }, this); - #else - static const auto toSoupCookie = [](WKCookieRef cookie) -> SoupCookie* - { - auto name = WKCookieGetName(cookie); - auto value = WKCookieGetValue(cookie); - auto domain = WKCookieGetDomain(cookie); - auto path = WKCookieGetPath(cookie); - SoupCookie* soupCookie = soup_cookie_new( - WKStringToString(name).c_str(), - WKStringToString(value).c_str(), - WKStringToString(domain).c_str(), - WKStringToString(path).c_str(), - -1); - SoupDate* expires = soup_date_new_from_time_t(WKCookieGetExpires(cookie) / 1000.0); - soup_cookie_set_expires(soupCookie, expires); - soup_date_free(expires); - soup_cookie_set_http_only(soupCookie, WKCookieGetHttpOnly(cookie)); - soup_cookie_set_secure(soupCookie, WKCookieGetSecure(cookie)); - WKRelease(path); - WKRelease(domain); - WKRelease(value); - WKRelease(name); - return soupCookie; - }; - - WKCookieManagerGetCookies( - _cookieManager, this, [](WKArrayRef cookies, WKErrorRef error, void* clientInfo) { - WebKitImplementation& browser = *static_cast< WebKitImplementation*>(clientInfo); - if (error) { - auto errorDomain = WKErrorCopyDomain(error); - auto errorDescription = WKErrorCopyLocalizedDescription(error); - SYSLOG(Logging::Error, - (_T("GetCookies failed, error(code=%d, domain=%s, message=%s)"), - WKErrorGetErrorCode(error), - WKStringToString(errorDomain).c_str(), - WKStringToString(errorDescription).c_str())); - WKRelease(errorDescription); - WKRelease(errorDomain); - return; - } - std::vector cookieVector; - size_t size = cookies ? WKArrayGetSize(cookies) : 0; - if (size > 0) - { - cookieVector.reserve(size); - for (size_t i = 0; i < size; ++i) - { - WKCookieRef cookie = static_cast(WKArrayGetItemAtIndex(cookies, i)); - if (WKCookieGetSession(cookie)) - continue; - SoupCookie* soupCookie = toSoupCookie(cookie); - gchar *cookieHeader = soup_cookie_to_set_cookie_header(soupCookie); - cookieVector.push_back(cookieHeader); - soup_cookie_free(soupCookie); - g_free(cookieHeader); - } - cookieVector.shrink_to_fit(); - } - browser._adminLock.Lock(); - browser._cookieJar.SetCookies(std::move(cookieVector)); - browser._adminLock.Unlock(); - }); - #endif } void SetCookies(const std::vector& cookies) { - #ifdef WEBKIT_GLIB_API GList* cookies_list = nullptr; for (auto& cookie : cookies) { SoupCookie* sc = soup_cookie_parse(cookie.c_str(), nullptr); @@ -1610,65 +1168,6 @@ static GSourceFuncs _handlerIntervention = webkit_cookie_manager_set_cookie_jar(manager, g_list_reverse(cookies_list), nullptr, nullptr, nullptr); g_list_free_full(cookies_list, reinterpret_cast(soup_cookie_free)); - #else - auto toWKCookie = [](SoupCookie* cookie) -> WKCookieRef - { - SoupDate* expires = soup_cookie_get_expires(cookie); - auto name = WKStringCreateWithUTF8CString(soup_cookie_get_name(cookie)); - auto value = WKStringCreateWithUTF8CString(soup_cookie_get_value(cookie)); - auto domain = WKStringCreateWithUTF8CString(soup_cookie_get_domain(cookie)); - auto path = WKStringCreateWithUTF8CString(soup_cookie_get_path(cookie)); - WKCookieRef cookieRef = - WKCookieCreate( - name, - value, - domain, - path, - expires ? static_cast(soup_date_to_time_t(expires)) * 1000 : 0, - soup_cookie_get_http_only(cookie), - soup_cookie_get_secure(cookie), - !expires); - WKRelease(name); - WKRelease(value); - WKRelease(domain); - WKRelease(path); - return cookieRef; - }; - size_t idx = 0; - auto cookiesArray = std::unique_ptr(new WKTypeRef[cookies.size()]); - for (const auto& cookie : cookies) - { - std::unique_ptr sc(soup_cookie_parse(cookie.c_str(), nullptr), soup_cookie_free); - if (!sc) - continue; - const char* domain = soup_cookie_get_domain(sc.get()); - if (!domain) - continue; - // soup_cookie_parse() may prepend '.' to the domain, - // check the original cookie string and remove '.' if needed - if (domain[0] == '.') - { - const char kDomainNeedle[] = "domain="; - const size_t kDomainNeedleLength = sizeof(kDomainNeedle) - 1; - auto it = std::search( - cookie.begin(), cookie.end(), kDomainNeedle, kDomainNeedle + kDomainNeedleLength, - [](const char c1, const char c2) { - return ::tolower(c1) == c2; - }); - if (it != cookie.end()) - it += kDomainNeedleLength; - if (it != cookie.end() && *it != '.' && *it != ';') - { - char* adjustedDomain = g_strdup(domain + 1); - soup_cookie_set_domain(sc.get(), adjustedDomain); - } - } - cookiesArray[idx++] = toWKCookie(sc.get()); - } - auto cookieArray = WKArrayCreateAdoptingValues(cookiesArray.get(), idx); - WKCookieManagerSetCookies(_cookieManager, cookieArray); - WKRelease(cookieArray); - #endif } #endif @@ -1706,14 +1205,7 @@ static GSourceFuncs _handlerIntervention = object->_adminLock.Unlock(); object->SetResponseHTTPStatusCode(-1); -#ifdef WEBKIT_GLIB_API webkit_web_view_load_uri(object->_view, object->_URL.c_str()); -#else - object->SetNavigationRef(nullptr); - auto shellURL = WKURLCreateWithUTF8CString(object->_URL.c_str()); - WKPageLoadURL(object->_page, shellURL); - WKRelease(shellURL); -#endif return G_SOURCE_REMOVE; }, data, @@ -2041,7 +1533,6 @@ static GSourceFuncs _handlerIntervention = object->_config.Languages = array; object->_adminLock.Unlock(); -#ifdef WEBKIT_GLIB_API auto* languages = static_cast(g_new0(char*, array.Length() + 1)); Core::JSON::ArrayType::Iterator index(array.Elements()); @@ -2051,21 +1542,6 @@ static GSourceFuncs _handlerIntervention = WebKitWebContext* context = webkit_web_view_get_context(object->_view); webkit_web_context_set_preferred_languages(context, languages); g_strfreev(languages); -#else - auto languages = WKMutableArrayCreate(); - for (auto it = array.Elements(); it.Next();) { - if (!it.IsValid()) { - continue; - } - auto itemString = WKStringCreateWithUTF8CString(it.Current().Value().c_str()); - WKArrayAppendItem(languages, itemString); - WKRelease(itemString); - } - - auto context = WKPageGetContext(object->_page); - WKSoupSessionSetPreferredLanguages(context, languages); - WKRelease(languages); -#endif return G_SOURCE_REMOVE; }, data, @@ -2099,17 +1575,6 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } - -#ifndef WEBKIT_GLIB_API - void OnLoadFinished(const string& URL, WKNavigationRef navigation) - { - if (_navigationRef != navigation) { - TRACE(Trace::Information, (_T("Ignore 'loadfinished' for previous navigation request"))); - return; - } - OnLoadFinished(URL); - } -#endif void OnLoadFinished(const string& URL) { _adminLock.Lock(); @@ -2224,9 +1689,6 @@ static GSourceFuncs _handlerIntervention = uint32_t Configure(PluginHost::IShell* service) override { - #ifndef WEBKIT_GLIB_API - _consoleLogPrefix = service->Callsign(); - #endif _service = service; _dataPath = service->DataPath(); @@ -2324,19 +1786,11 @@ static GSourceFuncs _handlerIntervention = // WebInspector if (_config.Inspector.Value().empty() == false) { -#ifdef WEBKIT_GLIB_API if (_config.InspectorNative.Value()) { Core::SystemInfo::SetEnvironment(_T("WEBKIT_INSPECTOR_SERVER"), _config.Inspector.Value(), !environmentOverride); } else { Core::SystemInfo::SetEnvironment(_T("WEBKIT_INSPECTOR_HTTP_SERVER"), _config.Inspector.Value(), !environmentOverride); } -#else - if (_config.Automation.Value()) { - Core::SystemInfo::SetEnvironment(_T("WEBKIT_INSPECTOR_SERVER"), _config.Inspector.Value(), !environmentOverride); - } else { - Core::SystemInfo::SetEnvironment(_T("WEBKIT_LEGACY_INSPECTOR_SERVER"), _config.Inspector.Value(), !environmentOverride); - } -#endif } // RPI mouse support @@ -2439,6 +1893,14 @@ static GSourceFuncs _handlerIntervention = Core::SystemInfo::SetEnvironment(_T("GST_VIRTUAL_DISP_HEIGHT"), height, !environmentOverride); } + if (_config.GstQuirks.IsSet() == true) { + Core::SystemInfo::SetEnvironment(_T("WEBKIT_GST_QUIRKS"), _config.GstQuirks.Value(), !environmentOverride); + } + + if (_config.GstHolePunchQuirk.IsSet() == true) { + Core::SystemInfo::SetEnvironment(_T("WEBKIT_GST_HOLE_PUNCH_QUIRK"), _config.GstHolePunchQuirk.Value(), !environmentOverride); + } + for (auto environmentVariableIndex = 0; environmentVariableIndex < _config.EnvironmentVariables.Length(); environmentVariableIndex++) { const auto& environmentVariable = _config.EnvironmentVariables[environmentVariableIndex]; Core::SystemInfo::SetEnvironment(environmentVariable.Name.Value(), environmentVariable.Value.Value()); @@ -2494,34 +1956,7 @@ static GSourceFuncs _handlerIntervention = _config.Bundle.Config(key,value); return (value); } -#ifndef WEBKIT_GLIB_API - void SetNavigationRef(WKNavigationRef ref) - { - _navigationRef = ref; - } - void OnNotificationShown(uint64_t notificationID) const - { - WKNotificationManagerProviderDidShowNotification(_notificationManager, notificationID); - } - - void OnRequestAutomationSession(WKContextRef context, WKStringRef sessionID) - { - _automationSession = WKWebAutomationSessionCreate(sessionID); - _handlerAutomationSession.base.clientInfo = static_cast(this); - WKWebAutomationSessionSetClient(_automationSession, &_handlerAutomationSession.base); - WKContextSetAutomationSession(context, _automationSession); - } - - WKPageRef GetPage() const - { - return _page; - } - string GetConsoleLogPrefix() const - { - return _consoleLogPrefix; - } -#endif BEGIN_INTERFACE_MAP(WebKitImplementation) INTERFACE_ENTRY(Exchange::IWebBrowser) INTERFACE_ENTRY(Exchange::IBrowser) @@ -2531,6 +1966,9 @@ static GSourceFuncs _handlerIntervention = INTERFACE_ENTRY (Exchange::IBrowserCookieJar) #endif INTERFACE_ENTRY(PluginHost::IStateControl) +#if HAS_SCREEN_HDR_API + INTERFACE_ENTRY(Exchange::IConnectionProperties::INotification) +#endif END_INTERFACE_MAP private: @@ -2542,11 +1980,7 @@ static GSourceFuncs _handlerIntervention = _context, [](gpointer customdata) -> gboolean { WebKitImplementation* object = static_cast(customdata); -#ifdef WEBKIT_GLIB_API webkit_web_view_hide(object->_view); -#else - WKViewSetViewState(object->_view, (object->_state == PluginHost::IStateControl::RESUMED ? kWKViewStateIsInWindow : 0)); -#endif object->Hidden(true); TRACE_GLOBAL(Trace::Information, (_T("Internal Hide Notification took %d mS."), static_cast(Core::Time::Now().Ticks() - object->_time))); @@ -2563,11 +1997,7 @@ static GSourceFuncs _handlerIntervention = _context, [](gpointer customdata) -> gboolean { WebKitImplementation* object = static_cast(customdata); -#ifdef WEBKIT_GLIB_API webkit_web_view_show(object->_view); -#else - WKViewSetViewState(object->_view, (object->_state == PluginHost::IStateControl::RESUMED ? kWKViewStateIsInWindow : 0) | kWKViewStateIsVisible); -#endif object->Hidden(false); TRACE_GLOBAL(Trace::Information, (_T("Internal Show Notification took %d mS."), static_cast(Core::Time::Now().Ticks() - object->_time))); @@ -2593,11 +2023,7 @@ static GSourceFuncs _handlerIntervention = object->SetURL(kBlankURL); ASSERT(object->_URL == kBlankURL); } -#ifdef WEBKIT_GLIB_API webkit_web_view_suspend(object->_view); -#else - WKViewSetViewState(object->_view, (object->_hidden ? 0 : kWKViewStateIsVisible)); -#endif object->OnStateChange(PluginHost::IStateControl::SUSPENDED); TRACE_GLOBAL(Trace::Information, (_T("Internal Suspend Notification took %d mS."), static_cast(Core::Time::Now().Ticks() - object->_time))); @@ -2620,11 +2046,7 @@ static GSourceFuncs _handlerIntervention = _context, [](gpointer customdata) -> gboolean { WebKitImplementation* object = static_cast(customdata); -#ifdef WEBKIT_GLIB_API webkit_web_view_resume(object->_view); -#else - WKViewSetViewState(object->_view, (object->_hidden ? 0 : kWKViewStateIsVisible) | kWKViewStateIsInWindow); -#endif object->OnStateChange(PluginHost::IStateControl::RESUMED); TRACE_GLOBAL(Trace::Information, (_T("Internal Resume Notification took %d mS."), static_cast(Core::Time::Now().Ticks() - object->_time))); @@ -2634,7 +2056,6 @@ static GSourceFuncs _handlerIntervention = this); } } -#ifdef WEBKIT_GLIB_API static void initializeWebExtensionsCallback(WebKitWebContext* context, WebKitImplementation* browser) { webkit_web_context_set_web_extensions_directory(context, browser->_extensionPath.c_str()); @@ -2705,9 +2126,90 @@ static GSourceFuncs _handlerIntervention = } browser->OnLoadFailed(failingURI); } - static bool authenticationCallback(WebKitWebView*, WebKitAuthenticationRequest* request) + static bool authenticationCallback(WebKitWebView*, WebKitAuthenticationRequest* request, WebKitImplementation* browser) { + TRACE(Trace::Information, ("AUTHENTICATION: Started Authentication callback")); +//Need to check Glib version >= 2.72, otherwise return nullptr +#if GLIB_CHECK_VERSION (2, 72, 0) + GError *error = NULL; + GTlsCertificate *cert = NULL; + std::string clientCertStr, clientCertKeyStr; + const gchar *certPath = NULL, *keyPath = NULL; + + if (browser->_config.ClientCert.IsSet() == true && browser->_config.ClientCert.Value().empty() == false) + { + clientCertStr = browser->_config.ClientCert.Value().c_str(); + certPath = clientCertStr.c_str(); + } + + if (!certPath) + goto out; + + if (browser->_config.ClientCertKey.IsSet() == true && browser->_config.ClientCertKey.Value().empty() == false) + { + clientCertKeyStr = browser->_config.ClientCertKey.Value().c_str(); + keyPath = clientCertKeyStr.c_str(); + } + + if (g_str_has_suffix(certPath, ".pk12")) + { + TRACE(Trace::Information, ("AUTHENTICATION: Cert Path accepted as pk12")); + gchar *certData, *keyData = NULL; + gsize certLen, keyLen; + if (keyPath) + { + gsize i; + if (!g_file_get_contents(keyPath, &keyData, &keyLen, &error)) + goto out; + for (i = keyLen - 1; i >= 0 && g_ascii_isspace(keyData[i]); --i) + keyData[i] = '\0'; + } + + if (!g_file_get_contents(certPath, &certData, &certLen, &error)) + { + g_free(keyData); + goto out; + } + + cert = g_tls_certificate_new_from_pkcs12((guint8 *)certData, certLen, keyData, &error); + g_free(certData); + g_free(keyData); + } + else if (keyPath) + { + TRACE(Trace::Information, ("AUTHENTICATION: Certificate not pk12")); + cert = g_tls_certificate_new_from_files(certPath, keyPath, &error); + } + else + { + TRACE(Trace::Information, ("AUTHENTICATION: No key path set")); + cert = g_tls_certificate_new_from_file(certPath, &error); + } + + out: + if (error) + { + TRACE(Trace::Information, ("AUTHENTICATION: Cert load failed. %s", error ? error->message : "unknown")); + g_error_free(error); + webkit_authentication_request_authenticate(request, nullptr); + } + else if(!cert) + { + TRACE(Trace::Information, ("AUTHENTICATION: No certificate provided")); + webkit_authentication_request_authenticate(request, nullptr); + } + else + { + TRACE(Trace::Information, ("AUTHENTICATION: Sending cert to webkit")); + auto *credential = webkit_credential_new_for_certificate(cert, WEBKIT_CREDENTIAL_PERSISTENCE_NONE); + webkit_authentication_request_authenticate(request, credential); + g_object_unref(cert); + webkit_credential_free(credential); + } +#else + TRACE(Trace::Information, ("AUTHENTICATION: Glib version check failed- Detected as not 2.7.2 or greater.")); webkit_authentication_request_authenticate(request, nullptr); +#endif return TRUE; } static void postExitJob() @@ -2846,11 +2348,6 @@ static GSourceFuncs _handlerIntervention = } g_mkdir_with_parents(indexedDBPath, 0700); - uint64_t indexedDBSizeBytes = 0; // No limit by default, use WebKit defaults (1G at the moment of writing) - if (_config.IndexedDBSize.IsSet() && _config.IndexedDBSize.Value() != 0) { - indexedDBSizeBytes = _config.IndexedDBSize.Value() * 1024; - } - #if HAS_MEMORY_PRESSURE_SETTINGS_API if ((_config.Memory.IsSet() == true) && (_config.Memory.NetworkProcessSettings.IsSet() == true)) { WebKitMemoryPressureSettings* memoryPressureSettings = webkit_memory_pressure_settings_new(); @@ -2864,6 +2361,35 @@ static GSourceFuncs _handlerIntervention = webkit_memory_pressure_settings_free(memoryPressureSettings); } #endif + +#if WEBKIT_CHECK_VERSION(2, 42, 0) + double originStorageRatio = -1.0; // -1.0 means WebKit will use the default quota (1GB) + if (_config.OriginStorageRatio.IsSet() && _config.OriginStorageRatio.Value() != 0) { + originStorageRatio = static_cast(_config.OriginStorageRatio.Value()); + } + + double totalStorageRatio = -1.0; // -1.0 means there's no limit for the total storage + if (_config.TotalStorageRatio.IsSet() && _config.TotalStorageRatio.Value() != 0) { + totalStorageRatio = static_cast(_config.TotalStorageRatio.Value()); + } + + auto* websiteDataManager = webkit_website_data_manager_new( + "local-storage-directory", wpeStoragePath, + "disk-cache-directory", wpeDiskCachePath, + "local-storage-quota", localStorageDatabaseQuotaInBytes, + "indexeddb-directory", indexedDBPath, + "origin-storage-ratio", originStorageRatio, + "total-storage-ratio", totalStorageRatio, + "base-data-directory", _service->PersistentPath().c_str(), + "base-cache-directory", _service->VolatilePath().c_str(), + nullptr); +#else + uint64_t indexedDBSizeBytes = 0; // No limit by default, use WebKit defaults (1G at the moment of writing) + if (_config.OriginStorageRatio.IsSet() && _config.OriginStorageRatio.Value() != 0) { + Core::Partition persistentPath(_service->PersistentPath().c_str()); + indexedDBSizeBytes = ((persistentPath.Core::Partition::Size() * _config.OriginStorageRatio.Value())); + } + auto* websiteDataManager = webkit_website_data_manager_new( "local-storage-directory", wpeStoragePath, "disk-cache-directory", wpeDiskCachePath, @@ -2871,6 +2397,7 @@ static GSourceFuncs _handlerIntervention = "indexeddb-directory", indexedDBPath, "per-origin-storage-quota", indexedDBSizeBytes, nullptr); +#endif g_free(wpeStoragePath); g_free(wpeDiskCachePath); g_free(indexedDBPath); @@ -3021,6 +2548,13 @@ static GSourceFuncs _handlerIntervention = // webaudio support webkit_settings_set_enable_webaudio(preferences, _config.WebAudioEnabled.Value()); +#if HAS_SCREEN_HDR_API + SubscribeHDRCapabilities(); + // Query the current HDR capabilities before we start the browser + RefreshHDRSupport(); + UpdateHDRSettings(preferences); +#endif + // Allow mixed content. bool enableWebSecurity = _config.Secure.Value(); #if WEBKIT_CHECK_VERSION(2, 38, 0) @@ -3039,10 +2573,12 @@ static GSourceFuncs _handlerIntervention = "enable-service-worker", _config.ServiceWorkerEnabled.Value(), nullptr); // ICE candidate filtering + bool enableIceCandidateFiltering = false; // disable by default if (_config.ICECandidateFilteringEnabled.IsSet()) { - g_object_set(G_OBJECT(preferences), - "enable-ice-candidate-filtering", _config.ICECandidateFilteringEnabled.Value(), nullptr); + enableIceCandidateFiltering = _config.ICECandidateFilteringEnabled.Value(); } + g_object_set(G_OBJECT(preferences), + "enable-ice-candidate-filtering", enableIceCandidateFiltering, nullptr); _view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "backend", webkit_web_view_backend_new(wpe_view_backend_create(), nullptr, nullptr), @@ -3085,7 +2621,7 @@ static GSourceFuncs _handlerIntervention = g_signal_connect(_view, "user-message-received", reinterpret_cast(userMessageReceivedCallback), this); g_signal_connect(_view, "notify::is-web-process-responsive", reinterpret_cast(isWebProcessResponsiveCallback), this); g_signal_connect(_view, "load-failed", reinterpret_cast(loadFailedCallback), this); - g_signal_connect(_view, "authenticate", reinterpret_cast(authenticationCallback), nullptr); + g_signal_connect(_view, "authenticate", reinterpret_cast(authenticationCallback), this); _configurationCompleted.SetState(true); @@ -3119,266 +2655,8 @@ static GSourceFuncs _handlerIntervention = return Core::infinite; } -#else - uint32_t Worker() override - { - _context = g_main_context_new(); - _loop = g_main_loop_new(_context, FALSE); - g_main_context_push_thread_default(_context); - - HangDetector hangdetector(*this); - - auto contextConfiguration = WKContextConfigurationCreate(); - - if (_config.InjectedBundle.Value().empty() == false) { - // Set up injected bundle. Will be loaded once WPEWebProcess is started. - std::unique_ptr bundlePath( - g_build_filename(_dataPath.c_str(), _config.InjectedBundle.Value().c_str(), nullptr) ); - if (g_file_test(bundlePath.get(), G_FILE_TEST_EXISTS) == false) { - bundlePath.reset( g_build_filename("/usr/share/WPEFramework/WebKitBrowser/", _config.InjectedBundle.Value().c_str(), nullptr) ); - } - WKStringRef injectedBundlePathString = WKStringCreateWithUTF8CString(bundlePath.get()); - WKContextConfigurationSetInjectedBundlePath(contextConfiguration, injectedBundlePathString); - WKRelease(injectedBundlePathString); - } - - gchar* wpeStoragePath; - if (_config.LocalStorage.IsSet() == true && _config.LocalStorage.Value().empty() == false) { - wpeStoragePath = g_build_filename(_config.LocalStorage.Value().c_str(), "wpe", "local-storage", nullptr); - } else { - wpeStoragePath = g_build_filename(g_get_user_cache_dir(), "wpe", "local-storage", nullptr); - } - - g_mkdir_with_parents(wpeStoragePath, 0700); - auto storageDirectory = WKStringCreateWithUTF8CString(wpeStoragePath); - g_free(wpeStoragePath); - WKContextConfigurationSetLocalStorageDirectory(contextConfiguration, storageDirectory); - - if (_config.LocalStorageSize.IsSet() == true && _config.LocalStorageSize.Value() != 0) { - uint32_t gLocalStorageDatabaseQuotaInBytes = _config.LocalStorageSize.Value() * 1024; - TRACE(Trace::Information, (_T("Configured LocalStorage Quota %u bytes"), gLocalStorageDatabaseQuotaInBytes)); - WKContextConfigurationSetLocalStorageQuota(contextConfiguration, gLocalStorageDatabaseQuotaInBytes); - } - - gchar* wpeDiskCachePath = g_build_filename(g_get_user_cache_dir(), "wpe", "disk-cache", nullptr); - g_mkdir_with_parents(wpeDiskCachePath, 0700); - auto diskCacheDirectory = WKStringCreateWithUTF8CString(wpeDiskCachePath); - g_free(wpeDiskCachePath); - WKContextConfigurationSetDiskCacheDirectory(contextConfiguration, diskCacheDirectory); - - WKContextRef wkContext = WKContextCreateWithConfiguration(contextConfiguration); - WKSoupSessionSetIgnoreTLSErrors(wkContext, !_config.CertificateCheck); - - if (_config.Languages.IsSet()) { - WKMutableArrayRef languages = WKMutableArrayCreate(); - Core::JSON::ArrayType::Iterator index(_config.Languages.Elements()); - - while (index.Next() == true) { - WKStringRef itemString = WKStringCreateWithUTF8CString(index.Current().Value().c_str()); - WKArrayAppendItem(languages, itemString); - WKRelease(itemString); - } - - WKSoupSessionSetPreferredLanguages(wkContext, languages); - WKRelease(languages); - } - - WKRelease(contextConfiguration); - - WKGeolocationManagerRef geolocationManager = WKContextGetGeolocationManager(wkContext); - WKGeolocationManagerSetProvider(geolocationManager, &_handlerGeolocationProvider.base); - - _notificationManager = WKContextGetNotificationManager(wkContext); - _handlerNotificationProvider.base.clientInfo = static_cast(this); - WKNotificationManagerSetProvider(_notificationManager, &_handlerNotificationProvider.base); - - auto pageGroupIdentifier = WKStringCreateWithUTF8CString(_config.PageGroup.Value().c_str()); - auto pageGroup = WKPageGroupCreateWithIdentifier(pageGroupIdentifier); - WKRelease(pageGroupIdentifier); - - auto preferences = WKPreferencesCreate(); - - // Allow mixed content. - bool allowMixedContent = _config.Secure.Value(); - WKPreferencesSetAllowRunningOfInsecureContent(preferences, !allowMixedContent); - WKPreferencesSetAllowDisplayOfInsecureContent(preferences, !allowMixedContent); - - // WebSecurity - WKPreferencesSetWebSecurityEnabled(preferences, allowMixedContent); - - // Turn off log message to stdout. - WKPreferencesSetLogsPageMessagesToSystemConsoleEnabled(preferences, _config.LogToSystemConsoleEnabled.Value()); - - // Turn on gamepads. - WKPreferencesSetGamepadsEnabled(preferences, true); - - // Turn on fullscreen API. - WKPreferencesSetFullScreenEnabled(preferences, true); - - // Turn off BackForwardList - WKPreferencesSetPageCacheEnabled(preferences, FALSE); - - // Turn on/off allowScriptWindowClose - WKPreferencesSetAllowScriptsToCloseWindow(preferences, _config.AllowWindowClose.Value()); - - // Turn on/off non composited WebGL - WKPreferencesSetNonCompositedWebGLEnabled(preferences, _config.NonCompositedWebGLEnabled.Value()); - - // Turn on/off WebGL - WKPreferencesSetWebGLEnabled(preferences, _config.WebGLEnabled.Value()); - - // Turn on/off local storage - WKPreferencesSetLocalStorageEnabled(preferences, _localStorageEnabled); - - // Media Content Types Requiring Hardware Support - if (_config.MediaContentTypesRequiringHardwareSupport.IsSet() == true - && _config.MediaContentTypesRequiringHardwareSupport.Value().empty() == false) { - auto contentTypes = WKStringCreateWithUTF8CString( - _config.MediaContentTypesRequiringHardwareSupport.Value().c_str()); - WKPreferencesSetMediaContentTypesRequiringHardwareSupport(preferences, contentTypes); - WKRelease(contentTypes); - } - - // webaudio support - WKPreferencesSetWebAudioEnabled(preferences, _config.WebAudioEnabled.Value()); - - WKPageGroupSetPreferences(pageGroup, preferences); - - _userContentController = WKUserContentControllerCreate(); - auto pageConfiguration = WKPageConfigurationCreate(); - WKPageConfigurationSetContext(pageConfiguration, wkContext); - WKPageConfigurationSetPageGroup(pageConfiguration, pageGroup); - WKPageConfigurationSetUserContentController(pageConfiguration, _userContentController); - - SetupUserContentFilter(); - TryLoadingUserScripts(); - - _cookieManager = WKContextGetCookieManager(wkContext); - #if defined(ENABLE_CLOUD_COOKIE_JAR) - if (_config.CloudCookieJarEnabled.IsSet() && _config.CloudCookieJarEnabled.Value()) { - WKCookieManagerClientV0 client = { - { 0, this }, - // cookiesDidChange - [](WKCookieManagerRef, const void* clientInfo) { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - browser->NotifyCookieJarChanged(); - } - }; - WKCookieManagerSetClient(_cookieManager, &client.base); - WKCookieManagerStartObservingCookieChanges(_cookieManager); - } else - #endif - { - gchar* cookieDatabasePath; - if (_config.CookieStorage.IsSet() == true && _config.CookieStorage.Value().empty() == false) { - cookieDatabasePath = g_build_filename(_config.CookieStorage.Value().c_str(), "cookies.db", nullptr); - } else { - cookieDatabasePath = g_build_filename(g_get_user_cache_dir(), "cookies.db", nullptr); - } - auto path = WKStringCreateWithUTF8CString(cookieDatabasePath); - g_free(cookieDatabasePath); - WKCookieManagerSetCookiePersistentStorage(_cookieManager, path, kWKCookieStorageTypeSQLite); - } - WKCookieManagerSetHTTPCookieAcceptPolicy(_cookieManager, _httpCookieAcceptPolicy); - -#ifdef WPE_WEBKIT_DEPRECATED_API - _view = WKViewCreateWithViewBackend(wpe_view_backend_create(), pageConfiguration); -#else - _view = WKViewCreate(wpe_view_backend_create(), pageConfiguration); -#endif - if (_config.FPS.Value() == true) { - _viewClient.base.clientInfo = static_cast(this); - WKViewSetViewClient(_view, &_viewClient.base); - } - - //_page = WKRetain(WKViewGetPage(_view)); - _page = WKViewGetPage(_view); - - if (_config.Transparent.Value() == true) { - WKPageSetDrawsBackground(_page, false); - } - - // Register handlers for page navigation and message from injected bundle. - _handlerWebKit.base.clientInfo = static_cast(this); - WKPageSetPageNavigationClient(_page, &_handlerWebKit.base); - - _handlerInjectedBundle.base.clientInfo = static_cast(this); - WKContextSetInjectedBundleClient(wkContext, &_handlerInjectedBundle.base); - - WKPageSetProxies(_page, nullptr); - - WKPageSetCustomBackingScaleFactor(_page, _config.ScaleFactor.Value()); - - if (_config.Automation.Value()) { - _handlerAutomation.base.clientInfo = static_cast(this); - WKContextSetAutomationClient(wkContext, &_handlerAutomation.base); - } - - _handlerPageUI.base.clientInfo = static_cast(this); - WKPageSetPageUIClient(_page, &_handlerPageUI.base); - - WKPageLoaderClientV0 pageLoadClient; - memset(&pageLoadClient, 0, sizeof(pageLoadClient)); - pageLoadClient.base.clientInfo = this; - pageLoadClient.processDidBecomeResponsive = WebKitImplementation::WebProcessDidBecomeResponsive; - WKPageSetPageLoaderClient(_page, &pageLoadClient.base); - - if (_config.UserAgent.IsSet() == true && _config.UserAgent.Value().empty() == false) { - auto ua = WKStringCreateWithUTF8CString(_config.UserAgent.Value().c_str()); - WKPageSetCustomUserAgent(_page, ua); - WKRelease(ua); - TRACE(Trace::Information, (_T("New user agent: '%s'"), _config.UserAgent.Value().c_str())); - } else { - auto ua = WKPageCopyUserAgent(_page); - _config.UserAgent = WKStringToString(ua); - WKRelease(ua); - TRACE(Trace::Information, (_T("Current user agent: '%s'"), _config.UserAgent.Value().c_str())); - } - - URL(static_cast(_URL)); - - // Move into the correct state, as requested - _adminLock.Lock(); - if ((_state == PluginHost::IStateControl::SUSPENDED) || (_state == PluginHost::IStateControl::UNINITIALIZED)) { - _state = PluginHost::IStateControl::UNINITIALIZED; - Suspend(); - } else { - _state = PluginHost::IStateControl::UNINITIALIZED; - OnStateChange(PluginHost::IStateControl::RESUMED); - } - _adminLock.Unlock(); - - _configurationCompleted.SetState(true); - - g_main_loop_run(_loop); - - // Seems if we stop the mainloop but are not in a suspended state, there is a crash. - // Force suspended state first. - if (_state == PluginHost::IStateControl::RESUMED) { - WKViewSetViewState(_view, 0); - } - - // WKRelease(_page); - if (_automationSession) WKRelease(_automationSession); - - WKRelease(_view); - WKRelease(_userContentController); - WKRelease(pageConfiguration); - WKRelease(pageGroup); - WKRelease(wkContext); - WKRelease(preferences); - - g_main_context_pop_thread_default(_context); - g_main_loop_unref(_loop); - g_main_context_unref(_context); - - return Core::infinite; - } -#endif // WEBKIT_GLIB_API - void AddUserScriptImpl(const char* scriptContent, bool topFrameOnly) { -#ifdef WEBKIT_GLIB_API auto* userContentManager = webkit_web_view_get_user_content_manager(_view); auto* script = webkit_user_script_new( scriptContent, @@ -3389,13 +2667,6 @@ static GSourceFuncs _handlerIntervention = ); webkit_user_content_manager_add_script(userContentManager, script); webkit_user_script_unref(script); -#else - auto scriptContentRef = WKStringCreateWithUTF8CString(scriptContent); - auto scriptRef = WKUserScriptCreateWithSource(scriptContentRef, kWKInjectAtDocumentStart, topFrameOnly); - WKUserContentControllerAddUserScript(_userContentController, scriptRef); - WKRelease(scriptRef); - WKRelease(scriptContentRef); -#endif } void TryLoadingUserScripts() @@ -3424,7 +2695,6 @@ static GSourceFuncs _handlerIntervention = void SetupUserContentFilter() { -#ifdef WEBKIT_GLIB_API if (!_config.ContentFilter.Value().empty()) { // User content filter is compiled into binary-like file and put inside filter storage path. // The file is used to share the data between WebKit processes. @@ -3448,11 +2718,183 @@ static GSourceFuncs _handlerIntervention = g_bytes_unref(data); } -#else - // GLIB only supported -#endif } +#if HAS_SCREEN_HDR_API + WPEFramework::PluginHost::IPlugin* QueryDisplayInfoPlugin() + { + if (_displayInfoPlugin) { + return _displayInfoPlugin; + } + if (!_service) { + return nullptr; + } + _displayInfoPlugin = _service->QueryInterfaceByCallsign(_T("DisplayInfo")); + if (!_displayInfoPlugin) { + SYSLOG(Logging::Error, (_T("Failed to query DisplayInfo plugin."))); + return nullptr; + } + return _displayInfoPlugin; + } + + bool SubscribeHDRCapabilities() + { + auto* displayInfoPlugin = QueryDisplayInfoPlugin(); + if (!displayInfoPlugin || _displayConnectionProps) { + return false; + } + _displayConnectionProps = displayInfoPlugin->QueryInterface(); + if (!_displayConnectionProps) { + SYSLOG(Logging::Error, (_T("Failed to query IConnectionProperties interface from DisplayInfo plugin."))); + return false; + } + _displayConnectionProps->Register(this); + SYSLOG(Logging::Notification, (_T("Subscribed to HDR capabilities updates from DisplayInfo plugin."))); + return true; + } + + void UnsubscribeHDRCapabilities() + { + if (_displayConnectionProps) { + _displayConnectionProps->Unregister(this); + _displayConnectionProps->Release(); + _displayConnectionProps = nullptr; + } + _adminLock.Lock(); + if (_hdrRefreshJob.IsValid()) { + Core::WorkerPool::Instance().Revoke(_hdrRefreshJob); + _hdrRefreshJob.Release(); + } + _adminLock.Unlock(); + if (_displayInfoPlugin) { + _displayInfoPlugin->Release(); + _displayInfoPlugin = nullptr; + } + SYSLOG(Logging::Notification, (_T("Unsubscribed from HDR capabilities updates from DisplayInfo plugin."))); + } + + void RefreshHDRSupport() + { + // HDR support will be set to false in case of any failure + bool isHDRSupported = false; + struct ScopeExit { + bool& isHDRSupported; + WebKitImplementation& browser; + ~ScopeExit() { + browser._adminLock.Lock(); + bool wasSupported = browser._hdrSupported; + browser._hdrSupported = isHDRSupported; + browser._adminLock.Unlock(); + if (wasSupported != isHDRSupported) { + SYSLOG(Logging::Notification, (_T("HDR support changed to %s"), isHDRSupported ? "true" : "false")); + } + } + } scope_exit{isHDRSupported, *this}; + + auto displayInfoPlugin = QueryDisplayInfoPlugin(); + if (!displayInfoPlugin) { + return; + } + Exchange::IHDRProperties* hdrPropIface = displayInfoPlugin->QueryInterface(); + if (!hdrPropIface) { + SYSLOG(Logging::Error, (_T("Failed to query IHDRProperties interface from DisplayInfo plugin."))); + return; + } + uint32_t rc = Core::ERROR_NONE; + Exchange::IHDRProperties::IHDRIterator* iter = nullptr; + if ((rc = hdrPropIface->STBCapabilities(iter)) != Core::ERROR_NONE) { + SYSLOG(Logging::Error, (_T("Failed to get STB HDR capabilities, error code: %u"), rc)); + hdrPropIface->Release(); + return; + } + + std::vector stbCaps; + Exchange::IHDRProperties::HDRType value; + while (iter->Next(value)) { + stbCaps.push_back(value); + } + iter->Release(); + iter = nullptr; + + if ((rc = hdrPropIface->TVCapabilities(iter)) != Core::ERROR_NONE) { + SYSLOG(Logging::Error, (_T("Failed to get TV HDR capabilities, error code: %u"), rc)); + hdrPropIface->Release(); + return; + } + + std::vector commonCaps; + while (iter->Next(value)) { + if (std::find(stbCaps.begin(), stbCaps.end(), value) != stbCaps.end()) { + commonCaps.push_back(value); + } + } + iter->Release(); + hdrPropIface->Release(); + + for (const auto& cap : commonCaps) { + if (cap > Exchange::IHDRProperties::HDRType::HDR_OFF) { + isHDRSupported = true; + break; + } + } + // _hdrSupported will be update in the scope exit handler + } + + void UpdateHDRSettings(WebKitSettings* settings) + { + ASSERT(settings != nullptr); + _adminLock.Lock(); + bool isHDRSupported = _hdrSupported; + _adminLock.Unlock(); + if (webkit_settings_get_screen_supports_hdr(settings) != isHDRSupported) { + SYSLOG(Logging::Notification, (_T("Updating HDR support setting to %s"), isHDRSupported ? "true" : "false")); + webkit_settings_set_screen_supports_hdr(settings, isHDRSupported); + } + } + + class HDRRefreshJob : public Core::IDispatch { + public: + HDRRefreshJob(WebKitImplementation& browser) + : _browser(browser) + { + } + ~HDRRefreshJob() override = default; + void Dispatch() override + { + _browser.RefreshHDRSupport(); + g_main_context_invoke( + _browser._context, + [](gpointer user_data) -> gboolean { + WebKitImplementation* browser = static_cast(user_data); + WebKitSettings* settings = webkit_web_view_get_settings(browser->_view); + browser->UpdateHDRSettings(settings); + return G_SOURCE_REMOVE; + }, + &_browser); + } + private: + WebKitImplementation& _browser; + }; + + // Exchange::IConnectionProperties::INotification implementation + // This method is called on the main thread of the plugin + // when the display connection properties are updated. + void Updated(const Exchange::IConnectionProperties::INotification::Source event) override + { + SYSLOG(Logging::Notification, (_T("Display connection properties updated, event: %s"), + Core::EnumerateType(event).Data())); + _adminLock.Lock(); + if (!_hdrRefreshJob.IsValid()) { + _hdrRefreshJob = Core::ProxyType::Create(*this); + // If a refresh is already scheduled, do nothing + } + // Delay the refresh to avoid too frequent updates + // and to allow the display connection properties to stabilize. + Core::WorkerPool::Instance().Reschedule(Core::Time::Now().Add(_config.HDRRefreshDelay.Value()), _hdrRefreshJob); + _adminLock.Unlock(); + } +#endif // HAS_SCREEN_HDR_API + void CheckWebProcess() { if ( _webProcessCheckInProgress ) @@ -3460,7 +2902,6 @@ static GSourceFuncs _handlerIntervention = _webProcessCheckInProgress = true; -#ifdef WEBKIT_GLIB_API webkit_web_view_is_web_process_responsive_async( _view, nullptr, @@ -3470,23 +2911,10 @@ static GSourceFuncs _handlerIntervention = webkit_impl->DidReceiveWebProcessResponsivenessReply(isWebProcessResponsive); }, this); -#else - WKPageIsWebProcessResponsive( - _page, - this, - [](bool isWebProcessResponsive, void* customdata) { - WebKitImplementation* object = static_cast(customdata); - object->DidReceiveWebProcessResponsivenessReply(isWebProcessResponsive); - }); -#endif } pid_t GetWebGetProcessIdentifier() { -#ifdef WEBKIT_GLIB_API return webkit_web_view_get_web_process_identifier(_view); -#else - return WKPageGetProcessIdentifier(GetPage()); -#endif } void DidReceiveWebProcessResponsivenessReply(bool isWebProcessResponsive) @@ -3507,11 +2935,7 @@ static GSourceFuncs _handlerIntervention = return; pid_t webprocessPID = GetWebGetProcessIdentifier(); -#ifdef WEBKIT_GLIB_API std::string activeURL(webkit_web_view_get_uri(_view)); -#else - std::string activeURL = GetPageActiveURL(GetPage()); -#endif if (isWebProcessResponsive) { SYSLOG(Logging::Notification, (_T("WebProcess recovered after %d unresponsive replies, pid=%u, url=%s\n"), @@ -3552,7 +2976,6 @@ static GSourceFuncs _handlerIntervention = } } -#ifdef WEBKIT_GLIB_API static void isWebProcessResponsiveCallback(WebKitWebView*, GParamSpec*, WebKitImplementation* self) { if (webkit_web_view_get_is_web_process_responsive(self->_view) == true) { @@ -3566,21 +2989,6 @@ static GSourceFuncs _handlerIntervention = } } } -#else - static void WebProcessDidBecomeResponsive(WKPageRef page, const void* clientInfo) - { - auto &self = *const_cast(static_cast(clientInfo)); - if (self._unresponsiveReplyNum > 0) { - - std::string activeURL = GetPageActiveURL(page); - pid_t webprocessPID = WKPageGetProcessIdentifier(page); - SYSLOG(Logging::Notification, (_T("WebProcess recovered after %d unresponsive replies, pid=%u, url=%s\n"), - self._unresponsiveReplyNum, webprocessPID, activeURL.c_str())); - self._unresponsiveReplyNum = 0; - } - } -#endif // WEBKIT_GLIB_API - void DeactivateBrowser(PluginHost::IShell::reason reason) { ASSERT(_service != nullptr); const char *reasonStr = Core::EnumerateType(reason).Data(); @@ -3596,24 +3004,11 @@ static GSourceFuncs _handlerIntervention = string _headers; bool _localStorageEnabled; int32_t _httpStatusCode; - -#ifdef WEBKIT_GLIB_API WebKitWebView* _view; uint64_t _guid; WebKitCookieAcceptPolicy _httpCookieAcceptPolicy; string _extensionPath; bool _ignoreLoadFinishedOnce; -#else - WKViewRef _view; - WKPageRef _page; - WKWebAutomationSessionRef _automationSession; - WKNotificationManagerRef _notificationManager; - WKHTTPCookieAcceptPolicy _httpCookieAcceptPolicy; - WKNavigationRef _navigationRef; - string _consoleLogPrefix; - WKUserContentControllerRef _userContentController; - WKCookieManagerRef _cookieManager; -#endif #if defined(ENABLE_CLOUD_COOKIE_JAR) Plugin::CookieJar _cookieJar; std::list _cookieJarClients; @@ -3635,194 +3030,16 @@ static GSourceFuncs _handlerIntervention = uint32_t _unresponsiveReplyNum; unsigned _frameCount; gint64 _lastDumpTime; + +#if HAS_SCREEN_HDR_API + PluginHost::IPlugin* _displayInfoPlugin; + Exchange::IConnectionProperties* _displayConnectionProps; + Core::ProxyType _hdrRefreshJob; + bool _hdrSupported; +#endif // HAS_SCREEN_HDR_API }; SERVICE_REGISTRATION(WebKitImplementation, 1, 0); - -#ifndef WEBKIT_GLIB_API - // Handles synchronous messages from injected bundle. - /* static */ void onDidReceiveSynchronousMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, - WKTypeRef messageBodyObj, WKTypeRef* returnData, const void* clientInfo) - { - int configLen = strlen(Tags::Config); - const WebKitImplementation* browser = static_cast(clientInfo); - - string name = WKStringToString(messageName); - - // Depending on message name, select action. - if (name == Tags::Notification) { - // Message contains strings from custom JS handler "NotifyWebbridge". - WKArrayRef messageLines = static_cast(messageBodyObj); - - std::vector messageStrings = ConvertWKArrayToStringVector(messageLines); - const_cast(browser)->OnJavaScript(messageStrings); - } else if (name == Tags::BridgeObjectQuery) { - WKStringRef messageBodyStr = static_cast(messageBodyObj); - string messageText = WKStringToString(messageBodyStr); - const_cast(browser)->OnBridgeQuery(messageText); - } else if (name == Tags::URL) { - string url; - static_cast(browser)->URL(url); - *returnData = WKStringCreateWithUTF8CString(url.c_str()); - } else if (name.compare(0, configLen, Tags::Config) == 0) { - // Second part of this string is the key we are looking for, extract it... - std::string utf8Json = Core::ToString(browser->GetConfig(name.substr(configLen))); - *returnData = WKStringCreateWithUTF8CString(utf8Json.c_str()); - } else { - // Unexpected message name. - std::cerr << "WebBridge received synchronous message (" << name << "), but didn't process it." << std::endl; - } - } - - /* static */ void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo) - { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - - WKURLRef urlRef = WKPageCopyActiveURL(page); - WKStringRef urlStringRef = WKURLCopyString(urlRef); - - string url = WKStringToString(urlStringRef); - - browser->SetNavigationRef(navigation); - browser->OnURLChanged(url); - - WKRelease(urlRef); - WKRelease(urlStringRef); - } - - /* static */ void didSameDocumentNavigation(const OpaqueWKPage* page, const OpaqueWKNavigation* nav, WKSameDocumentNavigationType type, const void* clientInfo, const void* info) - { - if (type == kWKSameDocumentNavigationAnchorNavigation) { - WebKitImplementation* browser = const_cast(static_cast(info)); - - WKURLRef urlRef = WKPageCopyActiveURL(page); - WKStringRef urlStringRef = WKURLCopyString(urlRef); - - string url = WKStringToString(urlStringRef); - - browser->OnURLChanged(url); - - WKRelease(urlRef); - WKRelease(urlStringRef); - } - } - - /* static */ void didFinishDocumentLoad(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo) - { - - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - - WKURLRef urlRef = WKPageCopyActiveURL(page); - WKStringRef urlStringRef = WKURLCopyString(urlRef); - - string url = WKStringToString(urlStringRef); - - browser->OnLoadFinished(url, navigation); - - WKRelease(urlRef); - WKRelease(urlStringRef); - } - - /* static */ void requestClosure(const void* clientInfo) - { - // WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - // TODO: @Igalia, make sure the clientInfo is actually holding the correct clientINfo, currently it is nullptr. For - // now we use the Singleton, this is fine as long as there is only 1 instance (in process) or it is always fine if we - // are running out-of-process.. - WebKitImplementation* realBrowser = static_cast(implementation); - realBrowser->NotifyClosure(); - } - - /* static */ void onNotificationShow(WKPageRef page, WKNotificationRef notification, const void* clientInfo) - { - const WebKitImplementation* browser = static_cast(clientInfo); - - WKStringRef titleRef = WKNotificationCopyTitle(notification); - WKStringRef bodyRef = WKNotificationCopyBody(notification); - - string title = WKStringToString(titleRef); - string body = WKStringToString(bodyRef); - - TRACE_GLOBAL(HTML5Notification, (_T("%s - %s"), title.c_str(), body.c_str())); - - // Tell page we've "shown" the notification. - uint64_t notificationID = WKNotificationGetID(notification); - browser->OnNotificationShown(notificationID); - - WKRelease(bodyRef); - WKRelease(titleRef); - } - - /* static */ void onFrameDisplayed(WKViewRef view, const void* clientInfo) - { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - browser->SetFPS(); - } - - /* static */ void didRequestAutomationSession(WKContextRef context, WKStringRef sessionID, const void* clientInfo) - { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - browser->OnRequestAutomationSession(context, sessionID); - } - - /* static */ WKPageRef onAutomationSessionRequestNewPage(WKWebAutomationSessionRef, const void* clientInfo) - { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - return browser->GetPage(); - } - - /* static */ void decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef response, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo) - { - WKFramePolicyListenerUse(listener); - if (WKNavigationResponseIsMainFrame(response)) - { - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - WKURLResponseRef urlResponse = WKNavigationResponseGetURLResponse(response); - browser->SetResponseHTTPStatusCode(WKURLResponseHTTPStatusCode(urlResponse)); - // WKRelease(urlResponse); - } - } - - /* static */ void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef navigation, WKErrorRef error, WKTypeRef userData, const void *clientInfo) - { - didFailNavigation(page, navigation, error, userData, clientInfo); - } - - /* static */ void didFailNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef, const void *clientInfo) - { - const int WebKitNetworkErrorCancelled = 302; - int errorcode = WKErrorGetErrorCode(error); - auto errorDomain = WKErrorCopyDomain(error); - - string url = GetPageActiveURL(page); - string message(string("{ \"url\": \"") + url + string("\", \"Error code\":") + Core::NumberType(errorcode).Text() + string(" }")); - SYSLOG(Logging::Notification, (_T("LoadFailed: %s"), message.c_str())); - - bool isCanceled = - errorDomain && - WKStringIsEqualToUTF8CString(errorDomain, "WebKitNetworkError") && - WebKitNetworkErrorCancelled == WKErrorGetErrorCode(error); - WKRelease(errorDomain); - - if (isCanceled) - return; - - WebKitImplementation* browser = const_cast(static_cast(clientInfo)); - browser->OnLoadFailed(url); - } - - /* static */ void webProcessDidCrash(WKPageRef, const void*) - { - SYSLOG(Logging::Fatal, (_T("CRASH: WebProcess crashed, exiting..."))); - exit(1); - } - - /* static */ void willAddDetailedMessageToConsole(WKPageRef, WKStringRef source, WKStringRef, uint64_t line, uint64_t column, WKStringRef message, WKStringRef, const void* clientInfo) - { - auto &self = *const_cast(static_cast(clientInfo)); - TRACE_GLOBAL(BrowserConsoleLog, (self.GetConsoleLogPrefix(), message, line, column)); - } -#endif // !WEBKIT_GLIB_API } // namespace Plugin } // namespace WPEFramework diff --git a/WebKitBrowser/YouTube.config b/WebKitBrowser/YouTube.config deleted file mode 100644 index fccd77df68..0000000000 --- a/WebKitBrowser/YouTube.config +++ /dev/null @@ -1,144 +0,0 @@ -set(autostart ${PLUGIN_YOUTUBE_AUTOSTART}) - -set(preconditions Graphics Internet) - -if(PLUGIN_YOUTUBE_STARTUPORDER) -set (startuporder ${PLUGIN_YOUTUBE_STARTUPORDER}) -endif() - -map() - kv(mode ${PLUGIN_YOUTUBE_MODE}) - kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) - if(PLUGIN_WEBKITBROWSER_USER) - kv(user ${PLUGIN_WEBKITBROWSER_USER}) - endif() - if(PLUGIN_WEBKITBROWSER_GROUP) - kv(group ${PLUGIN_WEBKITBROWSER_GROUP}) - endif() -end() -ans(rootobject) - -map() - kv(url "${PLUGIN_YOUTUBE_STARTURL}${PLUGIN_YOUTUBE_STARTURL_QUERYSTRING}") - if(PLUGIN_YOUTUBE_USERAGENT) - semicolon_safe_string(PLUGIN_YOUTUBE_USERAGENT) - kv(useragent ${PLUGIN_YOUTUBE_USERAGENT}) - endif() - if(NOT WEBKIT_GLIB_API) - kv(injectedbundle "libWPEInjectedBundle${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() - kv(extensiondir ${PLUGIN_WEBKITBROWSER_EXTENSION_DIRECTORY}) - endif() - kv(transparent ${PLUGIN_WEBKITBROWSER_TRANSPARENT}) - kv(compositor "noaa") - kv(inspector ${PLUGIN_YOUTUBE_WEBINSPECTOR_ADDRESS}) - kv(fps true) - kv(cursor false) - kv(touch false) - kv(msebuffers "${PLUGIN_YOUTUBE_MSEBUFFERS}") - kv(thunderdecryptorpreference ${PLUGIN_WEBKITBROWSER_THUNDER_DECRYPTOR_PREFERENCE}) - kv(memoryprofile ${PLUGIN_WEBKITBROWSER_MEMORYPROFILE}) - kv(mediacontenttypesrequiringhardwaresupport ${PLUGIN_WEBKITBROWSER_MEDIA_CONTENT_TYPES_REQUIRING_HARDWARE_SUPPORT}) - kv(mediadiskcache ${PLUGIN_WEBKITBROWSER_MEDIADISKCACHE}) - kv(diskcache ${PLUGIN_WEBKITBROWSER_DISKCACHE}) - kv(xhrcache ${PLUGIN_WEBKITBROWSER_XHRCACHE}) - kv(webgl ${PLUGIN_YOUTUBE_WEBGL}) - kv(threadedpainting ${PLUGIN_WEBKITBROWSER_THREADEDPAINTING}) - if(PLUGIN_YOUTUBE_HEIGHT) - kv(height ${PLUGIN_YOUTUBE_HEIGHT}) - endif() - if(PLUGIN_YOUTUBE_WIDTH) - kv(width ${PLUGIN_YOUTUBE_WIDTH}) - endif() - if(PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER) - kv(clientidentifier ${PLUGIN_WEBKITBROWSER_CLIENTIDENTIFIER}) - endif() - kv(localstorageenabled ${PLUGIN_YOUTUBE_LOCALSTORAGE_ENABLE}) - if(PLUGIN_WEBKITBROWSER_LOCALSTORAGE) - kv(localstorage ${PLUGIN_WEBKITBROWSER_LOCALSTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_COOKIESTORAGE) - kv(cookiestorage ${PLUGIN_WEBKITBROWSER_COOKIESTORAGE}) - endif() - if(PLUGIN_WEBKITBROWSER_WINDOWCLOSE) - kv(windowclose ${PLUGIN_WEBKITBROWSER_WINDOWCLOSE}) - endif() - if(PLUGIN_WEBKITBROWSER_PTSOFFSET) - kv(ptsoffset ${PLUGIN_WEBKITBROWSER_PTSOFFSET}) - endif() - if(PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH) - kv(execpath ${PLUGIN_WEBKITBROWSER_ALTERNATIVE_EXEC_PATH}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY) - kv(proxy ${PLUGIN_WEBKITBROWSER_HTTP_PROXY}) - endif() - if(PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION) - kv(proxyexclusion ${PLUGIN_WEBKITBROWSER_HTTP_PROXY_EXCLUSION}) - endif() - if(PLUGIN_WEBKITBROWSER_CLIENT_CERT AND PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY) - kv(clientcert ${PLUGIN_WEBKITBROWSER_CLIENT_CERT}) - kv(clientcertkey ${PLUGIN_WEBKITBROWSER_CLIENT_CERT_KEY}) - endif() - if(PLUGIN_WEBKITBROWSER_G_TLS_CIPHER_PRIORITY) - kv(cipherpriority ${PLUGIN_WEBKITBROWSER_G_TLS_CIPHER_PRIORITY}) - endif() - if(PLUGIN_WEBKITBROWSER_LOGTOSYSTEMCONSOLE) - kv(logtosystemconsoleenabled ${PLUGIN_WEBKITBROWSER_LOGTOSYSTEMCONSOLE}) - endif() - if(DEFINED PLUGIN_WEBKITBROWSER_SECURE) - kv(secure ${PLUGIN_WEBKITBROWSER_SECURE}) - endif() - kv(watchdogchecktimeoutinseconds 10) - kv(watchdoghangthresholdtinseconds 60) -end() -ans(configuration) - -map_append(${configuration} root ${rootobject}) - -map() -if(PLUGIN_WEBKITBROWSER_ENABLE_JIT) - kv(useJIT true) -else() - kv(useJIT false) -endif() -if(PLUGIN_WEBKITBROWSER_ENABLE_DFG) - kv(useDFG true) -else() - kv(useDFG false) -endif() -end() -ans(javascriptsettings) -map_append(${configuration} javascript ${javascriptsettings}) - -map() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT OR (PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) OR PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - key(webprocesssettings) - map() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT AND PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE) - kv(gpulimit ${PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_LIMIT}) - kv(gpufile ${PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_GPU_FILE}) -endif() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_YOUTUBE_MEMORYPRESSURE_WEBPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() - -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT OR PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - key(networkprocesssettings) - map() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT) - kv(limit ${PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_LIMIT}) -endif() -if(PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL) - kv(pollinterval ${PLUGIN_YOUTUBE_MEMORYPRESSURE_NETWORKPROCESS_SETTINGS_POLLINTERVAL}) -endif() - end() -endif() -end() -ans(memory) - -map_append(${configuration} memory ${memory}) diff --git a/WebKitBrowser/cmake/FindWPEWebKit.cmake b/WebKitBrowser/cmake/FindWPEWebKit.cmake index 89a5467d68..66a9aafe56 100644 --- a/WebKitBrowser/cmake/FindWPEWebKit.cmake +++ b/WebKitBrowser/cmake/FindWPEWebKit.cmake @@ -95,12 +95,6 @@ else() set(WPE_WEBKIT_DEPRECATED_API FALSE CACHE INTERNAL "" FORCE) endif() -if(WPE_WEBKIT_VERSION VERSION_GREATER 2.28.0) - set(WEBKIT_GLIB_API TRUE CACHE INTERNAL "" FORCE) -else() - set(WEBKIT_GLIB_API FALSE CACHE INTERNAL "" FORCE) -endif() - include(FindPackageHandleStandardArgs) find_package_handle_standard_args(WPEWebKit VERSION_VAR WPE_WEBKIT_VERSION