diff --git a/Messenger/Messenger.config b/Messenger/Messenger.config index e74dee81..be81996e 100644 --- a/Messenger/Messenger.config +++ b/Messenger/Messenger.config @@ -1,9 +1,17 @@ -set (autostart ${PLUGIN_MESSENGER_AUTOSTART}) +set(autostart ${PLUGIN_MESSENGER_AUTOSTART}) map() key(root) map() - kv(outofprocess ${PLUGIN_MESSENGER_OUTOFPROCESS}) + if(PLUGIN_MESSENGER_MODE) + kv(mode ${PLUGIN_MESSENGER_MODE}) + else() + if(PLUGIN_MESSENGER_OUTOFPROCESS) + kv(mode "Local") + else() + kv(mode "Off") + endif() + endif() end() end() diff --git a/OpenCDMi/OCDM.config b/OpenCDMi/OCDM.config index 0cacd3c6..d469a08c 100644 --- a/OpenCDMi/OCDM.config +++ b/OpenCDMi/OCDM.config @@ -7,7 +7,15 @@ if(PLUGIN_OPENCDMI_PLAYREADY_NEXUS OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_SVP OR PLU endif() map() - kv(outofprocess ${PLUGIN_OPENCDMI_OUTOFPROCESS}) + if(PLUGIN_OPENCDMI_MODE) + kv(mode ${PLUGIN_OPENCDMI_MODE}) + else() + if(PLUGIN_OPENCDMI_OUTOFPROCESS) + kv(mode "Local") + else() + kv(mode "Off") + endif() + endif() if(PLUGIN_OPENCDMI_USER) kv(user ${PLUGIN_OPENCDMI_USER}) endif() diff --git a/Packager/Packager.config b/Packager/Packager.config index 4f30ca82..343b3157 100644 --- a/Packager/Packager.config +++ b/Packager/Packager.config @@ -3,7 +3,15 @@ set(autostart ${PLUGIN_PACKAGER_AUTOSTART}) map() key(root) map() - kv(outofprocess ${PLUGIN_PACKAGER_OUTOFPROCESS}) + if(PLUGIN_PACKAGER_MODE) + kv(mode ${PLUGIN_PACKAGER_MODE}) + else() + if(PLUGIN_PACKAGER_OUTOFPROCESS) + kv(mode "Local") + else() + kv(mode "Off") + endif() + endif() end() end() ans(configuration) diff --git a/WebKitBrowser/Amazon.config b/WebKitBrowser/Amazon.config index 95cd70ac..c66d58bf 100644 --- a/WebKitBrowser/Amazon.config +++ b/WebKitBrowser/Amazon.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_AMAZON_AUTOSTART}) set(preconditions Graphics Internet) map() - kv(outofprocess true) + if(PLUGIN_AMAZON_MODE) + kv(mode ${PLUGIN_AMAZON_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_AMAZON_USER) kv(user ${PLUGIN_AMAZON_USER}) diff --git a/WebKitBrowser/Apps.config b/WebKitBrowser/Apps.config index d6662552..7a76e143 100644 --- a/WebKitBrowser/Apps.config +++ b/WebKitBrowser/Apps.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_APPS_AUTOSTART}) set(preconditions Graphics Internet) map() - kv(outofprocess true) + if(PLUGIN_APPS_MODE) + kv(mode ${PLUGIN_APPS_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) end() ans(rootobject) diff --git a/WebKitBrowser/HtmlApp.config b/WebKitBrowser/HtmlApp.config index dec4a229..10a9bcbc 100644 --- a/WebKitBrowser/HtmlApp.config +++ b/WebKitBrowser/HtmlApp.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_HTML_APP_AUTOSTART}) set(preconditions Graphics Internet) map() - kv(outofprocess true) + if(PLUGIN_HTML_APP_MODE) + kv(mode ${PLUGIN_HTML_APP_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/LightningApp.config b/WebKitBrowser/LightningApp.config index b455fef5..5fc0d966 100644 --- a/WebKitBrowser/LightningApp.config +++ b/WebKitBrowser/LightningApp.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_LIGHTNING_APP_AUTOSTART}) set(preconditions Graphics Internet) map() - kv(outofprocess true) + if(PLUGIN_LIGHTNING_APP_MODE) + kv(mode ${PLUGIN_LIGHTNING_APP_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/ResidentApp.config b/WebKitBrowser/ResidentApp.config index 5f63f588..0e638f6b 100644 --- a/WebKitBrowser/ResidentApp.config +++ b/WebKitBrowser/ResidentApp.config @@ -4,7 +4,11 @@ set(resumed true) set(preconditions Graphics) map() - kv(outofprocess true) + if(PLUGIN_RESIDENT_APP_MODE) + kv(mode ${PLUGIN_RESIDENT_APP_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/SearchAndDiscoveryApp.config b/WebKitBrowser/SearchAndDiscoveryApp.config index 104c054f..8cde643b 100644 --- a/WebKitBrowser/SearchAndDiscoveryApp.config +++ b/WebKitBrowser/SearchAndDiscoveryApp.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_SEARCH_AND_DISCOVERY_APP_AUTOSTART}) set(preconditions Graphics) map() - kv(outofprocess true) + if(PLUGIN_SEARCH_AND_DISCOVERY_APP_MODE) + kv(mode ${PLUGIN_SEARCH_AND_DISCOVERY_APP_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/UX.config b/WebKitBrowser/UX.config index e195990d..19b9bbfc 100644 --- a/WebKitBrowser/UX.config +++ b/WebKitBrowser/UX.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_UX_AUTOSTART}) set(preconditions Graphics) map() - kv(outofprocess true) + if(PLUGIN_UX_MODE) + kv(mode ${PLUGIN_UX_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/WebKitBrowser.config b/WebKitBrowser/WebKitBrowser.config index 35c2c96f..25cac954 100644 --- a/WebKitBrowser/WebKitBrowser.config +++ b/WebKitBrowser/WebKitBrowser.config @@ -8,7 +8,11 @@ else() endif(PLUGIN_WEBSERVER) map() - kv(outofprocess true) + if(PLUGIN_WEBKITBROWSER_MODE) + kv(mode ${PLUGIN_WEBKITBROWSER_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER}) diff --git a/WebKitBrowser/WebKitBrowser.cpp b/WebKitBrowser/WebKitBrowser.cpp index c563c605..76eff9e2 100644 --- a/WebKitBrowser/WebKitBrowser.cpp +++ b/WebKitBrowser/WebKitBrowser.cpp @@ -285,10 +285,10 @@ namespace Plugin { Exchange::JWebBrowser::Event::PageClosure(*this); } - void WebKitBrowser::BridgeQueryResponse(const string& message) + void WebKitBrowser::BridgeQuery(const string& message) { - TRACE(Trace::Information, (_T("BridgeQueryResponse: %s"), message.c_str())); - event_bridgequery(message); + TRACE(Trace::Information, (_T("BridgeQuery: %s"), message.c_str())); + event_bridgequery(message); } void WebKitBrowser::StateChange(const PluginHost::IStateControl::state state) diff --git a/WebKitBrowser/WebKitBrowser.h b/WebKitBrowser/WebKitBrowser.h index 028eaa99..ff995d35 100644 --- a/WebKitBrowser/WebKitBrowser.h +++ b/WebKitBrowser/WebKitBrowser.h @@ -83,9 +83,9 @@ namespace Plugin { { _parent.PageClosure(); } - void BridgeQueryResponse(const string& message) override + void BridgeQuery(const string& message) override { - _parent.BridgeQueryResponse(message); + _parent.BridgeQuery(message); } void StateChange(const PluginHost::IStateControl::state state) override { @@ -216,7 +216,7 @@ namespace Plugin { void URLChange(const string& URL, bool loaded); void VisibilityChange(const bool hidden); void PageClosure(); - void BridgeQueryResponse(const string& message); + void BridgeQuery(const string& message); void StateChange(const PluginHost::IStateControl::state state); uint32_t DeleteDir(const string& path); diff --git a/WebKitBrowser/WebKitImplementation.cpp b/WebKitBrowser/WebKitImplementation.cpp index ff8ad6fc..a24f4f24 100644 --- a/WebKitBrowser/WebKitImplementation.cpp +++ b/WebKitBrowser/WebKitImplementation.cpp @@ -805,6 +805,7 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } + uint32_t UserAgent(string& ua) const override { _adminLock.Lock(); @@ -852,6 +853,7 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } + uint32_t LocalStorageEnabled(bool& enabled) const override { _adminLock.Lock(); @@ -897,6 +899,7 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } + uint32_t HTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyType& policy) const override { #ifdef WEBKIT_GLIB_API @@ -935,6 +938,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); return Core::ERROR_NONE; } + uint32_t HTTPCookieAcceptPolicy(const HTTPCookieAcceptPolicyType policy) override { if (_context == nullptr) @@ -1012,16 +1016,19 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } + uint32_t BridgeReply(const string& payload) override { SendToBridge(Tags::BridgeObjectReply, payload); return Core::ERROR_NONE; } + uint32_t BridgeEvent(const string& payload) override { SendToBridge(Tags::BridgeObjectEvent, payload); return Core::ERROR_NONE; } + void SendToBridge(const string& name, const string& payload) { if (_context == nullptr) @@ -1061,7 +1068,8 @@ static GSourceFuncs _handlerIntervention = }); } - uint32_t CollectGarbage() override { + uint32_t CollectGarbage() override + { g_main_context_invoke_full( _context, G_PRIORITY_DEFAULT, @@ -1134,6 +1142,7 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } + uint32_t URL(string& url) const override { _adminLock.Lock(); @@ -1142,15 +1151,18 @@ static GSourceFuncs _handlerIntervention = return 0; } + uint32_t FPS(uint8_t& fps) const override { fps = _fps; return 0; } + PluginHost::IStateControl::state State() const override { return (_state); } + uint32_t Request(PluginHost::IStateControl::command command) override { uint32_t result = Core::ERROR_ILLEGAL_STATE; @@ -1185,6 +1197,7 @@ static GSourceFuncs _handlerIntervention = return (result); } + void Register(PluginHost::IStateControl::INotification* sink) { _adminLock.Lock(); @@ -1199,6 +1212,7 @@ static GSourceFuncs _handlerIntervention = TRACE(Trace::Information, (_T("Registered a sink on the browser %p"), sink)); } + void Unregister(PluginHost::IStateControl::INotification* sink) { _adminLock.Lock(); @@ -1216,6 +1230,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void Hide(const bool hidden) override { if (hidden == true) { @@ -1224,19 +1239,26 @@ static GSourceFuncs _handlerIntervention = Show(); } } - void SetURL(const string& url) override { + + void SetURL(const string& url) override + { URL(url); } - string GetURL() const override { + + string GetURL() const override + { string url; URL(url); return url; } - uint32_t GetFPS() const override { + + uint32_t GetFPS() const override + { uint8_t fps = 0; FPS(fps); return static_cast(fps); } + void Register(Exchange::IWebBrowser::INotification* sink) override { _adminLock.Lock(); @@ -1269,6 +1291,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void Register(Exchange::IBrowser::INotification* sink) override { _adminLock.Lock(); @@ -1304,7 +1327,8 @@ static GSourceFuncs _handlerIntervention = // IApplication implementation - void Register(Exchange::IApplication::INotification* sink) override { + void Register(Exchange::IApplication::INotification* sink) override + { _adminLock.Lock(); // Make sure a sink is not registered multiple times. @@ -1318,7 +1342,8 @@ static GSourceFuncs _handlerIntervention = TRACE(Trace::Information, (_T("Registered an IApplication sink on the browser %p"), sink)); } - void Unregister(Exchange::IApplication::INotification* sink) override { + void Unregister(Exchange::IApplication::INotification* sink) override + { _adminLock.Lock(); std::list::iterator index(std::find(_applicationClients.begin(), _applicationClients.end(), sink)); @@ -1335,11 +1360,13 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } - uint32_t Reset(const resettype type) override { + uint32_t Reset(const resettype type) override + { return Core::ERROR_UNAVAILABLE; } - uint32_t Identifier(string& id) const override { + uint32_t Identifier(string& id) const override + { const PluginHost::ISubSystem::IIdentifier* identifier(_service->SubSystems()->Get()); if (identifier != nullptr) { @@ -1358,31 +1385,37 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } - uint32_t ContentLink(const string& link) override { + uint32_t ContentLink(const string& link) override + { return Core::ERROR_UNAVAILABLE; } - uint32_t LaunchPoint(launchpointtype& point) const override { + uint32_t LaunchPoint(launchpointtype& point) const override + { return Core::ERROR_UNAVAILABLE; } - uint32_t LaunchPoint(const launchpointtype&) override { + uint32_t LaunchPoint(const launchpointtype&) override + { return Core::ERROR_UNAVAILABLE; } - uint32_t Visible(bool& visiblity) const override { + uint32_t Visible(bool& visiblity) const override + { _adminLock.Lock(); visiblity = (_hidden == false); _adminLock.Unlock(); return Core::ERROR_NONE; } - uint32_t Visible(const bool& visiblity) override { + uint32_t Visible(const bool& visiblity) override + { Hide(!visiblity); return Core::ERROR_NONE; } - uint32_t Language(string& language) const override { + uint32_t Language(string& language) const override + { _adminLock.Lock(); Core::JSON::ArrayType langsArray = _config.Languages; _adminLock.Unlock(); @@ -1391,7 +1424,8 @@ static GSourceFuncs _handlerIntervention = return Core::ERROR_NONE; } - uint32_t Language(const string& language) override { + uint32_t Language(const string& language) override + { if (_context == nullptr) return Core::ERROR_GENERAL; @@ -1476,12 +1510,14 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + #ifdef WEBKIT_GLIB_API void OnLoadFinished() { string URL = Core::ToString(webkit_web_view_get_uri(_view)); OnLoadFinished(URL); } + void OnLoadFinished(const string& URL) { #else @@ -1514,6 +1550,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void OnLoadFailed() { _adminLock.Lock(); @@ -1527,6 +1564,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void OnStateChange(const PluginHost::IStateControl::state newState) { _adminLock.Lock(); @@ -1544,6 +1582,7 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void Hidden(const bool hidden) { _adminLock.Lock(); @@ -1577,12 +1616,14 @@ static GSourceFuncs _handlerIntervention = _adminLock.Unlock(); } + void OnJavaScript(const std::vector& text) const { for (const string& line : text) { std::cout << " " << line << std::endl; } } + void OnBridgeQuery(const string& text) { _adminLock.Lock(); @@ -1590,7 +1631,7 @@ static GSourceFuncs _handlerIntervention = std::list::iterator index(_notificationClients.begin()); while (index != _notificationClients.end()) { - (*index)->BridgeQueryResponse(text); + (*index)->BridgeQuery(text); index++; } diff --git a/WebKitBrowser/YouTube.config b/WebKitBrowser/YouTube.config index 611cf5e1..2fa6b3ca 100644 --- a/WebKitBrowser/YouTube.config +++ b/WebKitBrowser/YouTube.config @@ -3,7 +3,11 @@ set(autostart ${PLUGIN_YOUTUBE_AUTOSTART}) set(preconditions Graphics Internet) map() - kv(outofprocess true) + if(PLUGIN_YOUTUBE_MODE) + kv(mode ${PLUGIN_YOUTUBE_MODE}) + else() + kv(mode "Local") + endif() kv(locator lib${PLUGIN_WEBKITBROWSER_IMPLEMENTATION}.so) if(PLUGIN_WEBKITBROWSER_USER) kv(user ${PLUGIN_WEBKITBROWSER_USER})