From d313d7021ff551f2a5ef7ec54ff2b3234d96017b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 17 May 2021 13:37:13 -0400 Subject: SL-15200: Add LLApp::sleep(duration) methods. Two sleep() methods: one accepting F32Milliseconds, or in general any LLUnits time class; the other accepting any std::chrono::duration. The significant thing about each of these sleep() methods, as opposed to any freestanding sleep() function, is that it only sleeps until the app starts shutdown. Moreover, it returns true if it slept for the whole specified duration, false if it woke for app shutdown. This is accomplished by making LLApp::sStatus be an LLScalarCond instead of a plain EAppStatus enum, and by making setStatus() call set_all() each time the value changes. Then each new sleep() method can call wait_for_unequal(duration, APP_STATUS_RUNNING). Introducing llcond.h into llapp.h triggered an #include circularity because llthread.h #included llapp.h even though it didn't reference anything from it. Removed. This, in turn, necessitated adding #include "llapp.h" to several .cpp files that reference LLApp but had been depending on other header files to drag in llapp.h. --- indra/llplugin/llpluginprocessparent.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 7d18bae947..a89561fce0 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -28,6 +28,7 @@ #include "linden_common.h" +#include "llapp.h" #include "llpluginprocessparent.h" #include "llpluginmessagepipe.h" #include "llpluginmessageclasses.h" -- cgit v1.2.3 From 0c89e67eb5bf2d82596d0c697831787cbbdf1e7f Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 20 Aug 2021 08:28:48 -0700 Subject: DRTVWR-534: Batch of modifications to 360 capture project after moving from internal repo to public one. --- indra/llplugin/llpluginclassmedia.cpp | 22 ++++++++++++++++++++++ indra/llplugin/llpluginclassmedia.h | 4 ++++ 2 files changed, 26 insertions(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 6d51adc685..da352e8dd4 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -714,6 +714,15 @@ void LLPluginClassMedia::loadURI(const std::string &uri) sendMessage(message); } +void LLPluginClassMedia::executeJavaScript(const std::string &code) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "execute_javascript"); + + message.setValue("code", code); + + sendMessage(message); +} + const char* LLPluginClassMedia::priorityToString(EPriority priority) { const char* result = "UNKNOWN"; @@ -891,6 +900,19 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled) sendMessage(message); } +void LLPluginClassMedia::setWebSecurityDisabled(const bool disabled) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "web_security_disabled"); + message.setValueBoolean("disabled", disabled); + sendMessage(message); +} + +void LLPluginClassMedia::setFileAccessFromFileUrlsEnabled(const bool enabled) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "file_access_from_file_urls"); + message.setValueBoolean("enabled", enabled); + sendMessage(message); +} void LLPluginClassMedia::enableMediaPluginDebugging( bool enable ) { diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 382f891e0c..69622c62db 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -139,6 +139,8 @@ public: void loadURI(const std::string &uri); + void executeJavaScript(const std::string &code); + // "Loading" means uninitialized or any state prior to fully running (processing commands) bool isPluginLoading(void) { return mPlugin?mPlugin->isLoading():false; }; @@ -199,6 +201,8 @@ public: void setLanguageCode(const std::string &language_code); void setPluginsEnabled(const bool enabled); void setJavascriptEnabled(const bool enabled); + void setWebSecurityDisabled(const bool disabled); + void setFileAccessFromFileUrlsEnabled(const bool enabled); void setTarget(const std::string &target); /////////////////////////////////// -- cgit v1.2.3